ripe-gigabyte-88964
01/18/2024, 1:46 PMripe-gigabyte-88964
01/19/2024, 4:59 PMfresh-mechanic-68429
01/22/2024, 5:05 PMfresh-mechanic-68429
01/23/2024, 5:04 AMEnvironmentVarsRequest
env_vars = await Get(EnvironmentVars, EnvironmentVarsRequest(("HOME",)))
process_request = Process(
...
env = {
"HOME": env_vars.get("HOME"),
},
)
result = await Get(FallibleProcessResult, Process, process_request)
But while testing under pants, this env var wasn’t available by default (unknown to me) and the test just kinda hung forever? The little spinner just keeps going and going
Eventually I figured out I needed to add the var to the pants toml
[test]
extra_env_vars = [
"HOME"
]
Or change the get to "HOME": env_vars.get("HOME", ""),
Is there somewhere else I should’ve been checking for logs? I tried setting the log level like this but didn’t see anything extra
rule_runner.set_options(
["-ltrace"],
env_inherit={"PATH", "HOME"},
)
careful-address-89803
01/29/2024, 7:45 AMexport
goal in a plugin? I'm trying to do that for Terraform, and I think some changes to core Pants might be needed. If there are existing implementations, I'd like to see them; and if there aren't, well, I won't break anyone's implementations by changing things ;)ambitious-actor-36781
01/29/2024, 7:59 AMsquare-psychiatrist-19087
01/30/2024, 4:12 PMpantsbuild-pants 2.19.0 depends on typing-extensions==4.3.0
pydantic 2.5.3 depends on typing-extensions>=4.6.1
Is there any reason why the typing-extensions version is pinned? can we set it to typing-extensions~=4.3
?square-psychiatrist-19087
02/03/2024, 10:46 PMunittest.mock.patch
for rules?gorgeous-winter-99296
02/04/2024, 10:44 PM@union(in_scope_types=[EnvironmentName])
but I can't run Pants at all now due to rule graph errors:
No installed rules return the type HostKubeconfigRequest, and it was not provided by potential callers of @rule(pants_backend_k8s.util.kubeconfig:166:get_kubeconfig_file(HostKubeconfigRequest) -> KubeconfigResponse, gets=[Get(ConfigurationFileResponse, [ConfigurationFileRequest])]).
Which is true, it's created implicitly in helper rule which converts target -> request via the union. This pattern is something I use in lots of places, but for some reason it fails here. If I hardcode the one call site where this request could show up to use this variant the graph works, so something is wrong with the union... I just don't know what. I.e, Get(KubeconfigResponse, KubeconfigRequest, kubeconfig_request.request)
is broken, but Get(KubeconfigResponse, HostKubeconfigRequest, kubeconfig_request.request)
is fine.gorgeous-winter-99296
02/04/2024, 10:44 PMUnionRule
declarations in place. What did I miss?fresh-mechanic-68429
02/05/2024, 7:44 PM--debug
support for our test target (working on a dotnet plugin), and for whatever reason I’m unable to successfully attach to the process from my IDEs. Its unclear to me if this is being caused by the sandboxing or notfresh-mechanic-68429
02/09/2024, 3:14 AMRunRequest
/`RunInSandboxRequest` ?
The program I’m trying to run (via the run goal) is sensitive to its working directory, which I want to define relative to the chroot. My current workaround is to include a shell script in the chroot to change the directory, but it feels suboptimalfresh-mechanic-68429
02/21/2024, 3:46 PM-ldebug
, --logdir
and --keep-sandboxes=always
via rule_runner.set_options
but haven’t actually been able to find the logsmodern-smartphone-82928
02/22/2024, 2:23 AMfresh-mechanic-68429
02/22/2024, 3:06 AMexecution_slot_variable
and I guess I could calculate an “offset” in the exposed ports. This may work but isn’t particularly other people, and doesn’t guarantee the port will be available. Is there any api available to act as a mutex? (so I could take/wait on a lock on the requested port)
Alternatively, is there a way to limit pants concurrency at the rule level? I saw Process.concurrency_available
but its missing a doc string how it should be used or what effect it has. I don’t really want to set the global concurrency to 1 using the global process_execution_local_parallelism
flagrich-london-74860
02/27/2024, 7:00 PMpdb
, the debugger in VSCode, or pycharm) with a plug-in?fresh-mechanic-68429
02/29/2024, 2:26 AMProcessCacheScope.PER_SESSION
Rule A -> package install into named cache
Rule B (depends on A) -> reads from named cacheflat-spoon-77530
03/03/2024, 8:10 AMripe-gigabyte-88964
03/06/2024, 7:54 PMfresh-continent-76371
03/09/2024, 10:22 AMread_file_contents(<path/in/repo>)
plugin or target extension .. Such that this is possible.
scala_artifact(
group="org.typelevel",
artifact="cats-core",
version=read_file_contents("VERSION"),
packages=["cats.**"],
)
docker_image(
name="demo",
repository="example/demo",
image_tags=[read_file_contents("VERSION"), "example"]
)
python_distribution(
name="mydist",
dependencies=[
# Dependencies on code to be packaged into the distribution.
],
provides=python_artifact(
name="mydist",
version=read_file_contents("VERSION"),
),
wheel_config_settings={"--global-option": ["--python-tag", "py37.py38.py39"]},
)
what type of plugin, or target am i needing to create - and is there something similar - parametrize
almost feels similar, but it is generating new targets (replacing the original I assume)fresh-continent-76371
03/09/2024, 7:52 PMpantsbuild.pants
pypi, is 2.17.1
Is it possible to have this updated ?dry-orange-3870
03/14/2024, 4:18 PMtest
) if file changes are detected, it automatically cancels and restarts the rules or goal_rule.
We have a repo with some custom plugins and an assortment of goal_rule
and rule
functions. Some of these involve running a bunch of operations using Pants, and then making an API call to an external service. We commonly run into situations where these external API calls / side-effecting operations happen twice. Based on what I see in the pants logs, it looks like notify invalidation
is just slow to catch up with the filesystem; this is common when merging with main
and then immediately running one of our custom pants goals.
How can I work around this? Is there some way I can tag the `rule`s themselves to tell Pants that it should fail them instead of re-running them when a file system change is detected?
EDIT: we're currently on 2.18.0
, but could likely upgrade without too much hasslefresh-mechanic-68429
03/22/2024, 1:30 AMmodern-london-16641
03/22/2024, 5:46 PMrun
rule that requests a publish
before running a command? and if so, is there an example? Context in threadnarrow-vegetable-37489
03/27/2024, 4:41 PMERROR: Cannot install foobar-plugin==0.1.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts>
The conflict is caused by:
foobar-plugin 0.1.0 depends on pantsbuild.pants==2.21.0.dev1
The user requested (constraint) pantsbuild-pants==2.21.0.dev1
The pantsbuild.pants==2.21.0.dev1
requirement on my plugin is added by python_distribution()
and seems to come from the fact that I have a pants_requirements(name="pants")
in my plugin repository’s BUILD file. If I remove pants_requirements()
and publish a new version I can install the plugin just fine since python_distribution()
no longer adds that dependency, but then developing the plugin gets problematic instead since I can’t run mypy or my tests locally (unless added again temporarily) or in CI.
Any ideas? I assume if pantsbuild.pants
and pantsbuild-pants
weren’t different it would work in this case since the versions are the same, but preferably my plugin shouldn’t be tied to one exact Pants version - so I’d rather not have the dependency at all. I guess I could perhaps ignore :pants
as a dependency on my python_sources()
explicitly, if that’s what python_distribution()
bases the dependency list on.rhythmic-morning-87313
04/04/2024, 6:45 PMpkgutil.ImpImporter
.
Could somebody help me to make my pants & setupgen plugin to use a more recent version of setuptools?
> pants --tag="wheel" package src/ai/backend/manager::
03:28:47.81 [INFO] Initializing scheduler...
03:28:50.82 [INFO] Scheduler initialized.
...
03:28:53.52 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Run setuptools.build_meta:__legacy__ for src/ai/backend/manager:dist' failed with exit code 1.
stdout:
stderr:
Traceback (most recent call last):
File "/tmp/bai-edge-MIARjAJAf4jpNbTN-pants/pants-sandbox-xT6MSI/chroot/../.cache/pex_root/venvs/20d1a575d196d07d994ae38dc2077e2bd23a933c/12bdfbbbf401f710ce88941330fde74cd65f6c1c/pex", line 311, in <module>
exec(ast, globals_map, locals_map)
File "backend_shim.py", line 6, in <module>
import setuptools.build_meta
File "/home/joongi/.cache/pants/named_caches/pex_root/venvs/s/d42a92f1/venv/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/home/joongi/.cache/pants/named_caches/pex_root/venvs/s/d42a92f1/venv/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/home/joongi/.cache/pants/named_caches/pex_root/venvs/s/d42a92f1/venv/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2191, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
aloof-airline-74337
04/16/2024, 1:10 AMaloof-airline-74337
04/17/2024, 6:51 PMfresh-cat-90827
04/18/2024, 2:58 PMfiles
target generator and have issues with the caching 🧵white-glass-5635
04/19/2024, 6:36 PM