pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.88k stars 1.87k forks source link

Invalid markers silently ignored #3696

Closed ghost closed 2 years ago

ghost commented 5 years ago

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.

Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.

Make sure to mention your debugging experience if the documented solution failed.

Issue description

When there is a syntax error in the markers in Pipfile, pipenv lock silently ignores it and adds the package without any markers.

Expected result

pipenv should show an error or at least a warning in this case.

Actual result

> pipenv lock --verbose
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Success!
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1
Current constraints:
  win10toast~=0.9

Finding the best candidates:
  found candidate win10toast==0.9 (constraint was ~=0.9)

Finding secondary dependencies:
  win10toast==0.9           requires pypiwin32, setuptools

New dependencies found in this round:
  adding ['pypiwin32', '', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2
Current constraints:
  pypiwin32
  win10toast~=0.9

Finding the best candidates:
  found candidate pypiwin32==223 (constraint was <any>)
  found candidate win10toast==0.9 (constraint was ~=0.9)

Finding secondary dependencies:
  win10toast==0.9           requires pypiwin32, setuptools
  pypiwin32==223            requires pywin32>=223

New dependencies found in this round:
  adding ['pywin32', '>=223', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 2: not stable

                          ROUND 3
Current constraints:
  pypiwin32
  pywin32>=223
  win10toast~=0.9

Finding the best candidates:
  found candidate pypiwin32==223 (constraint was <any>)
  found candidate pywin32==224 (constraint was >=223)
  found candidate win10toast==0.9 (constraint was ~=0.9)

Finding secondary dependencies:
  pypiwin32==223            requires pywin32>=223
  pywin32==224              requires -
  win10toast==0.9           requires pypiwin32, setuptools
------------------------------------------------------------
Result of round 3: stable, done

Updated Pipfile.lock (9c709d)!

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).

  1. Create a Pipfile with a syntax error in the markers of a dependency (see below)
  2. Run pipenv lock



$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: 'c:\\users\\nyuszika7h\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\pipenv'

Python location: 'c:\\users\\nyuszika7h\\appdata\\local\\programs\\python\\python37\\python.exe'

Python installations found:

  • 3.7.3: C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python37\python.exe
  • 3.7.1: C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python37-32\python.exe
  • 3.6.8: C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python36\python.exe
  • 2.7: C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python27\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.3',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.17763',
 'python_full_version': '3.7.3',
 'python_version': '3.7',
 'sys_platform': 'win32'}

System environment variables:

  • ALLUSERSPROFILE
  • ANDROID_SDK_HOME
  • APPDATA
  • ASL.LOG
  • COMMONPROGRAMFILES
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • COMPUTERNAME
  • COMSPEC
  • DRIVERDATA
  • ESET_OPTIONS
  • FPS_BROWSER_APP_PROFILE_STRING
  • FPS_BROWSER_USER_PROFILE_STRING
  • HOMEDRIVE
  • HOMEPATH
  • INTELLIJ IDEA
  • INTEL_DEV_REDIST
  • JD2_HOME
  • LIBTHAI_DICTDIR
  • LOCALAPPDATA
  • LOGONSERVER
  • MIC_LD_LIBRARY_PATH
  • NUMBER_OF_PROCESSORS
  • ONEDRIVE
  • OS
  • PATH
  • PATHEXT
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMDATA
  • PROGRAMFILES
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • PSMODULEPATH
  • PT7HOME
  • PUBLIC
  • PYCHARM
  • QT_DEVICE_PIXEL_RATIO
  • SESSIONNAME
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TMP
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • WINDIR
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv?specific environment variables:

Debug?specific environment variables:

  • PATH: C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Android;C:\Windows\System32;C:\Program Files\Git\cmd;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\WinSCP\;C:\Program Files (x86)\Universal Extractor;C:\Program Files (x86)\Universal Extractor\bin;C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python37\;C:\Users\nyuszika7h\AppData\Local\Programs\Python\Python27\Scripts\;C:\Users\nyuszika7h\AppData\Local\Microsoft\WindowsApps;C:\Users\nyuszika7h\Downloads\Apps\aria2;C:\Users\nyuszika7h\Downloads\Apps\FFmpeg\bin;C:\Program Files\MKVToolNix;C:\Users\nyuszika7h\AppData\Local\Programs\Fiddler;C:\Windows;C:\Program Files (x86)\Nmap;C:\Users\nyuszika7h\AppData\Local\Programs\Microsoft VS Code\bin;C:\texlive\2018\bin\win32;C:\Users\nyuszika7h\AppData\Local\Microsoft\WindowsApps;C:\Program Files\GPAC;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\nyuszika7h\Downloads\Apps;C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.4\bin;C:\Program Files\JetBrains\PyCharm 2018.3.4\bin;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\Nmap;c:\users\nyuszika7h\appdata\local\programs\python\python37\lib\site-packages\pywin32_system32

Contents of Pipfile ('F:\Temp\SampleProject\Pipfile'):

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
win10toast = {version = "~=0.9", markers="sys_platform == 'win32"}

Contents of Pipfile.lock ('F:\Temp\SampleProject\Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "acbe26daf47885cc302a19647f5fa08a820ca16c5367016cc05271d4129c709d"
        },
        "pipfile-spec": 6,
        "requires": {},
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "pypiwin32": {
            "hashes": [
                "sha256:67adf399debc1d5d14dffc1ab5acacb800da569754fafdc576b2a039485aa775",
                "sha256:71be40c1fbd28594214ecaecb58e7aa8b708eabfa0125c8a109ebd51edbd776a"
            ],
            "version": "==223"
        },
        "pywin32": {
            "hashes": [
                "sha256:22e218832a54ed206452c8f3ca9eff07ef327f8e597569a4c2828be5eaa09a77",
                "sha256:32b37abafbfeddb0fe718008d6aada5a71efa2874f068bee1f9e703983dcc49a",
                "sha256:35451edb44162d2f603b5b18bd427bc88fcbc74849eaa7a7e7cfe0f507e5c0c8",
                "sha256:4eda2e1e50faa706ff8226195b84fbcbd542b08c842a9b15e303589f85bfb41c",
                "sha256:5f265d72588806e134c8e1ede8561739071626ea4cc25c12d526aa7b82416ae5",
                "sha256:6852ceac5fdd7a146b570655c37d9eacd520ed1eaeec051ff41c6fc94243d8bf",
                "sha256:6dbc4219fe45ece6a0cc6baafe0105604fdee551b5e876dc475d3955b77190ec",
                "sha256:9bd07746ce7f2198021a9fa187fa80df7b221ec5e4c234ab6f00ea355a3baf99"
            ],
            "version": "==224"
        },
        "win10toast": {
            "hashes": [
                "sha256:44e5afa1001de88a0ee533872231521fa67c7d144f39974089af242d9c4620a4"
            ],
            "index": "pypi",
            "version": "==0.9"
        }
    },
    "develop": {}
}

EydenVillanueva commented 4 years ago

Hi, is anyone currently working on this?

matteius commented 2 years ago

Can you check if this is still an issue on latest pipenv version? I believe this has been solved for.