-
Notifications
You must be signed in to change notification settings - Fork 523
Add test requirements #499
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
Conversation
|
|
|
I suppose it doesn't matter much either way, since six is the only regular requirement. |
|
We can tweak the way requirements are being imported a bit later, for now I'll just leave |
| commands = pytest {posargs} | ||
| deps = | ||
| six,pytest,freezegun | ||
| deps = -rtest_requirements.txt |
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 know I'm late here but you'd usually see requirements-dev.txt rather than test_requirements.
It is even "reserved" in PyPI https://pypi.python.org/pypi/requirements-dev.txt (random person)
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.
Definitely not too late to move it. What do you think of the suggestion of dropping six proposed above? We can do both changes in one PR.
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.
Your requirement file should provide a "reproducible python environment". It should include all your dependencies.
What some people do if you want to split runtime/build vs test requirements you can include one from another.
Example: having requirements.txt with actual dependencies and requirements-dev.txt including requirements.txt (you can do -r)
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.
What you might want though is to pin the versions in your requirements file.
You can get the version you used with pip freeze > requirements-dev.txt
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.
You might be able to add mock using markers as well here:
mock ; python_version < '3.0' (Try this out, I am just writing in github)
|
The six thing I asked about largely because I've had tox problems when a dependency gets specified multiple times. If it isn't causing problems here, don't spend much time worrying about it. |
| package_data={"dateutil.zoneinfo": ["dateutil-zoneinfo.tar.gz"]}, | ||
| zip_safe=True, | ||
| requires=["six"], | ||
| tests_require=["freezegun", "pytest"], |
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.
Why did you remove this list? I could still be read from the file.
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 believe this is only ever useful for python setup.py test, and now that we're using pytest (and haven't configured setup.py test to run the tests yet), it's useless to have it around. There's probably some utility in setting up setup.py test so it works properly, but my understanding is that the test target is considered something of a failed experiment.
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.
and now that we're using pytest (and haven't configured
setup.pytest to run the tests yet)
Ok, I can look up how other projects call pytest. I think it's quite simple.
Switch over test dependency management to a more centralized
test_requirements.txt.HT @mariocj89