alert-psychiatrist-14102
01/29/2023, 8:01 AMhappy-kitchen-89482
01/29/2023, 6:44 PMhappy-kitchen-89482
01/30/2023, 2:55 AMancient-france-42909
01/30/2023, 4:28 PM-ldebug
the output is buffered then dumped immediately, is there a way to do that?high-yak-85899
01/30/2023, 7:56 PMpytest
so I know my installation is good. It requires a rabbitmq-server
and erlang
installation on the system which are both available under my PATH
. Pants seems to be picking things up fine because the server is attempted to start, but fails the boot process. I think sandboxing is the most obvious thing at play here. Any ideas for environment variable differences or similar to look at? When I preserve sandboxes, the generated __run.sh
executes without error.faint-businessperson-86903
01/31/2023, 12:45 AMarchive
target deterministically (in 🧵).adorable-engine-71736
01/31/2023, 10:04 AM./pants
script from the repo, and added pantsup.sh
- im getting a flake - seemingly only in CI and not local, although that could just be because im testing more in CI - typical error is:
✓ mypy succeeded.
FATAL: exception not rethrown
FATAL: exception not rethrown
/home/runner/work/_temp/f3725c23-b66e-48a4-b13a-9692347a0610.sh: line 1: 1684 Aborted (core dumped) ./scripts/pants check ::
Error: Process completed with exit code 134.
i can open a ticket but i wanted to rule out that im doing something incorrect firstancient-france-42909
01/31/2023, 12:19 PMdocker "$@"
adventurous-journalist-72920
01/31/2023, 12:46 PMthousands-plumber-33255
01/31/2023, 12:52 PMhigh-energy-73119
01/31/2023, 12:59 PMhigh-energy-73119
01/31/2023, 1:00 PMcurved-microphone-39455
01/31/2023, 2:46 PMpants.toml
remote_cache_read = true
remote_cache_write = true
remote_store_address = "<grpc://cache.local:8980>"
remote_instance_name = "worker"
My on-prem REAPI server are working correctly and exposed correctly (Tested with Bazel example) and when I try the remote_execution
with Pants, I get errors about the Environment missing Python (which is normal at this state) but we don't want remote execution, only the caching.
When running any command lint, fmt, test, package, publish
I don't see any hit on my server or logs in Pants that tell its trying to do something with the remote cache, Am I missing something here ?
I am following this https://www.pantsbuild.org/v2.15/docs/remote-cachinglemon-oxygen-72498
01/31/2023, 3:21 PM./pants --changed-since=origin/main --changed-dependees=transitive test
. And because GitHub default runners have pretty low performance, the Pants CI is on the average 4 to 5 times slower, because it uses a single machine.
I wonder where I should be headed to speed this up. For the moment we don't cache Pants' state and use --changed-since=origin/main
, because downloading the cache was quite slow. Ways forward that I see:
1. Use persistent runners, keep Pants' state
2. Use remote executors
3. Use a remote cache
Any experience to share on what would yield the biggest speedup?brief-flag-35586
01/31/2023, 3:35 PM~/bin/pants package clients/prefect:prefect_client
00:16:55.48 [INFO] Completed: Building clients.prefect/prefect_client@environment=local_docker.pex with 2 requirements: prefect[aws,postgres,redis,templates,viz]<0.16.0,>=0.15.6, redis-py-cluster<3.0.0,>=2
00:16:55.63 [INFO] Completed: Building clients.prefect/prefect_client@environment=local.pex with 2 requirements: prefect[aws,postgres,redis,templates,viz]<0.16.0,>=0.15.6, redis-py-cluster<3.0.0,>=2
00:16:55.69 [INFO] Wrote dist/clients.prefect/prefect_client@environment=local_docker.pex
00:16:55.69 [INFO] Wrote dist/clients.prefect/prefect_client@environment=local.pex
It’s using the right environment, but doesn’t use docker at all (details in 🧵)bitter-ability-32190
01/31/2023, 3:38 PMhttp_source(
filename = "pybind11",
len = 569736,
sha256 = "8103bf774f02ff7a063c017eb1adac51c17af9c2c08363830618ad648f09ad1f",
url = "<https://github.com/pybind/pybind11/archive/refs/tags/v2.4.3.tar.gz>",
),
Started failing due to the sha/len being different.
And then today, they decided to revert the change.
So just FYI to those of y'all fielding off errors from Pants talking about unexpected length/SHA on GitHub tarball URLs.brief-flag-35586
01/31/2023, 3:39 PM# pants.toml
[GLOBAL]
pants_version = "2.15.0rc2"
pantsd = false
print_stacktrace = true
pythonpath = ["%(buildroot)s/build-support/plugins"]
colors = true
build_patterns = ["PANTS", "PANTS.root"]
build_file_prelude_globs = ["build-support/macros.py"]
backend_packages = [
"pants.backend.python.lint.pyupgrade",
"pants.backend.python.lint.autoflake",
"pants.backend.python.lint.docformatter",
"pants.backend.python.lint.isort",
"pants.backend.python.lint.black",
"pants.backend.python.lint.flake8",
"pants.backend.python.lint.pylint",
"pants.backend.python.typecheck.mypy",
"pants.backend.python",
"pants.backend.shell.lint.shellcheck",
"pants.backend.shell.lint.shfmt",
"pants.backend.shell",
"pants.backend.awslambda.python",
"pants.backend.plugin_development", # for the pants_requirements macro
"pants.backend.docker",
"pants.backend.docker.lint.hadolint",
]
[python]
interpreter_constraints = [">=3.8,<3.10"]
interpreter_versions_universe = ["3.8", "3.9"]
[python-bootstrap]
search_path = ["<PATH>"]
names = ["python3.9", "python3.8", "python3", "python"]
....
[environments-preview.names]
local_docker = "//:local_docker"
local = "//:local"
And PANTS.root
is :
...
docker_environment(
name="local_docker",
image="python:3.9.13-slim-buster",
fallback_environment="local",
docker_executable_search_paths=["<PATH>"]
)
local_environment(
name="local",
)
# __defaults__(all=dict(environment="docker"))
...
brief-flag-35586
01/31/2023, 3:39 PMclients/prefect/PANTS
is :
python_sources()
pex_binary(
name="prefect_client",
entry_point="prefect_client.py",
environment=parametrize("local_docker", "local")
)
dazzling-elephant-33766
01/31/2023, 3:56 PMlib/platform/tests/test_advice_models.py
which imports from lib.business_rules
import lib.business_rules # noqa
def test_thing():
assert 1 == 1
Running this locally, everything works completely fine ✅
$ ./pants test --force lib/platform/tests/test_advice_models.py
15:51:25.09 [INFO] Completed: Run Pytest - lib/platform/tests/test_advice_models.py - succeeded.
Partition: platform
✓ lib/platform/tests/test_advice_models.py succeeded in 0.85s.
But running the same test in CI gives an error ❌
==================================== ERRORS ====================================
__________ ERROR collecting lib/platform/tests/test_advice_models.py ___________
ImportError while importing test module '/tmp/pants-sandbox-5gjBP7/lib/platform/tests/test_advice_models.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
lib/platform/tests/test_advice_models.py:1: in <module>
import lib.business_rules # noqa
E ModuleNotFoundError: No module named 'lib.business_rules'
My GH action is invoking the exact test file (the same way I would run locally)
jobs:
build_and_test_python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- uses: pantsbuild/actions/init-pants@v2
- name: Test
run: |
./pants test lib/platform/tests/test_advice_models.py
if: always() # We want the log even on failures.
Checking the output of
./pants dependencies --transitive lib/platform/tests/test_advice_models.py
Includes things in lib.business_rules
so unsure why CI is unable to find this module
lib/business_rules/__init__.py
lib/business_rules/engine.py
lib/business_rules/operators.py
It’s a long shot (apologies), but any idea how I could begin to debug what’s going on here? (I’m on pants 2.15.0rc2 )adorable-engine-71736
01/31/2023, 6:33 PMdocformatter
- does anyone have any ideas how this could be acheived?witty-crayon-22786
01/31/2023, 6:40 PMproud-dentist-22844
01/31/2023, 10:44 PMpython_test
target depends a python_distribution
target (a packagable target) via the depenedencies
field instead of the runtime_package_dependencies
field[1], will the python_test
transitively depend on everything the python_distribution
depends on (like the deps inferred from entry_points)?
[1] https://www.pantsbuild.org/docs/python-test-goal#testing-your-packaging-pipeline
I want to depend (well, actually infer a dep from within a plugin) on the underlying code without actually generating the wheel.dazzling-dinner-76420
01/31/2023, 10:54 PMapps
are used by non-developers in parts of the company that will depend on the algorithms written in src
. This will also allow a more formal development process into src
to be treated similar as numpy and pandas for internal development.
Everything up to this point had been built exclusively in a windows environment. Setting up to use pants to handle our dependencies, testing, and distribution we have started working in WSL using ubuntu 22.04. My understanding that in addition to being able to run pants this should help us remove any incurred dependencies on windows enabling easier distribution to other operating systems or servers.
The questions we have at the moment are:
• What is the best way to distribute standalone python apps to internal workers on windows machines?
◦ We have been reviewing the docs but the support seems to centered towards pex (https://www.pantsbuild.org/docs/python-distributions)
• Some members of the development team work in pycharm while others us vs code. Our current plan to to leave most development flows unaltered in the previous windows environments with pycharm and handle testing/distribution separately in ubuntu or using the WSL extension for vs code. Does this raise any red flags?
In addition, we would very much appreciate any feedback regarding our proposed structure and plan this far! Let me know if there are any other details that would help in understanding our questions or if you have any questions for us!faint-dress-64989
02/01/2023, 12:07 AMpyspark
application over to our pants repo. Previously, I was running these test inside a docker image built with the databricks runtime as their base image. Java exists on said image as it is a dependency of spark and thus databricks.
Now the following fixture no longer works as Java isn't install on my machine:
@pytest.fixture(scope="session")
def spark_session() -> SparkSession:
return (
SparkSession.builder.master("local")
.appName("spark session example")
.getOrCreate()
)
Is there a way for pants to manage the setup/installation of java for this test suite?lemon-cpu-34312
02/01/2023, 1:02 AM./pants run src/python/app/run.py
Then make changes to run.py
or any of its transitive dependencies, I would expect pants to restart the run command. What am I missing here?enough-analyst-54434
02/01/2023, 1:06 AMpex_binary
target with this field set?: https://www.pantsbuild.org/docs/reference-pex_binary#coderestartablecodelemon-cpu-34312
02/01/2023, 1:07 AMenough-analyst-54434
02/01/2023, 1:07 AMenough-analyst-54434
02/01/2023, 1:09 AMlemon-cpu-34312
02/01/2023, 1:09 AM