pipenv-setup icon indicating copy to clipboard operation
pipenv-setup copied to clipboard

Check fails for range specifiers

Open duckontheweb opened this issue 5 years ago • 2 comments

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

  1. 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"
    
  2. 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.
    
  3. Sync using the --pipfile flag 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 file
    

    This produces the following install_requires argument in setup.py file, 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
        # ...
    )
    
    
  4. Check the sync:

    $ pipenv run pipenv-setup check
    package 'click' in pipfile but not in install_requires
    
    

duckontheweb avatar Aug 27 '20 02:08 duckontheweb

I'm also experiencing this issue. I can't make use of this package because it doesn't support generating or checking range specifiers.

bf-sodle avatar Oct 22 '20 19:10 bf-sodle

I have the same issue when I added the google-api-core~=1.0 entry

HitLuca avatar Dec 16 '21 15:12 HitLuca