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

Option --pre doesn't work in requirements.in #819

Closed
atugushev opened this issue May 16, 2019 · 2 comments · Fixed by #822
Closed

Option --pre doesn't work in requirements.in #819

atugushev opened this issue May 16, 2019 · 2 comments · Fixed by #822
Labels
bug Something is not working

Comments

@atugushev
Copy link
Member

atugushev commented May 16, 2019

The option --pre set in requirements.in doesn't work as expected. Neither --pre package or package==0.0.1 --pre. If --pre passed to the CLI it works like a charm. It seems PyPIRepository doesn't respect PackageFinder.allow_all_prereleases parameter.

Environment Versions
  1. OS Type MacOS 10.14.3
  2. Python version: 3.7.3
  3. pip version: pip 19.1.1 from /Projects/pip-tools/.venv/lib/python3.7/site-packages/pip (python 3.7)
  4. pip-tools version: pip-compile, version 3.7.0
Steps to replicate
  1. requirements.in:
cat << EOF > requirements.in
--pre django
django<2.2rc1 --pre
EOF
  1. pip-compile -rqo-
Expected result
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --output-file=-
#
django==2.2b1
pytz==2019.1              # via django
sqlparse==0.3.0           # via django
Actual result
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --output-file=-
#
django==2.1.8
pytz==2019.1              # via django
Works fine with
$ pip-compile -rqo- --pre
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --output-file=- --pre
#
django==2.2b1
pytz==2019.1              # via django
sqlparse==0.3.0           # via django
@atugushev atugushev added the bug Something is not working label May 16, 2019
@atugushev
Copy link
Member Author

atugushev commented May 17, 2019

@blueyed

digging in pip internals i've found that --pre is a global boolean flag. You can't set --pre to a specific package, neither in CLI or requirements.txt file, see:

$ pip install --pre=django django channels

Usage:
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

--pre option does not take a value

So --pre can be used only in two ways:

  1. As CLI option: pip install --pre
  2. As file-based option inside requirements.txt:
$ cat requirements.txt
--pre
django

Looks like it's not a bug, but in the meantime maybe it's a reason to raise an issue on pip side for these points:

  • if there is a --pre django in requirements.txt, pip should set --pre and install django
  • if there is a django --pre in requirements.txt, pip should raise "unsupported requirement option"

Cheers!

@atugushev
Copy link
Member Author

atugushev commented May 22, 2019

Anyways, --pre in requirements.in file doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant