Open bearsh opened 9 months ago
There was a change when we dropped requirementslib to try and make sys_platform locking include sub-dependencies, but if you want it to be truly skipped you can convert it to a marker -- for example:
pywin32 = {version = "*", sys_platform = "== 'win32'"}
--> pywin32 = {version = "*", markers = "sys_platform== 'win32'"}
Sorry for the trouble!
thanks @matteius, that seems to work.
maybe the doc should be updated to reflex that change...
Hello @matteius ,
When converting sys_platform
to a marker, it solved the error when it had to be excluded (e.g. macOS, linux). But, it introduces an error when it has to be included (running Windows).
When using pywin32 = {version = "*", sys_platform = "== 'win32'"}
on Windows, it works just fine.
When using pywin32 = {version = "*", markers = "sys_platform == 'win32'"}
on Windows Server 2022, it gives me:
[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement pywin32== (from versions: 302, 303, 304, 305, 306)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for pywin32==
ERROR: Couldn't install package: {}
Any hint to solve this issue on linux without introducing an error on Windows?
Thank you!
Problem solved
To solve this on all platforms, I was forced to specify some version rather than *
.
i.e.: pywin32 = {version = ">=306", markers = "sys_platform == 'win32'"}
With this, the Pipfile.lock file included the following snippet:
"pywin32": {
"markers": "platform_system == 'Windows'",
"version": "==306"
},
It seems that the "version": "==306"
was needed on Windows to successfully install pywin32
Issue description
Pipenv fails to lock Pipfile.lock if Pipfile contains entries where
sys_platform
does not match.Expected result
Locking should work like it did previous releases
Actual result
Steps to replicate
Pipfile:
$ pipenv --support
Pipenv version: `'2023.11.15'` Pipenv location: `'/home/bearsh/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv'` Python location: `'/home/bearsh/.local/pipx/venvs/pipenv/bin/python'` OS Name: `'posix'` User pip version: `'23.3.1'` user Python installations found: PEP 508 Information: ``` {'implementation_name': 'cpython', 'implementation_version': '3.10.12', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '6.5.0-1008-oem', 'platform_system': 'Linux', 'platform_version': '#8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 10 13:08:33 UTC ' '2023', 'python_full_version': '3.10.12', 'python_version': '3.10', 'sys_platform': 'linux'} ``` System environment variables: - `SHELL` - `SESSION_MANAGER` - `WINDOWID` - `QT_ACCESSIBILITY` - `COLORTERM` - `XDG_CONFIG_DIRS` - `XDG_SESSION_PATH` - `LANGUAGE` - `LC_ADDRESS` - `LC_NAME` - `SSH_AUTH_SOCK` - `GOPRIVATE` - `SHELL_SESSION_ID` - `DESKTOP_SESSION` - `LC_MONETARY` - `SSH_AGENT_PID` - `GTK_RC_FILES` - `XCURSOR_SIZE` - `KDE_FORK_SLAVES` - `DBUS_STARTER_BUS_TYPE` - `XDG_SEAT` - `PWD` - `XDG_SESSION_DESKTOP` - `LOGNAME` - `XDG_SESSION_TYPE` - `SYSTEMD_EXEC_PID` - `XAUTHORITY` - `XKB_DEFAULT_MODEL` - `VIRTUALENVWRAPPER_SCRIPT` - `GTK2_RC_FILES` - `HOME` - `LC_PAPER` - `LANG` - `LS_COLORS` - `_VIRTUALENVWRAPPER_API` - `XDG_CURRENT_DESKTOP` - `KONSOLE_DBUS_SERVICE` - `WAYLAND_DISPLAY` - `QT_EXCLUDE_GENERIC_BEARER` - `KONSOLE_DBUS_SESSION` - `PROFILEHOME` - `XDG_SEAT_PATH` - `INVOCATION_ID` - `KONSOLE_VERSION` - `MANAGERPID` - `KDE_SESSION_UID` - `WORKON_HOME` - `XKB_DEFAULT_LAYOUT` - `LESSCLOSE` - `XDG_SESSION_CLASS` - `TERM` - `LC_IDENTIFICATION` - `LESSOPEN` - `USER` - `COLORFGBG` - `PLASMA_USE_QT_SCALING` - `KDE_SESSION_VERSION` - `PAM_KWALLET5_LOGIN` - `QT_WAYLAND_FORCE_DPI` - `DISPLAY` - `SHLVL` - `LC_TELEPHONE` - `MOZ_USE_XINPUT2` - `LC_MEASUREMENT` - `XDG_VTNR` - `XDG_SESSION_ID` - `DBUS_STARTER_ADDRESS` - `XDG_RUNTIME_DIR` - `LC_TIME` - `QT_AUTO_SCREEN_SCALE_FACTOR` - `JOURNAL_STREAM` - `XCURSOR_THEME` - `XDG_DATA_DIRS` - `KDE_FULL_SESSION` - `PATH` - `DBUS_SESSION_BUS_ADDRESS` - `KDE_APPLICATIONS_AS_SCOPE` - `LC_NUMERIC` - `_` - `OLDPWD` - `PIP_DISABLE_PIP_VERSION_CHECK` - `PYTHONDONTWRITEBYTECODE` - `PYTHONFINDER_IGNORE_UNSUPPORTED` Pipenv–specific environment variables: Debug–specific environment variables: - `PATH`: `/home/bearsh/opt/flutter/bin:/home/bearsh/go/bin:/home/bearsh/.npm/bin:/home/bearsh/.local/bin:/home/bearsh/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin` - `SHELL`: `/bin/bash` - `LANG`: `de_CH.UTF-8` - `PWD`: `/home/bearsh/tmp/flex-prodtool`