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

Missing test dependencies: hypothesis #753

Closed
buhtz opened this issue Dec 28, 2023 · 4 comments · Fixed by #760
Closed

Missing test dependencies: hypothesis #753

buhtz opened this issue Dec 28, 2023 · 4 comments · Fixed by #760

Comments

@buhtz
Copy link
Contributor

buhtz commented Dec 28, 2023

I installed via --editable and got this error message.

=========================================================== ERRORS ============================================================
________________________________________ ERROR collecting pydoctor/test/test_sphinx.py ________________________________________
ImportError while importing test module '/home/user/ownCloud/my.work/pydoctor/pydoctor/test/test_sphinx.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
pydoctor/test/test_sphinx.py:18: in <module>
    from hypothesis import assume, given, settings
E   ModuleNotFoundError: No module named 'hypothesis'
=================================================== short test summary info ===================================================

There is no pyproject.toml and also in the setup.* file I can not see a dedicated install target (e.g. python3 -m pip install -e .[dev]).

Hypothesis should be a dependency.

@tristanlatr
Copy link
Contributor

This requirement is installed through tox. I agree it should be listed in the setup.cfg under the test requirements, but for the short term: can you use tox to run tests ?

@buhtz
Copy link
Contributor Author

buhtz commented Dec 28, 2023

can you use tox to run tests ?

Describe in the docu how and then I can.
I don't like tox and don't think this is something external contributors should be bothered with. But it is your decision as upstream maintainer. But part of your decision then should be documented.
Do not expect that contributors know what tox is or know how to use it. It would be easier for all of us if you would stick to default-vanilla Python build system. You can use tox/poetry/fancy-xyz in your CI or your not-public build machine.

And I don't trust your tox config. Even your vanilla unit tests do use the real filesystem. How does tox mess up my system then?

Your tox do not work out of the box. See #755.

@tristanlatr
Copy link
Contributor

Ok lets move the test dependencies out of the tox config so tests can by simply be run with pytest.

@tristanlatr
Copy link
Contributor

it looks like all the test dependencies are already liste in the test extras: https://github.com/twisted/pydoctor/blob/662eafaedcdfcfa0c5a83c1048c28f187fbcf4c9/setup.cfg#L64C6-L64C6

so it’s just a matter of installing the test extra and documenting this process.

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

Successfully merging a pull request may close this issue.

2 participants