I tried to run `pex --python python3.10 -D . -r re...
# general
s
I tried to run
pex --python python3.10 -D . -r requirements.txt -m pants.bin.pants_loader --include-tools -o pants.pex
mentioned at https://pantsbuild.slack.com/archives/C046T6T9U/p1682524087702709?thread_ts=1682518835.317889&cid=C046T6T9U I was surprised to get
Copy code
Failed to resolve compatible distributions:
1: google-cloud-bigquery==3.3.3 requires packaging<22.0.0dev,>=14.3 but packaging 23.1 was resolved
2: tensorboard==2.11.2 requires google-auth-oauthlib<0.5,>=0.4.1 but google-auth-oauthlib 1.0.0 was resolved
3: grpcio-status==1.54.2 requires protobuf>=4.21.6 but protobuf 3.19.4 was resolved
4: grpcio-status==1.54.2 requires grpcio>=1.54.2 but grpcio 1.49.1 was resolved
5: googleapis-common-protos==1.59.0 requires protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5 but protobuf 3.19.4 was resolved
6: grpc-google-iam-v1==0.12.6 requires protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5 but protobuf 3.19.4 was resolved
7: sqlalchemy-bigquery==1.4.4 requires sqlalchemy<=1.4.27,>=1.2.0 but SQLAlchemy 1.4.48 was resolved
We use a lockfile and
./pants generate-lockfiles
work. The
python3.10
referenced also matches our interpreter constraint for pants
interpreter_constraints = ["CPython==3.10.*"]
.
If I try
--lock 3rdparty/python/default.lock
I get
pex.resolve.lockfile.json_codec.ParseError: The lock file at 3rdparty/python/default.lock does not contain valid JSON: Expecting value: line 1 column 1 (char 0)
w
Pants prepends some metadata to the lockfile which you would need to strip. but you could also replace that CLI command with a
pex_binary
target and running
./pants package
s
Is there a convenient way to way to include "everything" as dependencies?
With the CLI I can do embed things
$(./pants roots | awk '$0!="." {print "-D " $0}')
to include all source directories
w
Is there a convenient way to way to include “everything” as dependencies?
not currently. what’s the use case for that?
s
Load this thing into a jupyter notebook
I didn't realize the the message just above this one seems like they're trying to do the same thing
w
yea, probably best to continue the discussion there.
👍 1