high-energy-55500
02/09/2023, 9:42 PMβ 1462.31s Building main.pex with 21 requirements: arn<0.2.0,>=0.1.5, backoff<2.0.0,>=1.10.0, boltons<21.0.0,>=20.2.1, boto3<2.0.0,>=1.15, botocore<2.0.0,>=1.21.60, click<9.0.0,>=8.1.3, fsspec<2022.0.0,>=2021.4.0, orjson<3.7.0,>=3.6, pandas<2.0.0,>=1.5.3, protobuf<4,>=3.19
hereβs the list of 3rd party dependencies
./pants dependencies --transitive src/my_script:main
//:poetry#arn
//:poetry#backoff
//:poetry#boltons
//:poetry#boto3
//:poetry#botocore
//:poetry#click
//:poetry#fsspec
//:poetry#orjson
//:poetry#pandas
//:poetry#protobuf
//:poetry#psycopg2-binary
//:poetry#pulumi
//:poetry#pulumi-aws
//:poetry#pydantic
//:poetry#ratelimit
//:poetry#redis-py-cluster
//:poetry#requests
//:poetry#s3fs
//:poetry#sentry-sdk
//:poetry#setuptools
//:poetry#tomli
//pyproject.toml:poetry
...
is there something i can/should do differently for pants to run this in a more reasonable timeframe?quiet-painter-18838
02/09/2023, 10:50 PMrapid-bird-79300
02/10/2023, 12:12 AM[mypy]
skip = true
config = "tools/python/mypy.ini"
extra_requirements.add = ['SQLAlchemy[mypy]==2.0.0']
lockfile = "tools/python/mypy.lock"
and the following mypy.ini
[mypy]
plugins = sqlalchemy.ext.mypy.plugin
no_implicit_optional = True
local_partial_types = True
follow_imports = normal
disallow_untyped_defs = True
disable_error_code = misc
exclude = alembic
We added a new project that does not use sqlalchemy and now running mypy with pants we see the following errors:
/Users/njgrisafi/.cache/pants/named_caches/pex_root/venvs/5bcbf65366e68d9647087f9935ca1efcc8fff5d1/b3aef238742d4e1a2d2b93cbfe8e2aa5b6944556/lib/python3.9/site-packages/mypy/typeshed/stdlib/fnmatch.pyi: error: Cannot find implementation or library stub for module named "sqlalchemy.orm"
/Users/njgrisafi/.cache/pants/named_caches/pex_root/venvs/5bcbf65366e68d9647087f9935ca1efcc8fff5d1/b3aef238742d4e1a2d2b93cbfe8e2aa5b6944556/lib/python3.9/site-packages/mypy/typeshed/stdlib/fnmatch.pyi: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.attributes"
/Users/njgrisafi/.cache/pants/named_caches/pex_root/venvs/5bcbf65366e68d9647087f9935ca1efcc8fff5d1/b3aef238742d4e1a2d2b93cbfe8e2aa5b6944556/lib/python3.9/site-packages/mypy/typeshed/stdlib/fnmatch.pyi: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.decl_api"
tools/python/service-catalog/tests/test_service_catalog.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm"
tools/python/service-catalog/tests/test_service_catalog.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.attributes"
tools/python/service-catalog/tests/test_service_catalog.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.decl_api"
tools/python/service-catalog/service_catalog/cli/__init__.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm"
tools/python/service-catalog/service_catalog/cli/__init__.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.attributes"
tools/python/service-catalog/service_catalog/cli/__init__.py: error: Cannot find implementation or library stub for module named "sqlalchemy.orm.decl_api"
adamant-piano-24321
02/10/2023, 7:16 AM./pants package example
is this operation repeated regardless of changes?gray-answer-11130
02/10/2023, 8:52 AMorange-island-82579
02/10/2023, 10:20 AMrefined-addition-53644
02/10/2023, 12:07 PMmelodic-butcher-43231
02/10/2023, 12:38 PMenough-analyst-54434
02/10/2023, 2:14 PMIt seems the output path option only changes the name of the object being generated not the dist path itself.I assume you're using https://www.pantsbuild.org/docs/reference-pex_binary#codeoutput_pathcode - which is the right idea. If you configure:
[GLOBAL]
pants_distdir = "%(buildroot)s"
Then you should find:
pex_binary(
...
output_path="foo/bar/baz"
)
Nets you a PEX file baz
at foo/bar/baz
in your repo after running ./pamts package ...
on the `pex_binary`target.enough-analyst-54434
02/10/2023, 2:17 PMi.e. when triggeringYes. In fact all Pants operations that produce visible output files act this way. They basically can't assume the file already on the filesystem is up to date. IOW Pants does not 1st look at the output path, see if there is a file, checksum it and proceed from there. It does do something like that for all internal - invisible to you in normal circumstances - sandboxed operations, just not the final operations that materialize output to disk in your workspace.is this operation repeated regardless of changes?./pants package example
adamant-piano-24321
02/10/2023, 2:30 PMbusy-vase-39202
02/10/2023, 2:31 PMrefined-addition-53644
02/10/2023, 2:33 PMrefined-addition-53644
02/10/2023, 2:33 PMhappy-kitchen-89482
02/10/2023, 5:02 PM./pants --changed-since=main --changed-dependents=transitive
to rebuild all packages that are affected by changes in git.happy-kitchen-89482
02/10/2023, 5:02 PM/pants package example
will repeat just the final step of writing to your workspace, but the work leading up to that will be retrieved from cache, if possible.happy-kitchen-89482
02/10/2023, 5:06 PMcrooked-country-1937
02/10/2023, 8:05 PMhttps://github.com/lablup/backend.aiThat repo makes mine feel like a cheap knockoff π³
crooked-country-1937
02/10/2023, 8:07 PMpants
executable in repo. Whats the plan to move to global install ?enough-analyst-54434
02/10/2023, 8:53 PM./pants
script does install Pants globally per user (see ~/.cache/pants/setup
). That said we've started moving towards a pants
binary: https://www.pantsbuild.org/v2.15/docs/installationclean-manchester-83682
02/10/2023, 11:40 PM./pants dependencies sailebot/referral:referral --dependencies-transitive
So i'm able to exclude talon fine, but i want to exclude a dependency that talon depends on.
This works, to exclude talon
python_awslambda(
name="referral",
runtime="python3.7",
handler="referral_lambda.py:lambda_handler",
dependencies=["//:reqs#psycopg2-binary","!!//:reqs#talon"],
)
But this doesn't work
python_awslambda(
name="referral",
runtime="python3.7",
handler="referral_lambda.py:lambda_handler",
dependencies=["//:reqs#psycopg2-binary","!!//:reqs#scipy"],
)
silly-queen-7197
02/11/2023, 12:21 AMgrpcio
when using pants. I'm trying to run some tests but I get a very long error
ERROR: Failed building wheel for grpcio
ERROR: Failed to build one or more wheels
One of the line I see before getting a whole bunch of irrelevant c
noise is
Building requirements.pex with 4 requirements: google-cloud-pubsub~=2.14.1, google-cloud-secret-manager~=2.12.6, pydantic~=1.10.2, pytest~=7.1.3
I've set
[python]
interpreter_constraints = ["CPython==3.10"]
I'm confused because if I create a venv
via python3.10 -m venv venv
I can install all of the above dependencies.
I've tried adding --keep-sandboxes=on_failure
but I don't know how to inspect the sandboxes (they just seem to be bash files?)brave-hair-402
02/11/2023, 10:22 PMbrave-hair-402
02/12/2023, 11:18 AM.
βββ libs
β βββ lib1
β β βββ company_name
β β β βββ lib1
β β β βββ __init__.py
β β β βββ something.py
β β β
β β βββ tests
β β βββ test1.py
β βββ lib2
β βββ company_name
β β βββ lib2
β β βββ __init__.py
β β βββ something.py
β βββ tests
β βββ test2.py
β
βββ executable_apps
βββ app1
β βββ app1.py
βββ app2
βββ app2.py
If I was to adopt pants, would there be any need for using namespace packages? Would Pants be able to handle only pulling in the necessary libraries or files?ambitious-actor-36781
02/13/2023, 2:46 AMPipfile.lock
for a given target?
The pex lockfile seems similar, but not exactly the same.rhythmic-morning-87313
02/13/2023, 7:47 AMrhythmic-morning-87313
02/13/2023, 7:48 AMquick-midnight-96336
02/13/2023, 10:12 AMthousands-france-27863
02/13/2023, 10:45 AMpoetry version $(type)
been the type major, minor or patch.
I have tried adding an experimental_run_shell_command
and sort of works, but I canβt find a way to run it in all packages.
Currently I have to do ./pants run src/python/library1:bumpversion
but ideally I would like to do ./pants run --changed-sinse=main ::bumpversion
.
Is this possible? also, it is possible to pass arguments to that run command?
here the command:
experimental_run_shell_command(
name="bump_version",
tags=["bump_version"],
workdir=f"src/python/{name}/",
command=f"poetry version patch",
)
Maybe I should write a goal�? if so, do you have any examples? Some extra option in the python_distribution target/goal??
Thanks in advance!!famous-xylophone-36532
02/13/2023, 10:46 AMpants test ...
results in Pex errors with the following:
Failed to resolve requirements from PEX environment @ /Users/peder/.cache/pants/named_caches/pex_root/unzipped_pexes/34b6a8b7483f933e686d61c8b7737afee5e7dd24.
Needed cp39-cp39-macosx_12_0_x86_64 compatible dependencies for:
I managed to get this working for building a Pex binary and specifying the target platform, but that isn't possible for python_tests
afaik?