Hi, I'm trying to load a python dependency from gi...
# general
p
Hi, I'm trying to load a python dependency from git by adding this to my Pipfile:
Copy code
opentelemetry-instrumentation-aiohttp-server = {editable = false, git = "git+<https://github.com/open-telemetry/opentelemetry-python-contrib.git@v0.46b0#subdirectory=instrumentation/opentelemetry-instrumentation-aiohttp-server>"}
pipenv lock
works But
pants generate-lockfioles
is unhappy:
Copy code
ERROR: Ignored the following versions that require a different python version: 0.0.1 Requires-Python >=2.7, <3; 0.0.2 Requires-Python >=2.7, <3; 0.0.3 Requires-Python >=2.7, <3; 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
ERROR: Could not find a version that satisfies the requirement opentelemetry-instrumentation-aiohttp-server (from versions: none)
ERROR: No matching distribution found for opentelemetry-instrumentation-aiohttp-server
b
Sorry for the trouble. What is the interpreter constrains you have in pants.toml?
p
interpreter_constraints = ["CPython>=3.11,<3.12"]
which matches the errors, but I am trying to load that repo from github, where the only constraint is >= 3.8 https://github.com/open-telemetry/opentelemetry-python-contrib/blob/v0.46b0/instru[…]ion/opentelemetry-instrumentation-aiohttp-server/pyproject.toml
I added this to a BUILD file, and now generate-lockfiles knows how to resolve it:
Copy code
python_requirement(
    name="aiohttp_server",
    requirements=["opentelemetry-instrumentation-aiohttp-server@ git+<https://github.com/open-telemetry/opentelemetry-python-contrib.git@v0.46b0#subdirectory=instrumentation/opentelemetry-instrumentation-aiohttp-server>"],
)
I think this is just Pipfile parsing being incomplete somehow?
that actually seems to work, it's just less ergonomic