ripe-cpu-85141
08/01/2022, 10:34 PMpants-plugins/tutugen
which contains a register.py
file and a BUILD
file. First, I'm not sure what I should put on the BUILD file. I read about python_source, python_requirement and pants_requirements. I'm not sure which ones should go in the file.
Then, the plugin requires a 3rd party lib named tutu
. If I try to exec any pants commands, I get a No module named: 'tutu'
error. I'm not sure what is missing :-/ripe-cpu-85141
08/01/2022, 11:46 PMripe-cpu-85141
08/02/2022, 12:00 AMripe-cpu-85141
08/02/2022, 1:09 AMpython_awslambda
target and it seems I can't make it depend on the generated files coming from my new codegen target.
If I make it depends on the codegen source files via a resources
target, the source files are added on the lambda. But if I make it depends on the codegen target, nothing is added.
If I do a ./pants export-codegen ::
, the files are generated at the right place. I'm not sure what I am missing here 😕happy-kitchen-89482
08/02/2022, 1:35 AMpython_awslambda
target would depend on some source files in a python_sources
target and those would in turn depend on generated sources?happy-kitchen-89482
08/02/2022, 1:36 AMhappy-kitchen-89482
08/02/2022, 1:36 AMpython_sources
should depend on the codegen target (either implicitly via dep inference or explicitly via dependencies=
) and the right thing "should happen"happy-kitchen-89482
08/02/2022, 1:37 AMripe-cpu-85141
08/02/2022, 1:51 AMripe-cpu-85141
08/02/2022, 1:52 AMripe-cpu-85141
08/02/2022, 1:53 AMpython_awslambda
targetripe-cpu-85141
08/02/2022, 1:55 AMprotobuf_sources
and in that case, the result is added to the lambda. So I suspect my custom codegen module but I don't know where to look at. If I run ./pants export-codegen ::
, the files are generated at the right place, so I'm not sure why nothing is added to the lambdafreezing-lamp-12123
08/02/2022, 3:06 PMBUILD
files via vscode (i.e. autocomplete of target documentation and such, as if it was an actual python file with some globals in scope) ? and if so, how would one go about that? .. 🙏ripe-cpu-85141
08/02/2022, 5:46 PMpy/projects/cards/ext-config/something
that will be used for generating files. The yaml files use the tutu
plugin that is under pants-plugins/
and I also added a .proto and a resource file not going through codegen for comparing.
If I use ./pants export-codegen ::
everything is generated. If I use ./pants package ::
, the lambda only gets the .py generated from the .proto file and the resource file.
% monorepants/dist/py.projects.cards% unzip -t lambda.zip
[...]
testing: PEX-INFO OK
testing: __main__.py OK
testing: ext-config/ OK
testing: ext-config/something/ OK
testing: ext-config/something/a-resource-file OK
testing: ext_config/ OK
testing: ext_config/something/ OK
testing: ext_config/something/something_pb2.py OK
testing: turbocorp/ OK
testing: turbocorp/cards/ OK
testing: turbocorp/cards/__init__.py OK
testing: turbocorp/cards/core/ OK
testing: turbocorp/cards/core/__init__.py OK
testing: turbocorp/cards/core/deck.py OK
testing: turbocorp/cards/entrypoint.py OK
testing: turbocorp/cards/game.py OK
testing: LAMBDEX-INFO OK
testing: lambdex_handler.py OK
No errors detected in compressed data of lambda.zip.
Does someone have an idea why my generated yaml files don't make it to the zip file?brash-baker-91190
08/02/2022, 6:19 PM--no-process-cleanup
doesn't work for running shunit2
tests? I've been trying to debug some fixture files not being included in my tests, but I don't actually end up with any preserved sandbox directories.microscopic-refrigerator-69774
08/03/2022, 11:30 AMNo interpreter compatible with the requested constraints was found:
A distribution for pydantic could not be resolved for /usr/local/bin/python3.8.
Found 1 distribution for pydantic that do not apply:
1.) The wheel tags for pydantic 1.9.1 are cp38-cp38-macosx_10_9_x86_64 which do not match the supported tags of /usr/local/bin/python3.8:
cp38-cp38-manylinux_2_31_aarch64
busy-vase-39202
08/03/2022, 7:02 PMcool-yacht-37128
08/03/2022, 7:26 PM[mypy]
args = [“--exclude tests/“]
freezing-lamp-12123
08/03/2022, 7:33 PM❯ ./pants roots
pants-plugins
where do i point my editor to to get the proper path for the current version of the pants python libraries? as i understand it pants bundles it’s own python somewhere
digging around in ~/.cache/pants
i’ve found ~/.cache/pants/setup/bootstrap-Darwin-arm64/pants.bA7ZRm/install/lib/python3.9/site-packages/
…. which looks promising, but is there some established way through a similar command to get to this path without manual spelunking? and is this enough to get lsp support?
let me iterate — i’m in no way a python developer 😆refined-addition-53644
08/03/2022, 7:36 PMadd
, remove
or update
? I suppose this won’t generalize across multiple languages.busy-vase-39202
08/03/2022, 7:36 PMfreezing-lamp-12123
08/03/2022, 7:48 PM:sausage:
is made … 😆bored-energy-25252
08/04/2022, 6:52 AMicy-hair-30586
08/04/2022, 12:04 PMmysterious-waiter-14207
08/04/2022, 12:25 PMdependency_rule("/modules/core/application/*", allowed=["/modules/core/domain/*"])
What would be the best matching utility within pants for that?refined-addition-53644
08/04/2022, 12:42 PMchanged-since
when no source files were changed. Please see 🧵refined-addition-53644
08/04/2022, 1:52 PMchanged-since=main
when running test.
But then this messes up with our coverage threshold and hence the CI fails. Is there any solution for this?flaky-artist-57016
08/04/2022, 2:59 PM./pants fmt ::
. After this, ./pants lint ::
shows the linters are satisfied with the work they’ve done. However, if I then run ./pants lint subdirectory::
some of the linters complain that they would make changes (isort
in particular). Any idea what’s going on here? ./pants tailor
succeeds without issue so the BUILD files look to be in order.
’m seeing a strange issue in the Python monorepo I’m working in. If I runfuture-oxygen-10553
08/04/2022, 5:27 PMpyproject.toml
file, using Flit to build the sdist/wheel. Is there a way to set a python_requirements
to read the pyproject.toml
file, when I’m not using Poetry? I saw that Pants supports PEP 517 to build the distribution, but I’m curious if it can also single-source the external dependencies. Thanks!bitter-ability-32190
08/04/2022, 7:34 PMdependencies
field, and therefore falls short when presented when unexpected targets.
I encourage everyone to read it, reflect on it, and comment with thoughts. It's an ambitious proposal (and will take a community effort to implement if agreed on) so I'm also going to explicitly ask readers to read the whole thing before commenting, and comment from a place of collaboration (and not from a place of challenge).
The TL;DR is:
1. shifting from one monolithic dependencies
field to several more specialized dependencies fields (e.g file_deps
, typecheck_deps
)
2. Treating the "file" as the root understanding of most dependencies