bored-art-40741
02/08/2016, 2:06 AMbored-art-40741
02/08/2016, 2:25 AMgit clean -fdx
could fail: http://jenkins.pantsbuild.org/job/pants_ci.unit_tests/77/SHARD=1/consolebored-art-40741
02/08/2016, 2:51 AMbored-art-40741
02/08/2016, 2:51 AMbored-art-40741
02/08/2016, 2:51 AMbored-art-40741
02/08/2016, 3:27 AMbored-art-40741
02/08/2016, 3:28 AMancient-stone-50795
02/08/2016, 3:32 AMbored-art-40741
02/08/2016, 3:39 AMbored-art-40741
02/08/2016, 3:39 AMbored-art-40741
02/08/2016, 3:40 AMbored-art-40741
02/08/2016, 3:50 AMbored-art-40741
02/08/2016, 3:50 AMsrc/docs/setup_repo.md
bored-art-40741
02/08/2016, 3:50 AMbored-art-40741
02/08/2016, 3:51 AMwide-energy-11069
02/08/2016, 5:50 AMcurved-manchester-66006
02/08/2016, 5:00 PMdata = open(os.path.join(os.path.dirname(sys.modules[__name__].__file__), 'resources/dmidecode-basic'), 'rb').read()
data = pkgutil.get_data(__name__, 'resources/dmidecode-basic')
but only the first one is working for me. I have
python_tests(
name='test_intake',
sources=globs('test_intake.py'),
dependencies=[
],
resource_targets=[
':resources',
],
)
resources(
name='resources',
sources=globs('resources/*'),
)
curved-manchester-66006
02/08/2016, 5:02 PMNone
, which get_data does in 3-4 casesfancy-queen-20734
02/08/2016, 5:34 PMcurved-computer-88379
07/12/2023, 7:22 PMsrc/
and projects/
where src/
contains source code and projects
contain individual projects that may or may not source from src
. I was thinking that each project either builds an image from the Dockerfile within the project directory, or from the root directory base Dockerfile
that will likely be compatible across multiple projects.
What are some steps I should take to integrate python builds / services that are currently deployed in production using docker, but integrating pants so I can source shared code (versioned) across projects.
Example: Say I update the shared code ~/src/utils.py
from version 0.1 to 0.2, but I don’t want to have to worry about maintaining project_1 once it’s been deployed (e.g. if utils
version 0.2 breaks project_1, so project_1 requires utils version 0.1)
For example
project_1:
run.py <- sources from /app/src/utils.py version 0.1
Dockerfile
requirements.txt
...
project_2:
run.py <- requires /app/src/utils.py version 0.2 since utils.py was updated
Dockerfile
requirements.txt
...
powerful-scooter-95162
07/13/2023, 12:32 AMtorch = {version="2.0.1", file = "<https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp311-cp311-linux_x86_64.whl>", platform_system = "== 'Linux'", platform_python_implementation = "== 'CPython'", platform_machine = "== 'x86_64'", python_version = "== '3.11'"}
And that is sufficient for pipenv to generate a lockfile, however when I run
pants generate-lockfiles
I get this error:
ERROR: No matching distribution found for torch==2.0.1+cu118
Which seems to imply pants is trying to find the dep on pypi (where it is not available), rather than using the specified wheel. I also tried setting version="2.0.1+cu118" in my Pipfile, but that did not help.melodic-lighter-17242
07/13/2023, 7:46 AMpants --no-pantsd --no-watch-filesystem --changed-dependents=transitive --changed-since=<commit-sha> publish
I have two packages, X and Y, where X consumes Y (python_sources()
of Y is declared as a dependency in the python_sources()
of X).
I also have a custom plugin that intercepts usages of python_artifact
(as part of python_distribution
)
When I run the command, although only X changed, I see my plugin runs on both X and Y.
Is that intentional? (I think the package
step runs on both, while publish
only runs on X)
Thanks!!acoustic-library-86413
07/13/2023, 7:54 AMpants test ::
?
I have one project whose tests I don't have time to refactor for the time being. Setting batch_compatibility_tag
on the tests does not solve the problem, but running them with --debug
does.
The issue is that they re-use a service running in a Docker container. I can't dynamically change the environment variable used inside the container in order to facilitate usage of PANTS_EXECUTION_SLOT, and as a result I need them to run as if I ran pytest
normally.melodic-exabyte-60253
07/13/2023, 10:10 AMmodern-manchester-33562
07/13/2023, 3:18 PMpants.toml
we can configure resolves_to_no_binary
and resolves_to_only_binary
. This is great, but I'm not getting my particular use case to work. Let's say I generally want only binaries to be resolved but in the rare cases of that there is no binary, then and only then, I want to allow sources. Unfortunately, setting the following didn't work:
[python.resolves_to_only_binary]
__default__ = [":all:"]
[python.resolves_to_no_binary]
__default__ = ["stringcase"]
Is this possible at all?late-keyboard-89314
07/13/2023, 4:03 PMpants package
I get the following out of the subprocess stderr:
ERROR: use `docker --context=default buildx` to switch to context "default"
I’m not seeing much in the pants log that looks weird, and a cursory google search suggests that this problem is normally related to the DOCKER_HOST
or DOCKER_CONTEXT
env vars.
I’m using pants v.216.0, and docker desktop on OSX; v4.21.1 (docker engine 24.0.2). Here’s a -ldebug
full output: https://gist.github.com/jcrumb-u21/b2836d74bd70d551f0b06ee90e2aaf19 and my full Dockerfile: https://gist.github.com/jcrumb-u21/dd907855b89fa6730e55fb27f829d1f4. I can see that the dependency inference is working and my Go binary is being built at least which is pretty sweet!average-breakfast-91545
07/13/2023, 5:13 PMbland-lion-5427
07/13/2023, 6:57 PM$ ./pants test.pytest src/test/python::
New python executable in /Users/bmahler/.cache/pants/setup/bootstrap-Darwin-arm64/pants.95cc9e/install/bin/python2.7
Also creating executable in /Users/bmahler/.cache/pants/setup/bootstrap-Darwin-arm64/pants.95cc9e/install/bin/python
Installing setuptools, pip, wheel...done.
Looking in links: <redacted>, <redacted>
Collecting pantsbuild.pants==1.30.4
Downloading <redacted>/pantsbuild.pants-1.30.4.tar.gz (4.8MB)
100% |████████████████████████████████| 4.8MB 8.4MB/s
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/hj/4zbxnmpd4nx174gsg9ly4lpr0000gn/T/pip-install-6nrE5f/pantsbuild.pants/setup.py'
purple-plastic-57801
07/14/2023, 1:54 AMpowerful-eye-58407
07/14/2023, 7:29 AMpants tests path/to/tests::
with BUILD file for tests containing env variables like SERVICE_HOST=hostname
that are read by tests and used to connected to tested service run by compose.
Now, those component tests work in docker_environment, which means they are run in docker container with network mode set to bridge by default probably? On Mac, using docker desktop, it's enough to set SERVICE_HOST=host.docker.internal
to make the connection work. On linux, I need to pass custom option "--add-host=host.docker.internal:host-gateway"
to docker run. There's pants.toml docker.run_args section, but it looks like this is only used when I do pants run path/to/docker_target
and not when running environments?