busy-vase-39202
04/28/2022, 9:46 PMbusy-vase-39202
04/28/2022, 9:59 PMcurved-television-6568
04/29/2022, 7:38 AMeager-crayon-52125
04/29/2022, 10:11 AMeager-crayon-52125
04/29/2022, 10:12 AMpant test :
when cwd is some subdirectory of my project root, but I can write dependencies=[":tgt"]
in the same dir's BUILD file?brainy-school-53085
04/29/2022, 11:29 AMpython_awslambda
to build a zip artifact for a lambda. I'd like to set include_requirements=False
, and deploy them as a separate lambda layer.
Is there a target that can create lambda-compatible zip archives of dependencies? Along the lines of:
python_requirements(
name="requirements",
source="...",
)
archive(
name="zipped_requirements_for_layer",
files=[":requirements"],
format="zip",
)
nice-florist-55958
04/29/2022, 12:20 PMpython_distribution
's auto-generated setup.py
without packaging it and unzipping the sdist archive? Maybe some option on the dependencies
goal I did not notice?
We're starting to use IPython's Sphinx directive for a lot more projects, but the virtual environment that needs to be made for this purpose now depends on the project itself.rhythmic-morning-87313
04/29/2022, 12:32 PMpackages/common/pyproject.toml
. I'd like to refer this in`src/ai/backend/common/BUILD` 's resource
command, either in relative paths or absolute paths (based on the root), but it says it's not allowed. Is copying pyproject.toml
to src/ai/backend/common
the only way?
Q2: Is it possible to use existing setup.cfg
and their install_requires
configs in each project to specify 3rd-party dependencies per BUILD
target?
Q3: In pants.toml
I could specify per-tool options such as pytest.args
and pytest.extra_requirements.add
. How do I specify per-tool per-project options as well? (e.g., each project requires different sets of xxx-types
packages for type check)
Q4: How to single-source the version across multiple distribution targets in a (Python-based) mono-repository?rhythmic-morning-87313
04/29/2022, 12:35 PM3rdparties/python/requirements.txt
and set it as a :reqs
target so that could be used to generate user lock files. Could I do the same for multiple build targets in a mono-repository?rhythmic-morning-87313
04/29/2022, 12:36 PMrhythmic-morning-87313
04/29/2022, 2:01 PMpython_requirements
, there is a special target reference format //:reqs
. Could someone explain what this means?rhythmic-morning-87313
04/29/2022, 2:02 PMpath/to/dir:name
as long as I understandrhythmic-morning-87313
04/29/2022, 2:22 PM./pants test tests/common:tests
, pytest gets executed but all tests immediately fails with import errors because there is no 3rd-party dependencies installed. tests/common/BUILD
simply consists of python_tests(name="tests")
and its siblings include conftest.py
and test_xxx.py
stuffs. How do I let pants install 3rd party dependencies for tests?rhythmic-morning-87313
04/29/2022, 2:46 PMpython_test_utils
and how does it interact with python_tests
?rhythmic-morning-87313
04/29/2022, 3:03 PMrhythmic-morning-87313
04/29/2022, 3:04 PMfresh-cat-90827
04/29/2022, 3:41 PM./pants test ::
for all tests, is there an option to mark which tests should run with cache available and which should always be run as if there was no local cache (essentially with --no-local-cache
)? I am thinking about creating a separate python_tests
target with tags
e.g. ./pants --tag="integration" test :: --no-local-cache
. Is there a better option?rhythmic-morning-87313
04/29/2022, 3:45 PMcold-soccer-63228
04/29/2022, 7:32 PM./pants tailor
know when to generate python_sources
as opposed to python_test_utils
, i.e. what heuristics of the directory tree, filenames, etc. is Pants looking for when deciding whether to generate python_sources
for a directory as opposed to python_test_utils
?high-yak-85899
04/29/2022, 7:52 PMrequirements.txt
and generate a new lockfile (not doing it with pants until 2.11 is a stable release), all of my tests that have third party dependencies have to get rerun even if their dependency wasn't the thing that was modified. Obviously this is less frequent than changing first party code, but I'm curious if there's been any talk on if that could ever be improved (or if the improvements that 2.11 brings helps already).plain-monkey-49051
04/29/2022, 10:21 PM./pants test
Adding BUILD files a little at a time since I hit a bug when `tailor`ing. the whole project, so initially I have things configured to run just one test file. When I run ./pants filter --target-type=python_test ::
I see the output I expect since this is the directory where I added a BUILD file with python_test(…):
sundial_utils/tests/sundial_utils/analytics:analytics
But if I run ./pants test
the test file inside that analytics subdirectory (named test_rando.py
) is not found, despite the fact that its name conforms to the glob pattern described in the “Unmatched globs” error message:
Unmatched globs from sundial_utils/src/sundial_utils/analytics:analytics's `sources` field: ["sundial_utils/src/sundial_utils/analytics/*_test.py", "sundial_utils/src/sundial_utils/analytics/test_*.py", "sundial_utils/src/sundial_utils/analytics/tests.py"]
Not sure what to try to get this working.fast-nail-55400
04/29/2022, 10:30 PMrhythmic-morning-87313
04/30/2022, 2:51 AMrequirements.txt
using python_requirements()
seems to put all the same external dependencies to different packages defined as python_distribution()
in multiple different BUILD
files.
Through my Q5/A5, I expected that pants automatically include the actual direct dependencies only, but it seems not doing any filtering like that. How do I achieve it?
Example:
pkg "manager" depends on "aiofiles" but pkg "common" does not. They both depends on "aiohttp".
Both "aiofiles" and "aiohttp" are included in the unified requirements.txt
.
"manager" depends on "common".
I just removed pyproject.toml
and let pants generate setup.py using generate_setup=True
.
-> expected: METADATA
of the "manager" pkg include "aiofiles" while the "common" pkg's does not. Both include "aiohttp".
(because although "manager" depends on "common", only the direct requirements of "manager" should be added to "manager"'s pkg metadata, not both "manager" and "common"'s direct requirements)
-> actual result: Both include "aiofiles" and "aiohttp".rhythmic-morning-87313
04/30/2022, 3:03 AMpython_distribution()
, wheel_config_settings={"--global-option": ["--universal", "false"]},
seems not working. How could I pass such extra bdist_wheel
arguments?rhythmic-morning-87313
04/30/2022, 4:05 AMrhythmic-morning-87313
04/30/2022, 4:07 AM./pants export
seems not to have any options. https://www.pantsbuild.org/docs/reference-export What does it do exactly? Could I use to generate a unified venv that includes all targets, for example? When I run it, ExportError: Failed to write virtualenv for the resolve 'None' (using CPython==3.10.*) to dist/export/python/virtualenv
. So, my codes use Python 3.10 but pants is running with the apt-installed system Python 3.8. Can I change it as well (I’ve explicitly set pants.toml already…)?rhythmic-morning-87313
04/30/2022, 4:10 AMgenerate-lockfiles
manually. (I configured separate lockfile pahts for pytest and mypy as instructed.) Could I make pants to do it automatically? In what conditions does it ask to do so?rhythmic-morning-87313
04/30/2022, 1:41 PMsetup.py
generation by following https://www.pantsbuild.org/docs/plugins-setup-py. It turns out working pretty-well: https://github.com/lablup/backend.ai/blob/751fb751ebaced53467c33e62546465e8902a77a/tools/pants-plugins/setupgen/register.py Are there any references/docs about pants' internal engine APIs?magnificent-hairdresser-5608
04/30/2022, 4:14 PMeager-crayon-52125
04/30/2022, 5:20 PMp test :
when I'm in utils/
, rather than `./pants test utils:`from the repo root).
With the hopes that it's useful for others (and, cards on the table: with the hopes that folks report bugs) here's the link:
https://github.com/nitzan-shaked/p
(edit: added global and goal-specific options completion)