flat-zoo-31952
10/14/2022, 3:08 PMpython_sources()
for my BUILD macro, then flake8 complains that it can't resolve the target names, but these are dynamically defined by Pants and can't be imported. I'd rather not sprinkle flake8 ignores, but I'm not sure what the normal way of handling this isfuture-oxygen-10553
10/14/2022, 7:28 PMsetup.py
file from the python_distribution
target? I tried --keep-sandboxes=always
but nothing I saw had the setup.py
in it. I’m just experimenting with some changes and it’d be easier to inspect the file than rebuild and reinstallstraight-action-80318
10/14/2022, 9:45 PM./pants tailor ::
as well as ./pants generate-lockfiles
but it’s still there.
14:41:38.91 [WARN] Unmatched globs from src/wanpan/extraction:extraction's `sources` field: ["src/wanpan/extraction/*.py", "src/wanpan/extraction/*.pyi"], excludes: ["src/wanpan/extraction/*_test.py", "src/wanpan/extraction/*_test.pyi", "src/wanpan/extraction/conftest.py", "src/wanpan/extraction/test_*.py", "src/wanpan/extraction/test_*.pyi", "src/wanpan/extraction/tests.py", "src/wanpan/extraction/tests.pyi"]
Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.14/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
The BUILD file at that location doesn’t even have extraction
as a target:
python_sources()
shell_sources(
name="launch_ec2_extraction",
)
incalculable-hydrogen-44003
10/15/2022, 2:40 PMBuilding manage.pex with...
step, but I'm not getting any logging to figure out which package is causing the issue. Is there any way to enable logging for this?proud-dentist-22844
10/16/2022, 5:10 AMpyinotify==0.9.6; platform_system == "Linux"
?
Looks like the setup.py is poisoned, so this would require some kind of “spoofing” to make setup.py egg_info
succeed:
https://github.com/seb-m/pyinotify/blob/master/setup.py#L27-L30
WARNING: Discarding <https://files.pythonhosted.org/packages/e3/c0/fd5b18dde17c1249658521f69598f3252f11d9d7a980c5be8619970646e1/pyinotify-0.9.6.tar.gz#sha256=9c998a5d7606ca835065cdabc013ae6c66eb9ea76a00a1e3bc6e0cfe2b4f71f4> (from <https://pypi.org/simple/pyinotify/>). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pyinotify==0.9.6
ERROR: No matching distribution found for pyinotify==0.9.6
gorgeous-winter-99296
10/16/2022, 5:00 PMtorch
in multiple of our repos; and based on hardware and other specifications we need to switch which "flavor", which is done using localtags: +rocm
or +cuNNN
for GPU backends, +cpu
for "CPU-only", or nothing. I've managed to get a bunch of different resolves to work, but I'm not sure how to tie this into dependency inference for local execution, nevermind trying to publish anything using this abomination of version management.breezy-window-26318
10/17/2022, 12:03 AMnice-florist-55958
10/17/2022, 1:15 PMcalm-ambulance-65371
10/17/2022, 6:14 PMjolly-oyster-17014
10/17/2022, 7:55 PMpython_requirement
expects only a pip-requirement string eg. setuptools==65.5.0
and doesn't parse something like 'git+<https://github.com/facebookresearch/pytorch3d.git@stable>'
rough-vase-83553
10/17/2022, 7:58 PMpython_requirement
. We have some requirements on boto===2.49.0a1
. I believe this is an internal boto fork that only exists in our private artifactory. However, lockfile generation turns this into boto===2.49a1
which then fails all the python_requirement
constraints. Changing the lockfile manually to boto===2.49.0a1
doesn't fix it either. Is the version number ill-formed or something?brash-student-40401
10/17/2022, 8:18 PMcalm-ambulance-65371
10/17/2022, 9:26 PMpex
does not honor indexes.add
after the first entry 😞plain-carpet-73994
10/17/2022, 10:29 PMpants.toml
now contains:
[source]
# Add typings as a source root so I can put type stubs in there.
root_patterns = ["src", "typings"]
other than that, it is unchanged. ./pants test
, check
, lint
, etc. work as expected but package
does not:
$ ./pants package ::
15:24:49.37 [ERROR] 1 Exception encountered:
NoSourceRootError: No source root found for `.`. See <https://www.pantsbuild.org/v2.13/docs/source-roots> for how to define source roots.
For reference:
$ ./pants roots
src
typings
happy-kitchen-89482
10/17/2022, 10:38 PMroot_patterns.add =
?plain-carpet-73994
10/17/2022, 10:54 PMsrc
and typings
...happy-kitchen-89482
10/17/2022, 11:01 PMhappy-kitchen-89482
10/17/2022, 11:01 PMhappy-kitchen-89482
10/17/2022, 11:01 PMNoSourceRootError: No source root found for .
happy-kitchen-89482
10/17/2022, 11:01 PM/
to the source roots, to see what happensplain-carpet-73994
10/17/2022, 11:02 PMBUILD
file there with things like python_requirements(module_mapping=...)
plain-carpet-73994
10/17/2022, 11:06 PMBUILD
in the root is the right thing to do, right?happy-kitchen-89482
10/18/2022, 12:34 AMhappy-kitchen-89482
10/18/2022, 12:35 AMbitter-ability-32190
10/18/2022, 12:37 AMwide-midnight-78598
10/18/2022, 4:31 AM3rdparty/ build-support/ experimental-deploy internal-generate-test-lockfile-fixtures peek test
BUILD cargo* experimental-explorer java-dump-source-analysis publish test.sh
BUILD_ROOT check export jvm-symbol-map py-constraints testprojects/
CODE_OF_CONDUCT.md check-default-tools export-codegen lint pyproject.toml tests/
CONTRIBUTING.md completions filedeps list repl update-build-files
CONTRIBUTORS.md conftest.py filter package roots version
LICENSE count-loc fmt pants* run
MAINTAINERS.md dependees generate-lockfiles pants-plugins/ rust-toolchain
README.md dependencies help pants.ci.toml scala-dump-source-analysis
auth-acquire docs/ help-advanced pants.toml src/
auth-token-info experimental-bsp help-all paths tailor
Gets a bit better when narrowing, but still 🤷
% ./pants t
tailor test test.sh testprojects/ tests/
boundless-zebra-79556
10/18/2022, 1:07 PMbehave
for testing BDDs. I would just need to invoke behave
instead of pytest
and maybe tweak some args here and there.high-magician-46188
10/18/2022, 2:09 PMinternal.db
(where internal
is a namespace package).
3. In repo B (which is the mono-repo where I try to integrate Pants) internal.db
is in use and other packages under the internal
namespace are produced.
I think there is a conflict since internal
is partially defined inside the mono-repo and partially outside.
The error I get is of the following form (I get lots of them and they come in pairs:
15:44:04.72 [WARN] The target internal_backoffice/internal/backoffice/__init__.py:../../internal-backoffice-src-sources imports `internal.db`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['//:root#internal-db', 'internal_analytics/internal/__init__.py:../internal-analytics-src-sources', 'internal_athena/internal/__init__.py:../internal-athena-src-sources', 'internal_data_science/internal/__init__.py:../internal-data-science-src-sources', 'internal_logs/internal/__init__.py:../internal-logs-src-sources', ..., 'internal_sqs/internal/__init__.py:../internal-sqs-src-sources'].
Please explicitly include the dependency you want in the `dependencies` field of internal_backoffice/internal/backoffice/__init__.py:../../internal-backoffice-src-sources, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.
Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to <https://www.pantsbuild.org/v2.14/docs/troubleshooting#import-errors-and-missing-dependencies>.
15:44:04.72 [WARN] Pants cannot infer owners for the following imports in the target internal_backoffice/internal/backoffice/__init__.py:../../internal-backoffice-src-sources:
* internal.db (line: 11)
I’ve tried adding the follwing to the root BUILD
file but it didn’t fix it:
__defaults__({
python_requirements: {
"module_mapping": {
"internal-db": ["internal.db"],
}
}
})
And internal-db
is in Pants’ req file.
I’ll try to setup a repro, but not sure when I’ll be able to…cold-vr-15232
10/18/2022, 3:10 PMbrash-baker-91190
10/18/2022, 6:14 PMpants.toml
, particularly default ones that haven't been explicitly set or overridden? In particular, I'm looking to programmatically find out the currently-configured protoc
version (https://www.pantsbuild.org/docs/reference-protoc#version). I know I can set a value concretely and then just process the TOML myself, but I was wondering if Pants already had some built-in capabilities along these lines. Thanks! 🙏