-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Installion Command with --pre
and Pinning is Inconsistent
#2022
Comments
I just want to note that behavioral changes will need Kenneth's review and I doubt he will sign off on requiring user input -- I can pretty much say no to that here from a design perspective. The other question about installing a specific package alone without specifying @ncoghlan, do you have any thoughts? |
Short answer: I think it would make sense to have this "just work" (regardless of the Long answer: The guiding principle that Warehouse uses for the main web UI (i.e. https://pypi.org/project/black/ ) is to show the non-pre-release with the highest PEP 440 version number, unless the project only has pre-releases, in which case it shows the pre-release with the highest version number. This is the behaviour that PEP 440 recommends: https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases The In the case of |
Upon discussion I think this is out of scope for now, this has additional complexity and you can already install prereleases by just using a strict pin |
This is not an exact duplicate of #2019, but the two are certainly related.
Help Output:
$ python -m pipenv.help output
Pipenv version:
'11.10.0'
Pipenv location:
'/Users/andrew/.virtualenvs/static-site-test/lib/python3.6/site-packages/pipenv'
Python location:
'/Users/andrew/.virtualenvs/static-site-test/bin/python'
Other Python installations in
PATH
:2.6
:/usr/bin/python2.6
2.6
:/usr/bin/python2.6
2.7
:/opt/local/bin/python2.7
2.7
:/opt/local/bin/python2.7
2.7
:/usr/bin/python2.7
3.4
:/opt/local/bin/python3.4m
3.4
:/opt/local/bin/python3.4
3.5
:/opt/local/bin/python3.5m
3.5
:/opt/local/bin/python3.5
3.6
:/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m
3.6
:/Users/andrew/.virtualenvs/static-site-test/bin/python3.6
3.6
:/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
3.6
:/opt/local/bin/python3.6
3.6.4
:/Users/andrew/.virtualenvs/static-site-test/bin/python
3.6.4
:/opt/local/bin/python
2.7.10
:/usr/bin/python
3.6.4
:/Users/andrew/.virtualenvs/static-site-test/bin/python3
3.6.4
:/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
3.6.4
:/opt/local/bin/python3
PEP 508 Information:
System environment variables:
GIT_PS1_SHOWUNTRACKEDFILES
VIRTUALENVWRAPPER_WORKON_CD
VIRTUALENVWRAPPER_HOOK_DIR
LANG
XPC_FLAGS
OLDPWD
TERM_SESSION_ID
WORKON_HOME
GEM_HOME
__CF_USER_TEXT_ENCODING
CFLAGS
SSH_AUTH_SOCK
VIRTUAL_ENV
PREFIX
USER
ENV
LSCOLORS
PWD
HOME
GIT_PS1_SHOWDIRTYSTATE
TERM_PROGRAM
CLICOLOR
TERM_PROGRAM_VERSION
GIT_PS1_SHOWCOLORHINTS
Apple_PubSub_Socket_Render
TMPDIR
PROJECT_HOME
XPC_SERVICE_NAME
VIRTUALENVWRAPPER_SCRIPT
TERM
SHELL
SHLVL
PROMPT_COMMAND
MANPATH
LOGNAME
LDFLAGS
VIRTUALENVWRAPPER_PROJECT_FILENAME
PATH
PS1
_
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONUNBUFFERED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/Users/andrew/.virtualenvs/static-site-test/bin:/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/opt/local/bin:/opt/local/sbin:/Users/andrew/.config/yarn/global/bin:/Users/andrew/.rubygems/2.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
SHELL
:/opt/local/bin/bash
LANG
:en_US.UTF-8
PWD
:/Users/andrew/Development/static-site-test
VIRTUAL_ENV
:/Users/andrew/.virtualenvs/static-site-test
Expected result
I expect to be able to install a pre-release like I would a full-release package if there are no full-releases for a package, or else to receive a note about the
--pre
flag.Actual result
When I attempt to install a dependency currently in pre-release (
black
in the following instances) withpipenv
and a>=
pin, I'm told it's unable to resolve the dependency, and that the error exists in the subgraph. However, if I use a==
pin, then everything works. This behavior is inconsistent and confusing, and the error message is misleading. I note that I can use the>=
pin if I specify the--pre
tag.The error message (shown in the output below) did nothing to make it clear that the
--pre
flag is missing from the last two commands. What's more, if the--pre
flag is not required with==
, then I would not expect it to be required with the>=
pin.Optimally,
pipenv
should have installed the package with a warning, or else asked me whether I wanted to install a pre-release, rather than error cryptically as it did. To clarify, if my options are all pre-releases, I thinkpipenv
should succeed installation, either with a warning or after a prompt. At the very least, a better error message should be provided.I imagine the
--pre
flag as being relevant only in the context of packages that have full-releases and pre-releases. My perspective is that if I have two choices for the latest, such as 1.3.0 and 2.0a1, I thinkpipenv
should ask which I want. However I understand that this is a feature change and changes how--pre
operates. Given the existing behavior but also that people new topipenv
are unaware of the--pre
flag, it would be nice to print a message about the flag if an distribution like 2.0a1 is available but the--pre
flag has not been specified.Imagined behavior:
Steps to replicate
Setup:
I try to install
black
as I would withpip
.The error message is incredibly misleading, and is identical if I instead run
pipenv install 'black>=18.4a0'
.The text was updated successfully, but these errors were encountered: