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

extra depdency not included in lock file if platform being set #9467

Closed
trim21 opened this issue Jun 3, 2024 · 3 comments
Closed

extra depdency not included in lock file if platform being set #9467

trim21 opened this issue Jun 3, 2024 · 3 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@trim21
Copy link
Contributor

trim21 commented Jun 3, 2024

Description

uvicorn has a depdency:

    "uvloop>=0.14.0,!=0.15.0,!=0.15.1; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')",

If I config poetry with this:

uvicorn = [
    { version = "^0.30.0", platform = 'linux', extras = ['standard'] },
    { version = "^0.30.0", platform = 'win32' },
]

then uvloop disappear in lockfile:

[[package]]
name = "uvicorn"
version = "0.30.1"
description = "The lightning-fast ASGI server."
optional = false
python-versions = ">=3.8"
files = [
    {file = "uvicorn-0.30.1-py3-none-any.whl", hash = "sha256:cd17daa7f3b9d7a24de3617820e634d0933b69eed8e33a516071174427238c81"},
    {file = "uvicorn-0.30.1.tar.gz", hash = "sha256:d46cd8e0fd80240baffbcd9ec1012a712938754afcf81bce56c024c1656aece8"},
]

[package.dependencies]
click = ">=7.0"
colorama = {version = ">=0.4", optional = true, markers = "sys_platform == \"win32\" and extra == \"standard\""}
h11 = ">=0.8"
httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""}
python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}
pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""}
typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""}
watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}
websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""}

it generate correct lock file with uvicorn = { version = "^0.30.0", platform = 'linux', extras = ['standard'] }, but I need uvicorn for developing on windows.

Workarounds

add uvloop manully

Poetry Installation Method

pipx

Operating System

win32

Poetry Version

Poetry (version 1.8.3)

Poetry Configuration

doesn't matter

Python Sysconfig

Platform: "win-amd64"
Python version: "3.8"
Current installation scheme: "nt"

Example pyproject.toml

No response

Poetry Runtime Logs

Loading configuration file C:\Users\Trim21\AppData\Roaming\pypoetry\config.toml
Loading configuration file C:\Users\Trim21\AppData\Roaming\pypoetry\auth.toml
Using virtualenv: C:\Users\Trim21\proj\poetry-bug-maybe\poetry-bug-maybe\.venv
Updating dependencies
Resolving dependencies...
   1: fact: non-package-mode is 0
   1: derived: non-package-mode
   1: fact: non-package-mode depends on uvicorn[standard] (^0.30.0)
   1: fact: non-package-mode depends on uvicorn (^0.30.0)
   1: selecting non-package-mode (0)
   1: derived: uvicorn (>=0.30.0,<0.31.0)
   1: derived: uvicorn[standard] (>=0.30.0,<0.31.0)
Checking if keyring is available
[keyring:keyring.backend] Loading KWallet
[keyring:keyring.backend] Loading SecretService
[keyring:keyring.backend] Loading Windows
[win32ctypes:win32ctypes.core.ctypes] Loaded ctypes backend
[keyring:keyring.backend] Loading chainer
[keyring:keyring.backend] Loading libsecret
[keyring:keyring.backend] Loading macOS
Using keyring backend 'Windows WinVaultKeyring'
Creating new session for pypi.org
Source (PyPI): 2 packages found for uvicorn >=0.30.0,<0.31.0
   1: fact: uvicorn (0.30.1) depends on click (>=7.0)
   1: fact: uvicorn (0.30.1) depends on h11 (>=0.8)
   1: fact: uvicorn (0.30.1) depends on typing-extensions (>=4.0)
   1: selecting uvicorn (0.30.1)
   1: derived: typing-extensions (>=4.0)
   1: derived: h11 (>=0.8)
   1: derived: click (>=7.0)
Source (PyPI): 20 packages found for typing-extensions >=4.0
Source (PyPI): 8 packages found for h11 >=0.8
Source (PyPI): 17 packages found for click >=7.0
   1: fact: click (8.1.7) depends on colorama (*)
   1: selecting click (8.1.7)
   1: derived: colorama
Source (PyPI): 43 packages found for colorama *
   1: selecting h11 (0.14.0)
   1: selecting colorama (0.4.6)
   1: selecting typing-extensions (4.12.1)
   1: fact: uvicorn[standard] (0.30.1) depends on uvicorn (0.30.1)
   1: fact: uvicorn[standard] (0.30.1) depends on click (>=7.0)
   1: fact: uvicorn[standard] (0.30.1) depends on h11 (>=0.8)
   1: fact: uvicorn[standard] (0.30.1) depends on typing-extensions (>=4.0)
   1: fact: uvicorn[standard] (0.30.1) depends on colorama (>=0.4)
   1: fact: uvicorn[standard] (0.30.1) depends on httptools (>=0.5.0)
   1: fact: uvicorn[standard] (0.30.1) depends on python-dotenv (>=0.13)
   1: fact: uvicorn[standard] (0.30.1) depends on pyyaml (>=5.1)
   1: fact: uvicorn[standard] (0.30.1) depends on watchfiles (>=0.13)
   1: fact: uvicorn[standard] (0.30.1) depends on websockets (>=10.4)
   1: selecting uvicorn[standard] (0.30.1)
   1: derived: websockets (>=10.4)
   1: derived: watchfiles (>=0.13)
   1: derived: pyyaml (>=5.1)
   1: derived: python-dotenv (>=0.13)
   1: derived: httptools (>=0.5.0)
Source (PyPI): 6 packages found for websockets >=10.4
Source (PyPI): 13 packages found for watchfiles >=0.13
Source (PyPI): 10 packages found for pyyaml >=5.1
Source (PyPI): 15 packages found for python-dotenv >=0.13
Source (PyPI): 3 packages found for httptools >=0.5.0
   1: selecting python-dotenv (1.0.1)
   1: fact: watchfiles (0.22.0) depends on anyio (>=3.0.0)
   1: selecting watchfiles (0.22.0)
   1: derived: anyio (>=3.0.0)
Source (PyPI): 22 packages found for anyio >=3.0.0
   1: fact: anyio (4.4.0) depends on idna (>=2.8)
   1: fact: anyio (4.4.0) depends on sniffio (>=1.1)
   1: fact: anyio (4.4.0) depends on exceptiongroup (>=1.0.2)
   1: fact: anyio (4.4.0) depends on typing-extensions (>=4.1)
   1: selecting anyio (4.4.0)
   1: derived: exceptiongroup (>=1.0.2)
   1: derived: sniffio (>=1.1)
   1: derived: idna (>=2.8)
Source (PyPI): 9 packages found for exceptiongroup >=1.0.2
Source (PyPI): 4 packages found for sniffio >=1.1
Source (PyPI): 11 packages found for idna >=2.8
   1: selecting idna (3.7)
   1: selecting sniffio (1.3.1)
   1: selecting pyyaml (6.0.1)
   1: selecting exceptiongroup (1.2.1)
   1: selecting websockets (12.0)
   1: selecting httptools (0.6.1)
   1: Version solving took 0.222 seconds.
   1: Tried 1 solutions.
@trim21 trim21 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 3, 2024
@dimbleby
Copy link
Contributor

dimbleby commented Jun 3, 2024

probably another variation on #5506

@trim21
Copy link
Contributor Author

trim21 commented Jun 3, 2024

after reading the code of poetry, a possible solution would be swapping these 2 dict:

uvicorn = [
    { version = "^0.30.0", platform = 'win32' },
    { version = "^0.30.0", platform = 'linux', extras = ['standard'] },
]

@trim21 trim21 closed this as completed Jun 5, 2024
Copy link

github-actions bot commented Jul 6, 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 Jul 6, 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

2 participants