Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add requirements.txt to pg_probackup2#218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
demonolock wants to merge1 commit intomasterfromadd-requirements-pg_probackup2

Conversation

demonolock
Copy link
Contributor

No description provided.

@dmitry-lipetsk
Copy link
Collaborator

Виктория

Я думаю нам нужен корневой requirements.txt с прописыванием внешних модулей, необходимых для разработки. Ну или готовый sh для инициализации окружения (я именно такой вариант и использую):

create_py_env.sh:

virtualenv venvsource venv/bin/activate# pip install -U .pip install flake8pip install pytestpip install pytest-xdistpip install psycopg2pip install sixpip install psutil

И здесь нужно прописать путь до собственного каталога testgres.

Чтобы можно было выполнить инициализацию (виртуального) окружения и потом без проблем запускать как тесты самого testgres так и тесты плагина для пробакапа.

Если testgres будет здесь прописан как модуль, то наверное и его собственные тесты могут подключать его по-человечески, а не через косвенные пути (как это сделано сейчас).

@dmitry-lipetsk
Copy link
Collaborator

Привет.

Я разобрался с той проблемой в плагине

====== ERRORS ======_______ ERROR collecting testgres/plugins/pg_probackup2/pg_probackup2/tests/test_basic.py _______ImportError while importing test module '/home/dima/MY/GitHub2/testgres/master/work01py3_8/testgres/plugins/pg_probackup2/pg_probackup2/tests/test_basic.py'.Hint: make sure your test modules/packages have valid Python names.Traceback:/home/dima/.pyenv/versions/3.12.1/lib/python3.12/importlib/__init__.py:90: in import_module    return _bootstrap._gcd_import(name[level:], package, level)testgres/plugins/__init__.py:2: in <module>    from .pg_probackup2.pg_probackup2.app import ProbackupApp, ProbackupExceptiontestgres/plugins/pg_probackup2/pg_probackup2/app.py:12: in <module>    import testgresE   ModuleNotFoundError: No module named 'testgres'====== short test summary info ======ERROR testgres/plugins/pg_probackup2/pg_probackup2/tests/test_basic.py====== 267 passed, 3 skipped, 1 error in 318.20s (0:05:18) ======

Она лечится с помощью переменной окружения PYTHONPATH:

export PYTHONPATH=<путь до каталога с проектом testgres>

Я этот трюк увидел в run_tests.py и понял что к чему )

Так что если этот requirements.txt добавлялся из-за этой проблемы, то он уже получается не нужен.

@dmitry-lipetsk
Copy link
Collaborator

It was done via#241

We did it )

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dmitry-lipetskdmitry-lipetskAwaiting requested review from dmitry-lipetsk

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@demonolock@dmitry-lipetsk

[8]ページ先頭

©2009-2025 Movatter.jp