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.

Markers not correctly assigned to nested dependencies

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Catalina (10.15.3) (Issue is not OS dependent)
  • Poetry version: 1.1.4

Issue

Issue present in 1.1.4 but not in 1.1.3. Chased it down to the rewrite done in PR #3237

Here is a simple (and real) pyproject.toml that will illustrate this issue

[tool.poetry]
name = "test-repo"
version = "0.1.0"
description = ""
authors = ["John Macnamara <i.carley@disney.com>"]

[tool.poetry.dependencies]
python = "^3.9"
azure-identity = "^1.5.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

and the corresponding lockfile (with irrelevant deps removed)

[[package]]
name = "azure-identity"
version = "1.5.0"
description = "Microsoft Azure Identity Library for Python"
category = "main"
optional = false
python-versions = "*"

[package.dependencies]
msal-extensions = ">=0.3.0,<0.4.0"

[[package]]
name = "msal-extensions"
version = "0.3.0"
description = ""
category = "main"
optional = true
python-versions = "*"

[package.dependencies]
msal = ">=0.4.1,<2.0.0"
portalocker = [
    {version = ">=1.0,<2.0", markers = "platform_system != \"Windows\""},
    {version = ">=1.6,<2.0", markers = "platform_system == \"Windows\""},
]

[[package]]
name = "portalocker"
version = "1.7.1"
description = "Wraps the portalocker recipe for easy usage"
category = "main"
optional = true
python-versions = "*"

[package.dependencies]
pywin32 = {version = "!=226", markers = "platform_system == \"Windows\""}

[[package]]
name = "pywin32"
version = "300"
description = "Python for Window Extensions"
category = "main"
optional = true
python-versions = "*"

[metadata]
lock-version = "1.1"
python-versions = "^3.9"
content-hash = "123456789"

[metadata.files]
azure-identity = [
]
msal-extensions = [
]
portalocker = [
]
pywin32 = [
]

running poetry export on that lockfile will show that the "platform_system == \"Windows\"" marker on pywin32 is not present in poetry==1.1.4

More generally, issue seems to only occur under the following conditions:

  • level n dependency has multiple markers for level n+1 dep
  • level n+2 dep has marker

Results in:

  • level n+2 marker is dropped

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SailingYYCcommented, Apr 29, 2021

@abn, is there any love for this issue? This is currently blocking a number of projects.

1reaction
radoeringcommented, Mar 17, 2022

And with python-poetry/poetry-core#308 for poetry-core (additionally to #5156) I get

zipp==3.7.0 ; python_version >= "3.7" and python_version < "4.0"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency Scanning incorrectly handles nested ... - GitLab
It appears that the package itself is not detected as part of the dependency tree, whereas calling gradlew dependencies shows it. Extract from...
Read more >
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >
History | Poetry - Python dependency management and ...
Fixed an issue where markers were not correctly assigned to nested dependencies (#3511). Recognize one digit version in wheel filenames (#3338).
Read more >
poetry 1.2.0b1 on Python PyPI - NewReleases.io
Fixed an issue where markers were not correctly assigned to nested dependencies (#3511). Recognize one digit version in wheel filenames (#3338).
Read more >
Nested Spatial and Temporal Modeling of Environmental ...
Vibrio parahaemolyticus genetic markers (tlh, tdh, and trh) were estimated ... Not all V. parahaemolyticus strains can cause vibriosis, although all V.
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