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

How to use poetry with url without version? #117

Open
chulkilee opened this issue Sep 6, 2024 · 2 comments
Open

How to use poetry with url without version? #117

chulkilee opened this issue Sep 6, 2024 · 2 comments

Comments

@chulkilee
Copy link

boto3 = {url = "https://github.com/boto/boto3/archive/31a8a3d7bcd021aadceba63d6f207a3a61c58aac.zip"}

poetry lock is successful

# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.

[[package]]
name = "boto3"
version = "1.35.13"
description = "The AWS SDK for Python"
optional = false
python-versions = ">= 3.8"
files = [
    {file = "31a8a3d7bcd021aadceba63d6f207a3a61c58aac.zip", hash = "sha256:166f093e1d7905b6e116f413f22780151c010f916092772ee1c19e2def949517"},
]

[package.dependencies]
botocore = ">=1.35.13,<1.36.0"
jmespath = ">=0.7.1,<2.0.0"
s3transfer = ">=0.10.0,<0.11.0"

[package.extras]
crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]

[package.source]
type = "url"
url = "https://github.com/boto/boto3/archive/31a8a3d7bcd021aadceba63d6f207a3a61c58aac.zip"

[[package]]
name = "botocore"
version = "1.35.13"
description = "Low-level, data-driven core of boto 3."
optional = false
python-versions = ">=3.8"
files = [
    {file = "botocore-1.35.13-py3-none-any.whl", hash = "sha256:dd8a8bb1946187c8eb902a3b856d3b24df63917e4f2c61a6bce7f3ea9f112761"},
    {file = "botocore-1.35.13.tar.gz", hash = "sha256:f7ae62eab44d731a5ad8917788378316c79c7bceb530a8307ed0f3bca7037341"},
]

[package.dependencies]
jmespath = ">=0.7.1,<2.0.0"
python-dateutil = ">=2.1,<3.0.0"
urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""}

[package.extras]
crt = ["awscrt (==0.21.2)"]

[[package]]
name = "jmespath"
version = "1.0.1"
description = "JSON Matching Expressions"
optional = false
python-versions = ">=3.7"
files = [
    {file = "jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980"},
    {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"},
]

[[package]]
name = "python-dateutil"
version = "2.9.0.post0"
description = "Extensions to the standard Python datetime module"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
files = [
    {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
    {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
]

[package.dependencies]
six = ">=1.5"

[[package]]
name = "s3transfer"
version = "0.10.2"
description = "An Amazon S3 Transfer Manager"
optional = false
python-versions = ">=3.8"
files = [
    {file = "s3transfer-0.10.2-py3-none-any.whl", hash = "sha256:eca1c20de70a39daee580aef4986996620f365c4e0fda6a86100231d62f1bf69"},
    {file = "s3transfer-0.10.2.tar.gz", hash = "sha256:0711534e9356d3cc692fdde846b4a1e4b0cb6519971860796e6bc4c7aea00ef6"},
]

[package.dependencies]
botocore = ">=1.33.2,<2.0a.0"

[package.extras]
crt = ["botocore[crt] (>=1.33.2,<2.0a.0)"]

[[package]]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
files = [
    {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
    {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
]

[[package]]
name = "urllib3"
version = "2.2.2"
description = "HTTP library with thread-safe connection pooling, file post, and more."
optional = false
python-versions = ">=3.8"
files = [
    {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"},
    {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"},
]

[package.extras]
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
h2 = ["h2 (>=4,<5)"]
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
zstd = ["zstandard (>=0.18.0)"]

[metadata]
lock-version = "2.0"
python-versions = "3.11.9 || 3.12.4"
content-hash = "936bf419505533623b19f273b900d813fd26820d7c1dd5c876d497ea858f71b7"

However lock generation failed

Traceback (most recent call last):
  File "/private/.../bin/external/rules_pycross~/pycross/private/tools/poetry_translator.runfiles/_main/../rules_pycross~/pycross/private/tools/poetry_translator.py", line 281, in <module>
    main(parse_flags())
  File "/private/.../bin/external/rules_pycross~/pycross/private/tools/poetry_translator.runfiles/_main/../rules_pycross~/pycross/private/tools/poetry_translator.py", line 243, in main
    lock_set = translate(args.project_file, args.lock_file)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/.../bin/external/rules_pycross~/pycross/private/tools/poetry_translator.runfiles/_main/../rules_pycross~/pycross/private/tools/poetry_translator.py", line 125, in translate
    pinned_package_specs[pin] = parse_constraint(pin_info["version"])
                                                 ~~~~~~~~^^^^^^^^^^^
KeyError: 'version'
@jvolkman
Copy link
Owner

jvolkman commented Sep 6, 2024

I guess this format isn't currently supported. Is there a way to include a version parameter along with the URL to satisfy it?

The translator looks at pyproject.toml to get the set of pinned dependencies - i.e., the roots used in a later step that computes a transitive closure. The actual lock file can contain multiple versions of a single package in some uncommon scenarios, so the translator doesn't look there for the version. But we could make a change to have it defer to the version in the lock file if pyproject.toml doesn't provide one and poetry.lock only has a single version, which I think would handle most scenarios.

@chulkilee
Copy link
Author

chulkilee commented Sep 6, 2024

Created #118!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants