careful-address-89803
10/05/2022, 1:21 PMcareful-address-89803
10/05/2022, 1:24 PMbitter-ability-32190
10/05/2022, 1:47 PMbitter-ability-32190
10/05/2022, 1:48 PMerror
, if any import
doesn't match a firstparty or top-level thirdparty Pants'll errorbitter-ability-32190
10/05/2022, 1:48 PMadamant-magazine-16751
10/05/2022, 2:03 PMgentle-sugar-52379
10/05/2022, 2:16 PMpex_binary
(with execution_mode="venv"
) thats running fine. but sometimes, without a code change it fails importing modules.
if i delete all caches (~/pex
& ~/.cache/pants
) it works again. sometimes multiple times, sometimes only a first time.
tested versions: 2.14.0rc0, 2.14.0.rc2, 2.15.0.dev3
tested layouts: loose, packed, zippapphigh-magician-46188
10/05/2022, 2:56 PMhigh-magician-46188
10/05/2022, 3:11 PM16:51:26.87 [WARN] Pants cannot infer owners for the following imports in the target proj_1/test/foo.py:
* numpy (line: 2)
Also with click
and other packages.
These packages are all in the req file.
What does it mean to own them in that case?high-magician-46188
10/05/2022, 3:11 PMhappy-kitchen-89482
10/05/2022, 3:14 PMhappy-kitchen-89482
10/05/2022, 3:14 PMhappy-kitchen-89482
10/05/2022, 3:14 PMhigh-magician-46188
10/05/2022, 3:15 PMhigh-magician-46188
10/05/2022, 3:15 PMgrep python_requirements -r .
returns no results.high-magician-46188
10/05/2022, 3:17 PMpants tailor ::
saved me a lot of work, it also got me to be dependent on it and to not understand the system.
As far as I can tell, the BUILD
files are temp files that are not really required due to 2 reasons:
1. They are auto-generated by the pants tailor ::
command.
2. There are hundreds of them, it is not rational to maintain so many config files.high-magician-46188
10/05/2022, 3:28 PMBUILD
file.
Also, after running pants tailor ::
and cat **/BUILD
I get something along the lines of:
...
python_sources()
python_sources()
python_sources()
...
python_sources()
python_test_utils(
name="test_utils",
)
python_tests(
name="tests",
)
python_tests(
name="tests",
)
...
python_tests(
name="tests",
)
python_tests(
name="tests",
)
python_tests(
name="tests",
)
python_tests(
name="tests",
)
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
python_sources()
...
witty-crayon-22786
10/05/2022, 4:05 PMpython_tests
for example: https://www.pantsbuild.org/docs/reference-python_testswitty-crayon-22786
10/05/2022, 4:06 PMextra_env_vars
, timeout
, tags
, resolve
, etc are frequently setwitty-crayon-22786
10/05/2022, 4:06 PMdependencies
witty-crayon-22786
10/05/2022, 4:08 PMnumpy
is declared in a requirements.txt
, and that file doesnât have an owning target, then it wonât be loaded: youâll need to include it in what gets tailoredhappy-kitchen-89482
10/05/2022, 4:23 PMhappy-kitchen-89482
10/05/2022, 4:24 PMhappy-kitchen-89482
10/05/2022, 4:24 PMhappy-kitchen-89482
10/05/2022, 4:27 PMpython_sources()
) the metadata is empty. And I get that this is annoying. The reason tailor creates those is that in the past they were necessary. And we still find them to be useful in practice, because they are an obvious place to add metadata when you need to. But - you could replace them with a smaller number of higher-level python_sources()
with recursive globs over their subdirs, if you wanted to. Tailor is smart enough to not try to regenerate for files that are already owned by some higher-up target.happy-kitchen-89482
10/05/2022, 4:29 PMhappy-kitchen-89482
10/05/2022, 4:32 PMhigh-magician-46188
10/05/2022, 5:49 PMhappy-kitchen-89482
10/05/2022, 8:11 PMbumpy-noon-80834
10/05/2022, 8:26 PMpython_awslambda()
are pretty heavy as they embed PEX and wrapping code. Is there an easy way to not use PEX and simply add the project's source code and its dependencies?