billions-bear-56484
03/21/2022, 4:08 PMProcessExecutionFailure: Process 'Building src.python.herzensgut.accounts/serve.pex with 12 requirements: bcrypt==3.2.0, databases[postgresql]==0.5.3, email-validator==1.1.3, fastapi-health==0.4.0, fastapi-jwt==0.1.7, fastapi-mail==1.0.2, fastapi==0.70.0, passlib==1.7.4, pyjwt==2.0.1, python-dotenv==0.19.2, python-multipart==0.0.5, uvicorn==0.16.0' failed with exit code 1.
stdout:
stderr:
ERROR: Could not find a version that satisfies the requirement fastapi-jwt==0.1.7
ERROR: No matching distribution found for fastapi-jwt==0.1.7
The strange thing is, that running the pex_binary is working.
This is my BUILD file:
python_requirement(
requirements=[
"bcrypt==3.2.0",
"fastapi==0.70.0",
"fastapi-health==0.4.0",
"fastapi-jwt==0.1.7",
"fastapi-mail==1.0.2",
"email-validator==1.1.3",
"passlib==1.7.4",
"pyjwt==2.0.1",
"python-dotenv==0.19.2",
"python-multipart==0.0.5",
"uvicorn==0.16.0",
]
)
resources(
name="queries",
sources=[
"**/*.sql",
],
)
resources(
name="templates",
sources=[
"**/*.html",
],
)
python_sources(
name="lib",
sources=[
"**/*.py",
],
dependencies=[
":queries",
":templates",
"src/python/herzensgut/shared:lib",
],
)
python_distribution(
name="dist",
dependencies=[
":lib",
],
wheel=True,
sdist=True,
provides=setup_py(
version="0.0.1",
name="herzensgut.accounts",
description="",
),
)
pex_binary(
name="serve",
restartable=True,
entry_point="app/api/server.py",
)
Do you have an idea what the problem is?
Thanks!high-yak-85899
03/21/2022, 4:22 PMbillions-bear-56484
03/21/2022, 4:32 PMhigh-yak-85899
03/21/2022, 4:39 PMhappy-kitchen-89482
03/21/2022, 5:02 PMpython_requirement target for all the requirements? It means that they will always be depended on all together, and Pants won't be able to treat them as separate things. The more idiomatic way to do this would be to put those in a requirements.txt (or some other name) and point to it in a python_requirements() target .happy-kitchen-89482
03/21/2022, 5:03 PMhappy-kitchen-89482
03/21/2022, 5:04 PMhappy-kitchen-89482
03/21/2022, 5:06 PMfastapi-jwt 0.1.7 has the following interpreter constraints in its METADATA: Requires-Python: <3.10,>=3.7happy-kitchen-89482
03/21/2022, 5:06 PMhappy-kitchen-89482
03/21/2022, 5:07 PM./pants run is working but ./pants package is not? That is strangecurved-television-6568
03/21/2022, 5:16 PMyou meanI got this today on 2.9.0. Tried on 2.11.0rc0 and got a totally different error (but at least consistent betweenis working but./pants runis not? That is strange./pants package
run and package )
working on a repro, hopefully by tomorrow..curved-television-6568
03/21/2022, 5:18 PMpackage was working, while run would complain about missing dependencies. (and running the packaged pex worked just fine) (suspect a local_dists.pex issue, I think the --intransient fix from another of my issues is to blame for that)billions-bear-56484
03/21/2022, 5:57 PM./pants run is working but ./pants package isn’t.
This is my interpreter constraints:
interpreter_constraints = [
"CPython>=3.9.7",
]
So I dont think this is the cause.happy-kitchen-89482
03/21/2022, 6:04 PMpython_requirements() and a requirements.txt file?happy-kitchen-89482
03/21/2022, 6:05 PMdatabases[postgresql]==0.5.3, which is not in the BUILD files, so I'm wondering where that came frombillions-bear-56484
03/21/2022, 6:12 PMshared:lib:
python_requirements()
python_sources(
name="lib",
sources=["**/*.py"],
)
python_distribution(
name="dist",
dependencies=[":lib"],
wheel=True,
sdist=True,
provides=setup_py(
version="0.0.1",
name="herzensgut.shared",
description="",
),
)
Could the wheel / sdist setting being a problem? fastapi-jwt only provides a wheel file, as far I can see: https://pypi.org/simple/fastapi-jwt/happy-kitchen-89482
03/21/2022, 6:13 PMhappy-kitchen-89482
03/21/2022, 6:13 PMhappy-kitchen-89482
03/21/2022, 6:14 PMbillions-bear-56484
03/21/2022, 6:17 PMhappy-kitchen-89482
03/21/2022, 6:42 PMbillions-bear-56484
03/21/2022, 6:45 PMinterpreter_constraints = [
">=3.9.7",
"<3.10",
]
When I remove the “<3.10” it breaks. But I have absolutely no idea why this could break the process …billions-bear-56484
03/21/2022, 6:45 PMhappy-kitchen-89482
03/21/2022, 7:13 PMhappy-kitchen-89482
03/21/2022, 7:14 PMhappy-kitchen-89482
03/21/2022, 7:14 PM