melodic-thailand-99227
12/23/2021, 5:06 PMfmt
?bitter-ability-32190
12/23/2021, 5:44 PM--changed-since=origin/master
?
(ve) joshuacannon@CEPHANDRIUS:~/work/techlabs$ ./pants --changed-since=origin/master fmt
ā 4.14s Run yapf on 1470 files.
joshuacannon@CEPHANDRIUS:~/work/techlabs$ git diff origin/master --name-only | wc -l
67
fresh-cat-90827
12/23/2021, 5:46 PMBUILD
files (for instance, to add some boilerplate code across the monorepo or individual projects, such as disabling a formatter globally and then enabling it on the a project basis). Iāve explored this path and would love to share with the community. To learn more, see the thread.ambitious-student-81104
12/23/2021, 10:03 PM./pants tailor
. We want to use it to check whether we have all the BUILD files and targets we need, and found 2 problems:
1. it always generates a BUILD
file at the repo root, which we actually don't want; and
2. it generates a bunch of pex_binary
targets which we don't need either. What are the rules that make tailor
generate those pex_binary
targets?happy-kitchen-89482
12/24/2021, 3:50 PMcurved-television-6568
12/24/2021, 5:46 PMbitter-ability-32190
12/27/2021, 3:56 PMmodern-leather-27612
12/27/2021, 8:01 PM--no-process-execution-local-cleanup
flag. When running ./pants test ā¦
that worked like a charm and all files nicely stuck around, waiting to be inspected.
But originally the resource issue only showed when running ./pants run ā¦
. In that case, Pants happily kept around the PEX files for finding Python and also the cached PEX file for the dependencies. But it did not keep around the PEX file with the local Python code, which kind of defeated the purpose of the flag.
Admittedly, that is with Pants 2.7. Iām good now, thanks to good old trusted print()
plus some choice importlib.resources
invocations. But that does look like a bug to me.hundreds-father-404
12/27/2021, 8:06 PM./pants run
is interesting because it uses InteractiveProcess
to run in the foreground, rather than running in a sandbox like normal. I don't think --no-process-execution-local-cleanup
will do anything for the final run. Instead, you should see folders in the build root like .pants.d/tmplpd86t9k
. Pants will write the PEX and relevant files to that folder and set PYTHONPATH
appropriatelyhappy-kitchen-89482
12/27/2021, 8:08 PMhappy-kitchen-89482
12/27/2021, 8:08 PM./pants run --no-cleanup ...
happy-kitchen-89482
12/27/2021, 8:10 PMmodern-leather-27612
12/27/2021, 8:55 PMbitter-ability-32190
12/27/2021, 9:19 PMextra_requirements
to a Pants thirdparty lockfile?
I'm waiting on upstream PRs to merge, so in the meantime I'd like to use my branch so I'm not stuck. But setting git+<https://github.com/>....
results in an error.happy-kitchen-89482
12/27/2021, 9:58 PMwitty-family-13337
12/28/2021, 1:09 PMkind-projector
. Seeing the error Missing required plugin: kind-projector
when trying to compile some files, but adding the the -Xplugin-list
argument to scalac.args
in pants.toml
seems to fix it (or at least makes it go away). Funny thing is that we also use the better-monadic-for
scalac plugin and we never see any error related to it (even without the scalac
global flag). Is this something you guys are aware or worth reporting it in Github?rhythmic-battery-45198
12/28/2021, 5:33 PMdocker build ...
output?rhythmic-battery-45198
12/28/2021, 5:34 PMConfiguring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
hundreds-father-404
12/28/2021, 5:58 PM__run.sh
script to debug what's going on:
https://www.pantsbuild.org/docs/troubleshooting#debug-tip-inspect-the-sandbox-with---no-process-execution-local-cleanupcurved-television-6568
12/28/2021, 6:08 PMrhythmic-battery-45198
12/28/2021, 6:25 PMsilly-spring-87100
12/29/2021, 10:08 AM11:07:13.24 [ERROR] Invalid option 'pytest_plugins' under [pytest]
But according to the documentation, that how I should debug my tests.
https://www.pantsbuild.org/docs/python-test-goal#running-tests-interactively
[pytest]
pytest_plugins.add = ["ipdb"]
silly-spring-87100
12/29/2021, 10:27 AMtest_end_to_end.py
use files from _input
directory
I have it structured this way:
tests
|---_input
|---file1.csv
|---file2.csv
|--- test_end_to_end.py
|--- BUILD
And BUILD file looks like this
python_sources()
python_tests(
name = "tests0",
)
files(
name = "input",
sources = [
"_input/*",
],
)
And unfortunately this do not work.
How should I modify my BUILD file?silly-spring-87100
12/29/2021, 1:58 PMcommit-sha
I see that, in documentation I cannot pass image_tag
for docker_image(...)
as environment variable.
Worst case is manual bash script, which iterates over all images and creates new tags for them.
Is there a better solution with pants?~curved-television-6568
12/29/2021, 3:59 PMwitty-family-13337
12/30/2021, 10:39 AMsilly-spring-87100
12/30/2021, 1:06 PM./pants pacakge
Unfortunately docker:dind
image (we are using it curentlly) is not compatible with pants:
⢠alpine linux
⢠missing python
What image would you use, to build and push docker images with pants
inside CI container?refined-addition-53644
12/30/2021, 6:12 PMpants test ::
I added this to pants.toml
[pytest]
args = ["--ignore=./my_dir"]
Doesn't work :(hundreds-father-404
12/30/2021, 6:14 PMskip_tests
field.
This part of docs also gives a command to query which tests you use Pants for and which are your old test runner, which you can then pipe into that runner: https://www.pantsbuild.org/docs/existing-repositories#3-set-up-testsrefined-addition-53644
12/30/2021, 6:19 PM