Skip to content

package use specified marker in Pipfile may generates error logical condition in Pipfile.lock #3616

Open
@leileigong

Description

@leileigong

Issue description

i wanna install py2exe via pipenv.
so i write
"py2exe-py2" = {version = "==0.6.9", markers = "python_version <= '3.4'", sys_platform = "== 'win32'"}
to my Pipfile, this will result in this bug.

but if write
"py2exe-py2" = {version = "==0.6.9", markers = "python_version <= '3.4' and sys_platform == 'win32'"}
to my Pipfile, this will work fine.

my virtual python version is 3.6

Expected result

Pipfile.lock content should be:

        "py2exe-py2": {
            "hashes": [
                "sha256:c66c73aaca3e68ef52dcfcd6222d83d3622a50a7d0bd3e762814464da51d8371"
            ],
            "index": "pypi",
            "markers": "python_version <= '3.4' and sys_platform == 'win32'",
            "version": "==0.6.9"
        },

the shell should output:

Ignoring py2exe-py2: markers 'python_version <= "3.4" and sys_platform == "win32"' don't match your environment

Actual result

1.Pipfile.lock content actural be:

        "py2exe-py2": {
            "hashes": [
                "sha256:c66c73aaca3e68ef52dcfcd6222d83d3622a50a7d0bd3e762814464da51d8371"
            ],
            "index": "pypi",
            "markers": "python_version <= '3.4' or sys_platform == 'win32'",
            "version": "==0.6.9"
        },

2.the shell actural output:

An error occurred while installing py2exe-py2==0.6.9 ; python_version <= '3.4' or sys_platform == 'win32' --hash=sha256:c66c73aaca3e68ef52dcfcd6222d83d3622a50a7d0bd3e762814464da51d8371! Will try again.
....
Installing initially failed dependencies…
     ================================ 2/2 - 00:00:07
[pipenv.exceptions.InstallError]:   File "c:\python36\lib\site-packages\pipenv\cli\command.py", line 254, in install
[pipenv.exceptions.InstallError]:       editable_packages=state.installstate.editables,
[pipenv.exceptions.InstallError]:   File "c:\python36\lib\site-packages\pipenv\core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "c:\python36\lib\site-packages\pipenv\core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "c:\python36\lib\site-packages\pipenv\core.py", line 862, in do_install_dependencies
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, False, failed_deps_queue, retry=False)
[pipenv.exceptions.InstallError]:   File "c:\python36\lib\site-packages\pipenv\core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting py2exe-py2==0.6.9 (from -r C:\\Users\\lei\\AppData\\Local\\Temp\\pipenv-m_0kxixe-requirements\\pipenv-cgoiw517-requirement.txt (line 1))']
[pipenv.exceptions.InstallError]: ['Could not find a version that satisfies the requirement py2exe-py2==0.6.9 (from -r C:\\Users\\lei\\AppData\\Local\\Temp\\pipenv-m_0kxixe-requirements\\pipenv-cgoiw517-requirement.txt (line 1)) (from versions: )', 'No matching distribution found for py2exe-py2==0.6.9 (from -r C:\\Users\\lei\\AppData\\Local\\Temp\\pipenv-m_0kxixe-requirements\\pipenv-cgoiw517-requirement.txt (line 1))']
ERROR: ERROR: Package installation failed...

Steps to replicate

  1. add an package item to pipfile:

    "py2exe-py2" = {version = "==0.6.9", markers = "python_version <= '3.4'", sys_platform = "== 'win32'"}
    
  2. exec "pipenv install"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions