-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
script/cibuild-setup-py: install all dev requirements for testing #42
Conversation
install all requirements stored in requirements-dev instead of only a short hardcoded list
It intentionally doesn't install requirements-dev.txt before running tests to prevent things in that file from being accidental production/runtime dependencies. Those requirements are test-time and rather than development related. You can see the distinction in setup.py, Lines 23 to 28 in 7011a39
and Lines 34 to 49 in 7011a39
Iirc i looked into installing the test specific requirements with pip in the past with something like pip install dist/*$VERSION*.whl[test] but ran into problems/bugs that prevented it from functioning correctly. Even then it would allow things in the test section to be accidental "production" requirements so there's a small(er) risk to that. |
Oh, forgot to mention, setup.py also explicitly doesn't use requirements.txt and sources everything from setup.py since that's what it's specifically testing. requirements*.txt is used for all the other testing. |
install test dependencies from setup.py / built wheel file before running pytest
don't install complete list of dev requirements for the test execution as this could mask runtime dependencies to dev requirements as discussed in octodns/octodns-template#42
i was aware of the difference between the requirements for test and dev in setup.py. If you list the same test requirements in the ci script as in the i just tried running the tests with I updated the script in my MR and tried the modified version in the repo of the autodns-provider and it does seem to work correctly there (example run) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just tried running the tests with
pip install "${wheelfile}[test]"
and it seems to work correctly the only issue is that pip doesn't support file globbing when executed this way.
🆒 It was long enough ago that I don't remember what problems(s) I hit with it. Maybe this was it or it was another since addressed shortcoming with pip.
I updated the script in my MR and tried the modified version in the repo of the autodns-provider and it does seem to work correctly there (example run)
👍
install all requirements stored in requirements-dev instead of only a short hardcoded list for the test of the test after build