full-window-78652
04/03/2025, 12:30 AMgooglemaps package
◦ Note: Packaging works if I remove the complete_platforms arg, but then fails if I try packaging with Dockerfile
• I installed python 3.10 with Homebrew to match pants.toml, and added the installed path to $PATH, but maybe the system version of python 3.9 is being used somehow?
• See code snippets and full error in thread
ERROR: Failed building wheel for googlemaps
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
...
python3.9/site-packages/setuptools/wheel.py", line 171, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/charset_normalizer-3.4.1.dist-info' -> '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/EGG-INFO'
[end of output]
What I tried:
• Uninstalling pants and reinstalling with the installer script
• Removing complete_platforms=[":linux_amd64_py310"] from BUILD
◦ Works but fails when I then package as Dockerfile (with or without build_platform=["linux/amd64"])
• Regenerating the JSON file for complete platforms on mac
• Killing pants process, clearing cache, running with --no-pantsd
• Upgrading to Pants v 2.25.0full-window-78652
04/03/2025, 12:31 AM# main.py
import googlemaps
# BUILD
python_sources(
name="lib",
resolve="data_eng",
)
file(
name="linux_amd64_py310",
source="linux_amd64_py310.json",
)
# 3rd party deps
pex_binary(
name="binary-deps",
entry_point="main.py",
resolve="data_eng",
layout="packed",
include_sources=False,
include_tools=True,
execution_mode="venv",
complete_platforms=[":linux_amd64_py310"],
)
# 1st party srcs
pex_binary(
name="binary-srcs",
entry_point="main.py",
resolve="data_eng",
dependencies=[":lib"],
layout="packed",
include_requirements=False,
include_tools=True,
execution_mode="venv",
)
# pants.toml
[GLOBAL]
pants_version = "2.20.0"
backend_packages = [
"pants.core",
"pants.backend.shell",
"pants.backend.python",
"pants.backend.python.lint.flake8",
"pants.backend.python.lint.black",
"pants.backend.build_files.fmt.black",
"pants.backend.google_cloud_function.python",
"pants.backend.docker",
]
pants_ignore = [
"cookiecutter/",
]
build_ignore = ["cookiecutter/"]
[python]
# The default interpreter constraints for code in this repo. Individual targets can override
# this with the `interpreter_constraints` field. See
# <https://www.pantsbuild.org/docs/python-interpreter-compatibility>.
# This can be a range, such as [">=3.8,<3.11"], but it's usually recommended to restrict
# to a single minor version.
interpreter_constraints = ["==3.10.*"]
# Enable the "resolves" mechanism, which turns on lockfiles for user code. See
# <https://www.pantsbuild.org/docs/python-third-party-dependencies>. This also adds the
# `generate-lockfiles` goal for Pants to generate the lockfile for you.
enable_resolves = true
[python.resolves]
data_eng = "data_eng.lock"
data_sci = "data_sci.lock"
[pytest]
requirements = ["ipdb"]
[docker]
tools = ["docker-credential-desktop"]
[anonymous-telemetry]
enabled = falsefull-window-78652
04/03/2025, 12:32 AM17:12:52.10 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Building 1 requirement for apps.foo.src/binary-deps.pex from the data_eng.lock resolve: googlemaps>=4.10.0' failed with exit code 1.
stdout:
stderr:
pid 31966 -> /Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/bin/python -sE /Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --use-deprecated legacy-resolver --isolated -q --cache-dir /Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache wheel --no-deps --wheel-dir /Users/<USER>/.cache/pants/named_caches/pex_root/built_wheels/sdists/googlemaps-4.10.0.tar.gz/3055fcbb1aa262a9159b589b5e6af762b10e80634ae11c59495bd44867e47d88/cp39-cp39-macosx_15_0_arm64.e3730975fd1c400eaf65ce67ccfedcc8.work /Users/<USER>/.cache/pants/named_caches/pex_root/downloads/3055fcbb1aa262a9159b589b5e6af762b10e80634ae11c59495bd44867e47d88/googlemaps-4.10.0.tar.gz --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/setup.py", line 27, in <module>
setup(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 106, in setup
_install_setup_requires(attrs)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 79, in _install_setup_requires
_fetch_build_eggs(dist)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 84, in _fetch_build_eggs
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/dist.py", line 917, in fetch_build_eggs
return _fetch_build_eggs(self, requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = self._resolve_dist(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 863, in _resolve_dist
dist = best[req.key] = env.best_match(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1133, in best_match
return self.obtain(req, installer)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1145, in obtain
return installer(requirement)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
wheel.install_as_egg(dist_location)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 117, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 125, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 171, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/charset_normalizer-3.4.1.dist-info' -> '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for googlemaps
error: subprocess-exited-with-errorfull-window-78652
04/03/2025, 12:32 AM× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/setup.py", line 27, in <module>
setup(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 106, in setup
_install_setup_requires(attrs)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 79, in _install_setup_requires
_fetch_build_eggs(dist)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 84, in _fetch_build_eggs
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/dist.py", line 917, in fetch_build_eggs
return _fetch_build_eggs(self, requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = self._resolve_dist(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 863, in _resolve_dist
dist = best[req.key] = env.best_match(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1133, in best_match
return self.obtain(req, installer)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1145, in obtain
return installer(requirement)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
wheel.install_as_egg(dist_location)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 117, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 125, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 171, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/charset_normalizer-3.4.1.dist-info' -> '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tnr_nene/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for googlemaps
ERROR: Failed to build one or more wheelsgorgeous-winter-99296
04/03/2025, 9:41 AMfull-window-78652
04/03/2025, 6:22 PMpex googlemaps . -o foo.pex
Using this structure
foo/
src/
foo/
__init__.py
main.py
pyproject.toml
with
# main.py
import googlemaps
# pyproject.toml
[project]
name = "foo"
version = "0.1.0"
description = "Example app"
requires-python = ">=3.10"
authors = [
{ name="John Smith", email="<mailto:john.smith@example.com|john.smith@example.com>" },
]gorgeous-winter-99296
04/03/2025, 6:23 PMfull-window-78652
04/03/2025, 6:35 PMpex googlemaps charset_normalizer . -o foo.pex --complete-platform "linux_amd64_py310.json"
with
foo/
src/
foo/
__init__.py
main.py
pyproject.toml
linux_amd64_py310.json
And got a different error
Failed to find compatible interpreter on path <PATH>
Examined the following interpreters:
1.) /opt/homebrew/Cellar/python@3.10/3.10.16/Frameworks/Python.framework/Versions/3.10/bin/python3.10 CPython==3.10.16
2.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6
No interpreter compatible with the requested constraints was found:
A distribution for charset-normalizer could not be resolved for /opt/homebrew/Cellar/python@3.10/3.10.16/Frameworks/Python.framework/Versions/3.10/bin/python3.10.
Found 1 distribution for charset-normalizer that does not apply:
1.) The wheel tags for charset-normalizer 3.4.1 are cp310-cp310-manylinux2014_x86_64, cp310-cp310-manylinux_2_17_x86_64 which do not match the supported tags of /opt/homebrew/Cellar/python@3.10/3.10.16/Frameworks/Python.framework/Versions/3.10/bin/python3.10:
cp310-cp310-macosx_15_0_arm64
... 541 more ...
A distribution for charset-normalizer could not be resolved for /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9.
Found 1 distribution for charset-normalizer that does not apply:
1.) The wheel tags for charset-normalizer 3.4.1 are cp310-cp310-manylinux2014_x86_64, cp310-cp310-manylinux_2_17_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9:
cp39-cp39-macosx_15_0_arm64
... 494 more ...gorgeous-winter-99296
04/03/2025, 6:41 PMfull-window-78652
04/03/2025, 6:51 PMpip install pex && pex3 interpreter inspect --markers --tags --indent=2
Running the pex command using the mac JSON file does work, but the pants packaging fails
For what it's worth, we are able to use that linux JSON file to package a different app with Pants on mac, but that app doesn't use the googlemaps packagehappy-kitchen-89482
04/03/2025, 9:03 PM--keep-sandboxes=on_failure, which will print the location of the failing sandbox to the console, and then you can cd to that dir and run __run.sh to execute the failing command outside of pantshappy-kitchen-89482
04/03/2025, 9:03 PMpex command that should fail independently of Pants, so we can keep digging from therehappy-kitchen-89482
04/03/2025, 9:11 PM--use-pep517 passed to pip (see here for similar error on a different package (and you can find other such examples by googling)happy-kitchen-89482
04/03/2025, 9:12 PM[pex-cli]
global_args = ["--use-pep517"]full-window-78652
04/03/2025, 9:13 PMPt. 1
pid 36436 -> /Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/bin/python -sE /Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --use-deprecated legacy-resolver --isolated -q --cache-dir /Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache wheel --no-deps --wheel-dir /Users/<USER>/.cache/pants/named_caches/pex_root/built_wheels/sdists/googlemaps-4.10.0.tar.gz/3055fcbb1aa262a9159b589b5e6af762b10e80634ae11c59495bd44867e47d88/cp39-cp39-macosx_15_0_arm64.963bf5e966f74403b8689e8806e3a4bd.work /Users/<USER>/.cache/pants/named_caches/pex_root/downloads/3055fcbb1aa262a9159b589b5e6af762b10e80634ae11c59495bd44867e47d88/googlemaps-4.10.0.tar.gz --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/setup.py", line 27, in <module>
setup(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 106, in setup
_install_setup_requires(attrs)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 79, in _install_setup_requires
_fetch_build_eggs(dist)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 84, in _fetch_build_eggs
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/dist.py", line 917, in fetch_build_eggs
return _fetch_build_eggs(self, requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = self._resolve_dist(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 863, in _resolve_dist
dist = best[req.key] = env.best_match(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1133, in best_match
return self.obtain(req, installer)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1145, in obtain
return installer(requirement)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
wheel.install_as_egg(dist_location)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 117, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 125, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 171, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/charset_normalizer-3.4.1.dist-info' -> '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for googlemaps
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [42 lines of output]full-window-78652
04/03/2025, 9:13 PM/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/setup.py", line 27, in <module>
setup(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 106, in setup
_install_setup_requires(attrs)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 79, in _install_setup_requires
_fetch_build_eggs(dist)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/__init__.py", line 84, in _fetch_build_eggs
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/dist.py", line 917, in fetch_build_eggs
return _fetch_build_eggs(self, requires)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = self._resolve_dist(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 863, in _resolve_dist
dist = best[req.key] = env.best_match(
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1133, in best_match
return self.obtain(req, installer)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1145, in obtain
return installer(requirement)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
wheel.install_as_egg(dist_location)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 117, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 125, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/39582e4dc3636270136e41c3bb04a860786f11e7/d7b3bc4b051cc2b1818cb2bbbcecce19841bf5e8/lib/python3.9/site-packages/setuptools/wheel.py", line 171, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/charset_normalizer-3.4.1.dist-info' -> '/Users/<USER>/.cache/pants/named_caches/pex_root/pip/23.1.2/pip_cache/.tmp/pip-req-build-tfjntdqn/.eggs/charset_normalizer-3.4.1-py3.9-macosx-11.0-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for googlemaps
ERROR: Failed to build one or more wheelsfull-window-78652
04/03/2025, 9:16 PM14:14:30.66 [ERROR] Invalid option 'global_args' under [pex-cli] in /Users/<USER>/repos/test/pants_ex/pants.toml
14:14:30.66 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)full-window-78652
04/03/2025, 9:20 PMfull-window-78652
04/03/2025, 9:22 PM--use-pep517 arg and upgrading to Pants 2.25.0, trying to now package with Dockerfull-window-78652
04/03/2025, 9:57 PM2.24.0 some change was introduced that causes pants package apps/foo:: to fail with this error.
a. Q: Is there something I need to add to pants.toml or BUILD file(s)?
b. Note: I searched the web, Pants slack, and release notes and didn't find any related info
Engine traceback:
in `package` goal
IntrinsicError: Not a directory (os error 20)
2. Switching to Pants v 2.24.0 also breaks packaging for other apps and some of our first-party libraries with this error.
• Q: Any suggestions?
ProcessExecutionFailure: Process 'Run setuptools.build_meta:__legacy__ for libs/example2:example2' failed with exit code 1.
stdout:
...
File "/Users/<USER>/.cache/pants/named_caches/pex_root/venvs/0/cea6a7d081812869e89fb27414e0dea69c936e06/878274da9144f8b1bd08f09cb4d1d348a8b20e6a/lib/python3.10/site-packages/setuptools/_vendor/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '=0.1.0'
Updated config that works for packaging (Pex + Docker)
# pants.toml
[GLOBAL]
pants_version = "2.23.0"
...
[pex-cli]
global_args = ["--use-pep517"]
# foo/BUILD
docker_image(
name="foo",
source="Dockerfile",
build_platform=["linux/arm64"],
)
# foo/src/BUILD
...
pex_binary(
...
complete_platforms=[":linux_arm64_py310"],
)
with this structure
apps/
foo/
BUILD
Dockerfile
pyproject.toml
src/
__init__.py
main.py
# NOTE: Had to switch to this JSON file
# because the OSX JSON file I used above
# for Pex packaging didn't work with Docker
linux_arm64_py310.json