pipenv-setup
pipenv-setup copied to clipboard
Check fails for range specifiers
Description
Running pipenv-setup check for a Pipfile that has a range specifier (~) in both the Pipfile and setup.py results in a failed check, even though the dependency has been satisfied.
Steps to Reproduce
-
Create the following
Pipfile:[[source]] name = "pypi" url = "https://pypi.org/simple" verify_ssl = true [packages] click = "~=7.1.1" [dev-packages] pipenv-setup = "==3.1.1" -
Install the environment:
$ pipenv install -d Creating a virtualenv for this project… Pipfile: /Users/jduckworth/managed_code/pipenv-test/Pipfile Using /Users/jduckworth/.pyenv/shims/python (3.7.3) to create virtualenv… ⠇ Creating virtual environment...created virtual environment CPython3.7.3.final.0-64 in 518ms creator CPython3Posix(dest=/Users/jduckworth/.local/share/virtualenvs/pipenv-test-nGQVbywM-/Users/jduckworth/.pyenv/shims/python, clear=False, global=False) seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/jduckworth/Library/Application Support/virtualenv/seed-app-data/v1.0.1) activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator ✔ Successfully created virtual environment! Virtualenv location: /Users/jduckworth/.local/share/virtualenvs/pipenv-test-nGQVbywM-/Users/jduckworth/.pyenv/shims/python Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Building requirements... Resolving dependencies... ✔ Success! Locking [packages] dependencies… Building requirements... Resolving dependencies... ✔ Success! Updated Pipfile.lock (0e1e0f)! Installing dependencies from Pipfile.lock (0e1e0f)… 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 33/33 — 00:00:21 To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run. -
Sync using the
--pipfileflag to maintain the version range:$ pipenv run pipenv-setup sync --pipfile setup.py not found under current directory Creating boilerplate setup.py... setup.py was successfully generated 1 default packages synced from Pipfile to setup.py Please edit the required fields in the generated fileThis produces the following
install_requiresargument insetup.pyfile, which has the expected version range:# ... setup( # ... # For an analysis of "install_requires" vs pip's requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=["click~=7.1"], # Optional # ... ) -
Check the sync:
$ pipenv run pipenv-setup check package 'click' in pipfile but not in install_requires
I'm also experiencing this issue. I can't make use of this package because it doesn't support generating or checking range specifiers.
I have the same issue when I added the google-api-core~=1.0 entry