average-australia-85137
03/17/2022, 5:49 PM(I have the full logs if that's useful but I don't know if it contains much more information (the command was"Error storing Digest { hash: Fingerprint<734bd41218ea87070362108ef2424945f2c99700f6523a06ae7ee5f4ef2a09d4>, size_bytes: 2263 }: MDB_CORRUPTED: Located page was wrong type"
./pants --no-dynamic-ui --spec-files=.targets.txt package
)
Has anybody else experienced this? Is this is an issue with what & how we are saving in the cache? is it possible we need to like.. flush some file or something explicitly so the database is consistent? Or more generally does anyone have any idea if this is an issue with our code/files, circleci, pants or underlying in LMDB?flat-zoo-31952
03/17/2022, 7:24 PMβ― ./pants list aiven/admin/__init__.py
//aiven/admin/__init__.py:../../aiven
//aiven/admin/__init__.py:../../fake-target
Was there ever protection against this? Is this considered an okay situation to be in?wide-midnight-78598
03/18/2022, 1:30 AMpants.toml
for build_patterns
marker_filenames
and root_patterns
?
I think marker_filenames
and root_patterns
both set the source root, via different mechanisms, and then build_patterns
is what Pants looks for to identify something pants-able.
However, I just did a re-factor, and I'm not sure why I lost access to one of my libraries.
/core/BUILD.pants
python_sources(
name="libcore",
sources=["**/*.py"],
)
/helloworld/BUILD.pants
python_sources(
name="libhelloworld",
sources=["**/*.py"],
dependencies=[
"core:libcore",
],
)
This above, works, however, nested everything under examples/python
(without adding new BUILD files) and it falls over.
My pants.toml
is as follows:
[GLOBAL]
pants_version = "2.11.0.dev2"
build_patterns = ["BUILD.pants", "BUILD"]
[source]
marker_filenames = ["BUILD.pants"]
root_patterns = [
"examples/python",
"pants-plugins",
]
...
After re-reading https://www.pantsbuild.org/docs/existing-repositories#migrating-from-other-build-tools-set-custom-build-file-names - I think I can drop the build_patterns
entirely, and while I can add another top-level BUILD to the examples/python
directory, I'm not sure why it worked top level but then fails nested... Note: My pants.toml
had "/" as a root_pattern, when everything was top-levelfew-arm-93065
03/18/2022, 9:09 PMpip download
with the same settings. Can I get some help? Details in thread.fresh-cat-90827
03/18/2022, 9:47 PMnice-florist-55958
03/18/2022, 11:16 PMisort
doesn't handle src_paths
from .isort.cfg
correctly. If you have namespaced packages implemented in different parts of the repo, then in order for isort to consider any modules exposed in these namespaces first-party imports, you need to add the paths explicitly in the configuration (https://github.com/PyCQA/isort/issues/1704).
When running isort with Pants, this does not work (version 5.10.1): ./pants fmt --only=isort path_to_file_that_imports_firstparty_namespaced_modules
reports isort made no changes, but isort path_to_file_that_imports_firstparty_namespaced_modules
makes the expected change in grouping.
One clue is isort --show-config
reveals the src_paths
field to be fully qualified, even though they are only specified relative to the configuration root, whereas the same command ran by Pants shows they're still relative.
Pants v2.10rc2.happy-kitchen-89482
03/19/2022, 7:22 PMbar
in section foo
, and it doesn't exist, but there is a bar
in section DEFAULT
, then that latter value will be returned. There doesn't seem to be much need for this functionality any more (it made a little more sense when we had recursive options) so I propose deprecating it, unless people are strongly relying on it. Please comment in thread if you have opinions on this, thanks!refined-addition-53644
03/19/2022, 7:39 PM2.10.0rc5
but keep getting error. Please see the π§΅ for detailsstrong-toothbrush-37759
03/19/2022, 9:16 PMconftest.py
in one directory with a BUILD-file and in a deeper level you have more tests with their own BUILD-file, the usual βpytestβ behavior would be to go up the folders and use all conftest.py
-Files up the tree. This is kind of obsolete with Pants, right? So I could either import the stuff I need from conftest.py
above into my tests, or define the python_test_utils
from βaboveβ in my BUILD-file. Does this make sense? π
nice-florist-55958
03/21/2022, 2:30 AM.gitignore
when deciding what to augment its global ignore option with? I notice that if, e.g., *.csv
is in .gitignore
and !exempt_csv.csv
is in ./proj/apps/someapp/assets/.gitignore
, then git will track ./proj/apps/someapp/assets/exempt_csv.csv
but Pants will continue to ignore and exclude it from packaging.rapid-crayon-8232
03/21/2022, 9:59 AM2.11.0rc0
version to generate lock files with pex
lockfile-generator, and the part about generating lockfiles works fine ^^, but found a bug when trying to install the resolved lockfile, wrote a ticket about it: https://github.com/pantsbuild/pants/issues/14859nutritious-application-35061
03/21/2022, 2:40 PMbillions-bear-56484
03/21/2022, 4:08 PMProcessExecutionFailure: Process 'Building src.python.herzensgut.accounts/serve.pex with 12 requirements: bcrypt==3.2.0, databases[postgresql]==0.5.3, email-validator==1.1.3, fastapi-health==0.4.0, fastapi-jwt==0.1.7, fastapi-mail==1.0.2, fastapi==0.70.0, passlib==1.7.4, pyjwt==2.0.1, python-dotenv==0.19.2, python-multipart==0.0.5, uvicorn==0.16.0' failed with exit code 1.
stdout:
stderr:
ERROR: Could not find a version that satisfies the requirement fastapi-jwt==0.1.7
ERROR: No matching distribution found for fastapi-jwt==0.1.7
The strange thing is, that running the pex_binary
is working.
This is my BUILD file:
python_requirement(
requirements=[
"bcrypt==3.2.0",
"fastapi==0.70.0",
"fastapi-health==0.4.0",
"fastapi-jwt==0.1.7",
"fastapi-mail==1.0.2",
"email-validator==1.1.3",
"passlib==1.7.4",
"pyjwt==2.0.1",
"python-dotenv==0.19.2",
"python-multipart==0.0.5",
"uvicorn==0.16.0",
]
)
resources(
name="queries",
sources=[
"**/*.sql",
],
)
resources(
name="templates",
sources=[
"**/*.html",
],
)
python_sources(
name="lib",
sources=[
"**/*.py",
],
dependencies=[
":queries",
":templates",
"src/python/herzensgut/shared:lib",
],
)
python_distribution(
name="dist",
dependencies=[
":lib",
],
wheel=True,
sdist=True,
provides=setup_py(
version="0.0.1",
name="herzensgut.accounts",
description="",
),
)
pex_binary(
name="serve",
restartable=True,
entry_point="app/api/server.py",
)
Do you have an idea what the problem is?
Thanks!happy-kitchen-89482
03/21/2022, 5:08 PMhappy-kitchen-89482
03/21/2022, 6:12 PMfresh-continent-76371
03/22/2022, 7:27 AMfresh-continent-76371
03/22/2022, 7:28 AMlimited-insurance-37393
03/22/2022, 1:27 PMhappy-kitchen-89482
03/22/2022, 4:42 PMhigh-yak-85899
03/22/2022, 5:11 PMpants.toml
setting was great to set up something like [docker.registries.aws-ecr]
so that I could refer to them. However, one of my images depends on a base image we store in that registry. It seems like I still have to do FROM <my long registry ID>/<image name>:<image tag>
instead of just FROM <image name>:<image tag>
. My target configuration looks like this
docker_image(
name = "gnc_ground",
registries = ["@aws-ecr"],
tags = ["ground_software_service"],
)
loud-laptop-17949
03/22/2022, 7:01 PM./pants generate-lockfiles --resolve=terraform-hcl2-parser
Unknown flag --resolve on global scope
Did you mean --level?
Use `./pants help` to get help.
11:57:54.70 [ERROR] Unknown flags --resolve on global scope
Use --print-stacktrace for more error details and/or -ldebug for more logs.
See <https://www.pantsbuild.org/v2.9/docs/troubleshooting> for common issues.
Consider reaching out for help: <https://www.pantsbuild.org/v2.9/docs/getting-help>
strong-toothbrush-37759
03/22/2022, 7:43 PMpytest-django
) which are loaded when pytest starts. When I generate a lockfile using ./pants generate-lockfile
I get pytest-django==3.10.0
but pytest-django==4.1.0
is what I need and what is written in our requirements-dev.txt
actually π€bitter-ability-32190
03/22/2022, 8:06 PM2022-03-22T12:54:13,150 ERROR: Could not find a version that satisfies the requirement audioread==2.1.8
2022-03-22T12:54:13,150 ERROR: No matching distribution found for audioread==2.1.8
strong-toothbrush-37759
03/22/2022, 8:28 PMdjango-dotenv
to python-dotenv
and with that from absolute to relative and a-lot-easier .env
-File loading. But now my testing with Pants stopped working due to the fact (I guess) that itβs hermetic and the .env
-File cannot be found. Is there a common way to use .env
-Files inside Pants? At least I couldnβt find anything related to that topic inside the docs π.bitter-ability-32190
03/22/2022, 9:23 PMhappy-kitchen-89482
03/22/2022, 9:25 PMNo applicable files or targets matched.
WARN log:
Today when you do things like ./pants test ::
or ./pants --changed-since=main --changed-dependees=transitive test
and no test files match, you get a WARN log along the lines of
17:18:14.39 [WARN] No applicable files or targets matched. The `test` goal works with these target types:
* go_package
* junit_test
* python_test
* scala_junit_test
* scalatest_test
* shunit2_test
However, you only specified targets with these target types:
* python_source
Please specify relevant files and/or targets. Run `./pants filter --target-type=go_package,junit_test,python_test,scala_junit_test,scalatest_test,shunit2_test ::` to find all applicable targets in your project, or run `./pants filter --target-type=go_package,junit_test,python_test,scala_junit_test,scalatest_test,shunit2_test :: | xargs ./pants filedeps` to find all applicable files.
I am currently wondering whether this warning is desirable.
β’ Arguments for it include that it may help catch cases where your Pants command did not match your intent.
β’ Arguments against it include that the empty set is not a special case, so if "run all tests that match this spec" ends up being fulfilled vacuously then so be it. This is particularly salient for --changed-*
or when generating command specs from other data.acceptable-football-32760
03/23/2022, 3:11 PMconsole_scripts
endpoint of python_distribution
? Similar to ./pants run <pex_target>
?
Or is it incouraged to develop useing pex binaries? In this case, how to deal with those which contain huge amount of third-party heavy dependencies (think pytorch
)?
thanks in advance πnice-florist-55958
03/23/2022, 3:19 PMpython_distribution
and pex_binary
targets), and this time there were no weird hash digest errors, runtime deadlocks, skipped dependencies, etc. and goals ran much more quickly. I suppose the moral of the story is don't use NFSv3.
With that said, I just got word that our organization is starting the process of migrating various NFS shares to NFSv4. I don't know the implications of that, but when it happens I will probably try to give NFS another chance, as it seems there are material changes to the file locking mechanisms as it's now baked directly into the protocol. When that gets rolled out and I have an opportunity to test it, I'll pass along another update. It will be worthwhile for us to still get things working on NFS since it is so deeply embedded in the organization, and getting setup on local storage is more operationally intensive (permissions, committing to a single host, etc.).
I also heard we made a new hire to get a pilot going for WSL2, which I think will be the ultimate solution. But we'll see about that one...!
Thanks for all your help since we started this process. I think I can see a light at the end of the tunnel now!acceptable-football-32760
03/23/2022, 3:30 PMpackage_a/
a.py
BUILD -> python_distribution(name = "package_a")
package_b/
b.py -> imports package_a.a
BUILD -> python_distribution(name = "package_b")
My previous understanding was that when building wheels for package_b
, it would detect automatically the dependency on package_a
(via the respective file a.py
) and I don't need to list this dependency explicityly in python_distribution
i.e. package_b
will just include the sources and transitive deps of the package_a
However, some recent experiments show it is not true, so I must include //package_a
as a dep
of package_b
. Is that correct? Doesn't this defeat the idea of pants taking over dep management, so that if later the actual import of a.py
is removed, there's not dangling dependency on package_a
remaining?
Thanks! I hope I explained my issue clearly, LMK if I can refine.rapid-crayon-8232
03/23/2022, 5:11 PM$HOME/.cache/pants
folder between steps/build for faster execution.
The catch is that even when running a ./pants
goals on only changed targets (with --changed-since=origin/main
), pants starts by downloading all dependencies in the impacted lockfiles, and with a data-science
resolve that can easily get to ~10Gbs of cache to upload/download.
Is there any way around this ? or Am i doing something wrong^^, since it's indeed slower to push/pull 10Gigs of cache each time