question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

enviroment markers ignored when multiple version options coexist with legacy source

See original GitHub issue
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Possibly related: #3561, #6215, #5506,

Issue

When I attempt poetry install on macOS, Poetry tries to install torch=1.11.0+cpu, which does not have appropriate native builds:

poetry install   
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing torch (1.11.0+cpu): Failed

  RuntimeError

  Unable to find installation candidates for torch (1.11.0+cpu)

  at ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chooser.py:103 in choose_for
       99│ 
      100│             links.append(link)
      101│ 
      102│         if not links:
    → 103│             raise RuntimeError(f"Unable to find installation candidates for {package}")
      104│ 
      105│         # Get the best link
      106│         chosen = max(links, key=lambda link: self._sort_key(package, link))
      107│ 

If I remove the non-Darwin option and leave only this one:

{ version = "1.11.0", markers = "sys_platform == 'darwin'", source = "pypi" }

Poetry installs it without issue.

If I instead replace the non-PyPI option with some other, distinct option and remove the pytorch legacy source:

{ version = "1.12.0", markers = "sys_platform != 'darwin'", source = "pypi" }

(note the version and source are different from the original non-Darwin option)

I can then freely change around the markers on both versions and reinstall and it will always select the intended version according to the rules.

The behavior of apparently ignoring markers only seems to happen when the source is not PyPI.

The non-Darwin source is used in a Docker build, and, if I remove the multiple options and simply set torch = "1.11.0+cpu", I am able to correctly install torch==1.11.0+cpu in my Docker build using this source configuration.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
radoeringcommented, Oct 5, 2022
0reactions
radoeringcommented, Oct 15, 2022

The other PR is still required for a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-architecture wheel selection across disperate sources ...
I'm trying to build a project that will be used in multi-architecture environments (aarch64 and x86_64 specifically).
Read more >
PEP 426 – Metadata for Python Software Packages 2.0
“Legacy metadata” refers to earlier versions of this metadata ... the same extra name or environment marker MAY appear in multiple ...
Read more >
Changelog - pip documentation v22.3.1
When this field is present for a release link, pip will ignore the download when installing to a Python version that doesn't satisfy...
Read more >
Xcode 13 Release Notes | Apple Developer Documentation
Fixed issue where a Swift package with symlinks to source modules would break live issues and code completion in Xcode. (75732781) ...
Read more >
Configure Grafana | Grafana documentation
Do not use environment variables to add new configuration settings. ... This setting is ignored if multiple OAuth providers are configured.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found