Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running pipenv run pytest #13

Open
marktani opened this issue Mar 29, 2023 · 2 comments
Open

Error when running pipenv run pytest #13

marktani opened this issue Mar 29, 2023 · 2 comments

Comments

@marktani
Copy link

Following the instructions from README, when running pipenv run pytest this is my output:

ImportError while importing test module '/Users/nilan/projects/cdli-cts-server/test_app.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_app.py:4: in <module>
    import main
main.py:11: in <module>
    from capitains_nautilus.cts.resolver import NautilusCTSResolver
../../.local/share/virtualenvs/cdli-cts-server-9o7IsoQ-/lib/python3.9/site-packages/capitains_nautilus/cts/resolver.py:4: in <module>
    from werkzeug.contrib.cache import NullCache
E   ModuleNotFoundError: No module named 'werkzeug.contrib'

It looks like werkzeug.contrib has been removed in some versions after 0.16.0 (see here for example), so the proposed solution is this:

pip uninstall werkzeug
pip install werkzeug==0.16.0

resulting in the following error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 2.2.3 requires Werkzeug>=2.2.2, but you have werkzeug 0.16.0 which is incompatible.

Ok, so we also need to adjust flask to an older version.

I continued to dig for some versions that work well with each other and this example, but I have had no luck.

@rillian
Copy link
Collaborator

rillian commented Mar 29, 2023

Yeah, things have bit-rotted pretty badly. I hoped having pipenv.lock in the repo would record a working configuration, but I can't figure out how to update the python version without it bumping everything else.

Even when I run a python:3.7 container image, I still get the werkzeug.contrib error. It looks like capitains-nautilus needs porting to the stable release.

@marktani
Copy link
Author

marktani commented Mar 29, 2023

I was able to find a working version combination with the latest, unpublished capitains-nautilus@dev (see the issue you linked for exact steps how to install that as a submodule).

Here is the working requirements.txt and the resulting frozen requirements after installing everything working_requirements.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants