Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry export platform markers broken on Linux in >=1.1.12 #6134

Closed
3 tasks done
ingvaldlorentzen opened this issue Aug 8, 2022 · 6 comments
Closed
3 tasks done

Poetry export platform markers broken on Linux in >=1.1.12 #6134

ingvaldlorentzen opened this issue Aug 8, 2022 · 6 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@ingvaldlorentzen
Copy link

ingvaldlorentzen commented Aug 8, 2022

  • 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).

Issue

When using poetry export in Poetry 1.1.12 and above on Linux platform markers are not properly added. Not quite sure why, but I'm guessing it's related to this commit/PR.

This does not seem to be an issue on macOS or Windows, only Linux. Testet primarily with the python3.10-slim image, but the same issue was present on the -alpine image.

The issue is not present in the Poetry 1.2.0b3 beta. Feel free to close this issue if you think having the fix in the new version is enough, but if possible, a backport fix to the 1.1.x branch would be great if the release of 1.2.0 is a ways away.

Encountered this issue when having azure-identity as a dependency, as pywin32 is a subdependency.

Heres a few examples of pywin32 related output from poetry export:

macOS 12.5, Python 3.10.5 Poetry 1.1.14:

pywin32==304; python_version >= "3.6" and platform_system == "Windows"

Debian 11.4, Python 3.10.6, Poetry 1.1.14:

pywin32==304

Debian 11.4, Python 3.10.6, Poetry 1.1.12:

pywin32==304

Debian 11.4, Python 3.10.6, Poetry 1.1.11:

pywin32==304; python_version >= "3.6" and platform_system == "Windows"

Debian 11.4, Python 3.10.6, Poetry 1.2.0b3:

pywin32==304 ; python_version >= "3.10" and platform_system == "Windows" and python_version < "3.11"

Full export outputs and generated lockfiles can be seen here: https://github.com/ingvaldlorentzen/poetry-pywin-bug

When attempting an install with the generated requirements.txt file on a non-Windows platform it will fail for the versions where the output is simply pywin32=304 as pip will attempt to install a package not compatible with non-Windows platforms.

@ingvaldlorentzen ingvaldlorentzen added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 8, 2022
@sbrunner
Copy link

sbrunner commented Aug 8, 2022

I'm also affected, if I run:

poetry init
poetry add --lock msal-extensions
poetry export --output=requirements.txt

If I have this in the poetry.lock

...
[[package]]
name = "msal-extensions"
version = "1.0.0"
description = "Microsoft Authentication Library extensions (MSAL EX) provides a persistence API that can save your data on disk, encrypted on Windows, macOS and Linux. Concurrent data access will be coordinated by a file lock mechanism."
category = "main"
optional = true
python-versions = "*"

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

I will have in the requirements.txt:

...
pywin32==304; python_version >= "3.5" and platform_system == "Windows"
...

But sometimes the 2 lines int the portalocker are inverted, then ; python_version >= "3.5" and platform_system == "Windows"is missing for pywin32...

@dimbleby
Copy link
Contributor

As I understand it there's no plan for any more 1.1 releases, so if this is all working fine at 1.2 then there's nothing to do here.

@pievalentin
Copy link

I have the same issue. If you find any hack around this I would be interested

@dimbleby
Copy link
Contributor

The 1.2 release is imminent, you just have to wait for that - or use poetry 1.2.0rc1.

(And this issue should be closed)

@pievalentin
Copy link

Awesome thank you!

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

5 participants