Closed jtmoon79 closed 10 months ago
Its a recent change to sys_markers and os_markers to fold them, but the sdist has to be able to build on the locking platform -- if it cannot be built you can translate those markers directly to the markers key and it will skip trying to install/fold the sub-dependencies of that package.
Sorry -- wrong thread on that last message. (so i deleted it) the message from 3 hours ago is relevant though.
you can translate those markers directly to the markers key
Thanks @matteius I'm not sure what this means. Can you provide an example for my case?
@jtmoon79 certainly, instead of:
py2exe = { version = "*", sys_platform = "== 'win32'"}
try:
py2exe = { version = "*", markers = "sys_platform== 'win32'"}
py2exe = { version = "*", markers = "sys_platform== 'win32'"}
worked on my coverlovin2 project.
Thanks @matteius !
Issue description
Specifier
platform_system
andsys_platform
is not respected duringpipenv update
.On Ubuntu 22, I have a
Pipfile
that has a package that is Windows only (py2exe
). I add specifierplatform_system = "== 'Windows'"
(also triedsys_platform = "== 'win32'"
). However,pipenv update
fails withERROR:pip.subprocessor:python setup.py egg_info exited with 1
(and then more errors). It appears to attempt to build or install the Windows only packagepy2exe
.Package
py2exe
will fail to install on a Linux system (expected)Expected result
pipenv update
will not try to download or build or install a package that has specifiers against it's use.Actual result
pipenv update
downloads and builds a package that it should not.Steps to replicate
Pipfile
This
Pipfile
package declaration follows the example used in the current docsFor me, this installed
setuptools
version68.2.2
,pip
version23.3.1
,wheel
version0.41.3
pipenv
For me, this installed
2023.10.24
pipenv update
Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/main.py", line 4, in
cli()
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1157, in call
return self.main(*args, kwargs)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/cli/options.py", line 58, in main
return super().main(args, kwargs, windows_expand_args=False)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
return __callback(args, kwargs)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, kwargs)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
return __callback(*args, *kwargs)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 33, in new_func
return f(get_current_context(), args, kwargs)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/cli/command.py", line 546, in update
do_update(
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/routines/update.py", line 59, in do_update
do_lock(
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/routines/lock.py", line 65, in do_lock
venv_resolve_deps(
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 849, in venv_resolve_deps
c = resolve(cmd, st, project=project)
File "/tmp/a/.venv/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 718, in resolve
raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!
$ python -m pipenv update Running $ pipenv lock then $ pipenv sync. Locking [packages] dependencies... Locking [dev-packages] dependencies... Updated Pipfile.lock (ebffa69a1fa192d1cef7cb42ad79231ca976565c5ce371a70160b3048d3cbc06)! Installing dependencies from Pipfile.lock (3cbc06)... All dependencies are now up-to-date!
{'implementation_name': 'cpython', 'implementation_version': '3.10.12', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '5.15.90.1-microsoft-standard-WSL2', 'platform_system': 'Linux', 'platform_version': '#1 SMP Fri Jan 27 02:56:13 UTC 2023', 'python_full_version': '3.10.12', 'python_version': '3.10', 'sys_platform': 'linux'}
Contents of
Pipfile.lock
('/tmp/a/Pipfile.lock'):