-
-
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
Installing a package from VCS fails with Invalid specifier: '==attr: ...
if the package is already installed
#5360
Comments
@Jmennius I was able to reproduce your issue -- I think it has to do with I don't see a version specifier in the setup.py for This confuses the resolver because it needs to pin to a specific version I believe. |
But the version specifier is in setup.cfg - shouldn't it be enough? |
It looks like behaviour changed in setuptools: pypa/setuptools#1724 And per the documentation this should be working now: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ So this means pipenv is using an old setuptools version? Anyway, I had to hardcode versions in every setup.cfg of my packages to prevent this:
This is undesirable package mantaining workflow but it's what's allowing me to use |
@iuriguilherme Pipenv only calls out |
The issue I was having with PyInstaller was fixed via pyinstaller/pyinstaller#7444 for me. |
@Jmennius We bumped the |
__init__.py:
_version.py:
setup.cfg:
Working for me. |
Issue description
When trying install/lock a project from VCS that uses
version = attr: <package.field>
specifier insetup.cfg
, if the package was (is) previously installed from a wheel, I get an error:pipenv.patched.pip._vendor.packaging.specifiers.InvalidSpecifier: Invalid specifier: '==attr: PyInstaller.__version__'
if installing from VCS when the package is not installed from the wheel yet - the issue does not happen.
Expected result
No error occurs, package is installed and locked.
Actual result
$ pipenv --python ~/.pyenv/versions/3.8.13/bin/python3 --verbose install git+https://github.com/pyinstaller/pyinstaller.git@develop#egg=pyinstaller
Steps to replicate
or
$ pipenv --support
Pipenv version:
'2022.9.8'
Pipenv location:
'/var/home/ievgenp/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pipenv'
Python location:
'/var/home/ievgenp/.pyenv/versions/3.8.13/bin/python3.8'
OS Name:
'posix'
User pip version:
'22.2.2'
user Python installations found:
3.10.4
:/var/home/ievgenp/.pyenv/versions/3.10.4/bin/python3
3.8.13
:/var/home/ievgenp/.pyenv/versions/3.8.13/bin/python3.8
3.8.13
:/var/home/ievgenp/.pyenv/versions/3.8.13/bin/python3
3.8.13
:/var/home/ievgenp/.pyenv/versions/3.8.13/bin/python
3.8.13
:/var/home/ievgenp/.pyenv/versions/3.8.13/bin/python3.8
3.8.6
:/var/home/ievgenp/.pyenv/versions/3.8.6/bin/python3.8
3.8.5
:/var/home/ievgenp/.pyenv/versions/3.8.5/bin/python3.8
3.7.13
:/var/home/ievgenp/.pyenv/versions/3.7.13/bin/python3.7m
3.7.9
:/var/home/ievgenp/.pyenv/versions/3.7.9/bin/python3.7m
3.7.1
:/var/home/ievgenp/.pyenv/versions/3.7.1/bin/python
3.7.1
:/var/home/ievgenp/.pyenv/versions/test1/bin/python
3.6.9
:/usr/bin/python3.6
3.6.9
:/usr/bin/python3.6m
3.6.9
:/usr/bin/python3
2.7.17
:/usr/bin/python2
2.7.17
:/usr/bin/python2.7
2.7.17
:/usr/bin/python
PEP 508 Information:
System environment variables:
PIPENV_VENV_IN_PROJECT
LD_LIBRARY_PATH
XDG_MENU_PREFIX
P9K_SSH
LANG
DISPLAY
HOSTNAME
PYENV_ROOT
OLDPWD
KEYTIMEOUT
PIPENV_SHELL_FANCY
DEBFULLNAME
COLORTERM
_P9K_TTY
PYTHON_CONFIGURE_OPTS
PYENV_HOOK_PATH
SSH_AUTH_SOCK
MINICOM
container
ZDOTDIR
USER
PYENV_DIR
DESKTOP_SESSION
VERSION
WAYLAND_DISPLAY
PWD
HOME
PYENV_VERSION
NAME
XDG_SESSION_TYPE
BUILDAH_LAYERS
XDG_DATA_DIRS
XDG_SESSION_DESKTOP
CMAKE_BUILD_PARALLEL_LEVEL
TERM
SHELL
VTE_VERSION
DOCKER_HOST
USER_CERTIFICATE
USER_PRIVATE_KEY
XDG_CURRENT_DESKTOP
PYENV_SHELL
SHLVL
TOOLBOX_PATH
DEBEMAIL
LOGNAME
DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR
XAUTHORITY
PATH
P9K_TTY
PIP_DISABLE_PIP_VERSION_CHECK
PIP_PYTHON_PATH
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT
:1
PIPENV_SHELL_FANCY
:1
Debug–specific environment variables:
PATH
:/var/home/ievgenp/.pyenv/versions/3.8.13/bin:/var/home/ievgenp/.pyenv/libexec:/var/home/ievgenp/.pyenv/plugins/python-build/bin:/var/home/ievgenp/go/bin:/var/home/ievgenp/.pyenv/shims:/var/home/ievgenp/.pyenv/bin:/var/home/ievgenp/.local/bin:/var/home/ievgenp/.cargo/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/home/ievgenp/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin
SHELL
:/usr/bin/zsh
LANG
:en_US.UTF-8
PWD
:/var/home/ievgenp/src/pipenv-test
Contents of
Pipfile
('/var/home/ievgenp/src/pipenv-test/Pipfile'):Contents of
Pipfile.lock
('/var/home/ievgenp/src/pipenv-test/Pipfile.lock'):The text was updated successfully, but these errors were encountered: