Skip to content

Add test requirements#499

Merged
pganssle merged 2 commits into
dateutil:masterfrom
pganssle:add_test_requirements
Nov 6, 2017
Merged

Add test requirements#499
pganssle merged 2 commits into
dateutil:masterfrom
pganssle:add_test_requirements

Conversation

@pganssle

@pganssle pganssle commented Nov 6, 2017

Copy link
Copy Markdown
Member

Switch over test dependency management to a more centralized test_requirements.txt.

HT @mariocj89

@pganssle pganssle added the tests label Nov 6, 2017
@pganssle pganssle added this to the 2.7.0 milestone Nov 6, 2017
@jbrockmendel

Copy link
Copy Markdown
Contributor

six is a regular requirement. Are test_requirements on top of regular requirements or instead of?

@pganssle

pganssle commented Nov 6, 2017

Copy link
Copy Markdown
Member Author

I suppose it doesn't matter much either way, since six is the only regular requirement.

@pganssle

pganssle commented Nov 6, 2017

Copy link
Copy Markdown
Member Author

We can tweak the way requirements are being imported a bit later, for now I'll just leave six, because I'm trying to get us to a reasonable baseline so I can rebase the Isoparser branch.

@pganssle
pganssle merged commit e841a45 into dateutil:master Nov 6, 2017
Comment thread tox.ini
commands = pytest {posargs}
deps =
six,pytest,freezegun
deps = -rtest_requirements.txt No newline at end of file

@mariocj89 mariocj89 Nov 7, 2017

Copy link
Copy Markdown
Member

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)

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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)

@mariocj89 mariocj89 Nov 7, 2017

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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)

@jbrockmendel

Copy link
Copy Markdown
Contributor

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.

Comment thread setup.py
package_data={"dateutil.zoneinfo": ["dateutil-zoneinfo.tar.gz"]},
zip_safe=True,
requires=["six"],
tests_require=["freezegun", "pytest"],

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown

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.py test to run the tests yet)

Ok, I can look up how other projects call pytest. I think it's quite simple.

@pganssle pganssle mentioned this pull request Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants