-
-
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
pipenv does not pull in extras if extra name does not match module name #5944
Comments
We need the proper package name for pip resolve/install, that is why. |
ya but this works in pipenv |
It can be considered a regression, but its not one I intend to "fix" this since was dependent on requirementslib behavior which has since been removed. I don't think its unreasonable to derive the package name from the Pipfile entry -- trying to determine it otherwise from the package itself is an expensive and error prone operation especially considering the many forms of setup.py and the desire to not evaluate code from setup.py during package resolution. Open to patches, but I won't be pursuing a patch for this. |
I'm not sure what you mean by you need the proper package name. extras_require={
'datetime': ["pytz"],
'fakefactory': ["Faker>=0.7.0,<=0.7.1"],
'django': ['pytz', 'django>=1.8,<2,!=1.9.*'],
'numpy': ['numpy>=1.9.0'],
'pytest': ['pytest>=2.8.0'],
} if they instead put:
and in the Pipfile we put:
Remember we need to specify the alias because the alias can point to one pipenv would pull the requirement. This needs to get fixed otherwise we cannot rely on pipenv properly enforcing version requirements across top level modules, and extras. |
the original Pipfile is equivalent to |
Sorry if there was a misunderstanding, I thought you were saying the name of the requirement in the Pipfile did not match the requirement name. When I try your example the resolve prints out:
When I checked the wheel for hypothesis, we can see there is no extras group named datetime in the published wheel. It is named pytz there (I am not sure why). That is what the pypi resolution will use the wheel metadata to determine the extras, so I don't think that is a pipenv bug.
When I try with the git repository, I have to manually manipulate the Pipfile entry to have the extras but that is working:
The biggest issue I can see is that there should be a way to pipenv install the Pipfile entry with the extras for the git repository example without having to edit the Pipfile. However for the case of the wheels extras groups not matching the setup.py extras groups from 8 years ago -- probably has to do with a recently published wheel of the hypothesis project? |
ok perhaps I picked a bad example, we're seeing this same issue at work for our own module, let me make an example w/o pypi |
sorry, will close this until I get a test case that buttons down all the hatches :) |
Issue description
If a requirement has extras, with a name that does not match the module name the module will not get added to the lockfile
Note that the datetime extra should pull in pytz: https://github.com/bennylope/hypothesis-python/blob/master/setup.py#L41
Expected result
Extras specified should get added
Actual result
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
$ pipenv --support
Pipenv version:
'2023.9.8'
Pipenv location:
'/opt/homebrew/lib/python3.11/site-packages/pipenv'
Python location:
'/opt/homebrew/opt/[email protected]/bin/python3.11'
OS Name:
'posix'
User pip version:
'23.2.1'
user Python installations found:
PEP 508 Information:
System environment variables:
SHELL
NVM_RC_VERSION
XPC_FLAGS
HISTCONTROL
TERM_PROGRAM_VERSION
PKG_CONFIG_PATH
HISTSIZE
__CFBundleIdentifier
SSH_AUTH_SOCK
TERM_SESSION_ID
GPG_TTY
PWD
LOGNAME
LaunchInstanceID
HOME
LANG
SECURITYSESSIONID
TMPDIR
FBNSECRETS_FORCE_USER
NVM_DIR
GEM_HOME
TERM
USER
SHLVL
NVM_CD_FLAGS
XPC_SERVICE_NAME
PS1
PATH
HOMEBREW_CASK_OPTS
OLDPWD
TERM_PROGRAM
_
__CF_USER_TEXT_ENCODING
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/Users/alexmohr/Downloads/google-cloud-sdk/bin:/opt/homebrew/opt/openjdk/bin:/Users/alexmohr/.gem/bin:/opt/homebrew/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/[email protected]/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/openjdk/bin:~/.gem/ruby/2.6.0/bin:/Users/alexmohr/dev/fbn.com/ops/docker/ecr/bin:~/Applications/Sublime Text.app/Contents/SharedSupport/bin
SHELL
:/opt/homebrew/bin/bash
LANG
:en_US.UTF-8
PWD
:/tmp/test
Contents of
Pipfile
('/private/tmp/test/Pipfile'):Contents of
Pipfile.lock
('/private/tmp/test/Pipfile.lock'):The text was updated successfully, but these errors were encountered: