great-leather-68110
10/10/2025, 12:16 PMrequirements_pyarrow.txt with a single entry awswrangler==3.12.1 results in the following error when running `pants generate-lockfiles --resolve=python-pyarrow`:
pip: ERROR: Cannot install awswrangler==3.12.1 because these package versions have conflicting dependencies.
pip: ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts>
pip:
pip: The conflict is caused by:
pip: awswrangler 3.12.1 depends on pyarrow<18.0.0 and >=8.0.0; sys_platform == "darwin" and platform_machine == "x86_64"
pip: awswrangler 3.12.1 depends on pyarrow<21.0.0 and >=18.0.0; sys_platform != "darwin" or platform_machine != "x86_64"great-leather-68110
10/10/2025, 12:20 PMpex3 lock create \
--style strict \
--complete-platform 3rdparty/platforms/manylinux_2_28_aarch64.json \
--complete-platform 3rdparty/platforms/macosx_26_0_arm64.json \
-r 3rdparty/python/requirements_pyarrow.txt \
-o python-pyarrow.lock
Then reuse the lockfile with setting python-pyarrow = "python-pyarrow.lock" in pants.toml and resolves_generate_lockfiles = false. I can then use the resolve as usual.
The problem with this approach is that I still need to define the requirements in a BUILD file:
python_requirements(
name="pyarrow",
source="requirements_pyarrow.txt",
resolve="python-pyarrow",
)
And then run the pex command manually every time something changes in the requirements.great-leather-68110
10/10/2025, 12:21 PMrequirements_pyarrow.txt twice (in the pex command and in the BUILD file) and can't use the pants generate-lockfiles commandgreat-leather-68110
10/15/2025, 7:48 AMbrief-scientist-13682
10/15/2025, 5:09 PMpython -mpex.cli lock create \
--pip-version latest-compatible \
--style universal \
--target-system linux \
--target-system mac \
--interpreter-constraint "==3.11.*" \
awswrangler==3.12.1 \
'pyarrow<18,>=8; sys_platform == "darwin" and platform_machine == "x86_64"' \
'pyarrow<21,>=18; sys_platform != "darwin" or platform_machine != "x86_64"' \
--indent 2 -o lock.json \
--pip-log pip.log \
--elide-unused-requires-dist
In other words, the universal lock splitting referenced in https://pantsbuild.slack.com/archives/C046T6T9U/p1760360455443789 will also work for any top-level requirements that split the lock (that currently works today except for the platform_machine marker needed in your case). Here I elevated the conflict error you received to top-level requirements to let Pex know to split the universal lock resolve. I assume you could do the same in Pants by declaring those two dependencies at top-level with a comment indicating why you're doing this even though you have no direct dependency on pyarrow (presumably).
I expect to release Pex with that fix for universal lock splitting by end of week.
All that said, Pants supporting non-universal locks would be great. I still think universal locks are generally a bad idea despite the ~wide ecosystem support in poetry, pdm, uv, ... etc.great-leather-68110
10/16/2025, 12:06 PMtarget_system or, say, platform_machine. So your fix isn’t blocking, and kudos for developing Pex! I’ll explore the options for passing platforms during Pants lockfile generation.brief-scientist-13682
10/21/2025, 4:12 AMgreat-leather-68110
10/23/2025, 7:50 PMgreat-leather-68110
11/25/2025, 10:53 AM