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

Problem discussion #1

Closed
merwok opened this issue Dec 22, 2017 · 9 comments
Closed

Problem discussion #1

merwok opened this issue Dec 22, 2017 · 9 comments

Comments

@merwok
Copy link

merwok commented Dec 22, 2017

The problem seems to be that your requirements are not complete, i.e. not produced by pip freeze or pip-compile. In the first run, pip-sync installs pytest and its dependencies (py) implicitly; in the second run, py is removed because it’s not listed in the requirements file.

The correct flow is: write your direct dependencies in .in files (e.g. pytest in test-requirements.in), generate the list of all depencies with constraints resolved and exact versions (this will put pytest and py in test-requirements.txt). pip-sync will then work as expected.

@nicain
Copy link
Owner

nicain commented Dec 22, 2017

@merwok
Copy link
Author

merwok commented Dec 22, 2017

Something like exactly what the pip-tools docs describe! They edited the readme recently to make it even clearer than pip-sync needs frozen (complete) requirement files.

@nicain
Copy link
Owner

nicain commented Dec 22, 2017

AWESOME! Pushed a complete fixed branch here: https://github.com/nicain/reproduce_tox_issue/tree/fix

@merwok thanks for all your help. I am still learning all of this workflow, and I really appreciate you taking the time to educate me :)

@merwok
Copy link
Author

merwok commented Dec 22, 2017

Glad to help! Happy solstice!

@merwok
Copy link
Author

merwok commented Dec 22, 2017

test requirements should not include (with -r) the base requirements. See discussions in the open issues of pip-tools for more info.

@nicain
Copy link
Owner

nicain commented Dec 22, 2017

OK. I was following (my interpretation of) jazzband/pip-tools#398 (comment)

Is there a change in https://github.com/nicain/reproduce_tox_issue/tree/fix that I should make?

@merwok
Copy link
Author

merwok commented Dec 22, 2017

See these discussions:
jazzband/pip-tools#573 (comment)
nedbat/django_coverage_plugin#44

The change needed is: remove -r requirements.txt from test-requirements.in

@nicain
Copy link
Owner

nicain commented Dec 22, 2017

Oh, I think I see; because of:

commands =
    pip-sync requirements.txt requirements-test.txt
    pyflakes project
    pytest {posargs}

Any runtime req's in requirements.in (converted to requirements.txt) are already taken care of. This keeps requirements.txt (converted from requirements.in) clean, and only listing the testing dep's, right?

@merwok
Copy link
Author

merwok commented Dec 22, 2017

Exactly.

@nicain nicain closed this as completed Dec 22, 2017
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