wide-midnight-78598
07/29/2024, 12:26 AMgenerate-lockfiles sample repo where I can run that command, and then run a package or test or something to confirm it works? My available repos are small to mid-sized deps, and I can't tell whether my modifications are good on larger sized reposbroad-processor-92400
07/29/2024, 12:55 AMwide-midnight-78598
07/29/2024, 1:04 AMbroad-processor-92400
07/29/2024, 1:05 AMwide-midnight-78598
07/29/2024, 1:11 AMwide-midnight-78598
07/29/2024, 1:12 AMwide-midnight-78598
07/29/2024, 1:59 AMpants call, but it may not be a perfect 1:1 of what's happening in pants):
pex3 lock create \
--no-emit-warnings \
--output baseline-3.12.json \
--pip-version "24.1.2" \
--resolver-version pip-2020-resolver \
--style universal \
--target-system linux \
--target-system mac \
--indent 2 \
--manylinux manylinux2014 \
--interpreter-constraint "CPython==3.12.*" \
fastapi numpy pandas pydantic scipy sqlalchemy uvicorn
So.... This is one of those things that seems obvious when I run the test, but it's definitely never top of mind while trying to help people with these problems - because Pants kinda magicks it all away. I'm not sure if the results make sense from a pex point of view, but intuitively, I would assume that broader interpreter-constraints would take more time to resolve 🤷
Cold run 3.12.*: 0m18.203s
No-op run 3.12.*: 0m6.207s
Cold run 3.12.4: 0m15.587s
No-op run 3.12.4: 0m3.531s
Cold run >=3.9,<3.13: 0m48.746s
No-op run >=3.9,<3.13: 0m37.877swide-midnight-78598
07/29/2024, 2:02 AMbitter-ability-32190
07/29/2024, 10:50 AMproud-dentist-22844
07/29/2024, 3:17 PMst2 resolve. That takes quite a while to generate.
Now however that it is on an older pants version. I've got a WIP PR to upgrade that: https://github.com/StackStorm/st2/pull/6200
You might want to use that branch, as there will be fewer changes you need to make there.proud-dentist-22844
07/29/2024, 3:18 PMbitter-ability-32190
07/29/2024, 3:20 PMproud-dentist-22844
07/29/2024, 3:21 PMbitter-ability-32190
07/29/2024, 3:22 PMproud-dentist-22844
07/29/2024, 3:23 PMproud-dentist-22844
07/29/2024, 3:49 PMwide-midnight-78598
07/29/2024, 3:52 PMbitter-ability-32190
07/29/2024, 3:57 PMbitter-ability-32190
07/29/2024, 3:57 PMproud-dentist-22844
07/29/2024, 6:08 PMreal 4m11.051s
user 0m0.009s
sys 0m0.014scurved-manchester-66006
07/29/2024, 6:28 PMbitter-ability-32190
07/29/2024, 6:29 PMcurved-manchester-66006
07/29/2024, 7:30 PM[python.resolves_to_only_binary]
default = [":all:"]
internally. Perf impact is unclear but that won't work without access to all the wheels we built.)wide-midnight-78598
07/29/2024, 7:36 PMproud-dentist-22844
07/29/2024, 7:38 PMCPython>=3.8,<3.10 are the constraints.wide-midnight-78598
07/29/2024, 7:40 PMCPython==3.9.19 or whatever, would your lockfiles generate? I'd be curious if they're faster.
I'll try to grab that later, just stuck on some terribly boring iOS development that, if I leave it now, I'll never get back to it 😆wide-midnight-78598
07/29/2024, 7:58 PMI've ripped out enough references to our internal cheese shop and various forks that this should be runnable. It takes around 15-30 minutes.Yeah, this bombs out for me on pyspark. I am getting a nice appreciation of what people might be going through while debugging - this is infuriating
proud-dentist-22844
07/29/2024, 8:04 PMreal 1m22.849s
user 0m0.541s
sys 0m0.040spowerful-scooter-95162
07/30/2024, 6:16 PMwide-midnight-78598
07/30/2024, 6:56 PMwide-midnight-78598
07/30/2024, 7:10 PM[python]
...
pip_version = "24.2"
[pex-cli]
version = "v2.13.0"
known_versions = [
"v2.13.0|macos_arm64|dba08dde901cfbc43176a7d99414c7c58a3eeaa41743d2abbdf41a58d1d5ead9|4190750",
"v2.13.0|macos_x86_64|dba08dde901cfbc43176a7d99414c7c58a3eeaa41743d2abbdf41a58d1d5ead9|4190750",
"v2.13.0|linux_x86_64|dba08dde901cfbc43176a7d99414c7c58a3eeaa41743d2abbdf41a58d1d5ead9|4190750",
"v2.13.0|linux_arm64|dba08dde901cfbc43176a7d99414c7c58a3eeaa41743d2abbdf41a58d1d5ead9|4190750"
]powerful-scooter-95162
07/30/2024, 7:10 PMwide-midnight-78598
07/30/2024, 7:12 PMwide-midnight-78598
07/30/2024, 7:14 PMuv crushed that uv pip install - took like 20 secondsbitter-ability-32190
07/30/2024, 7:17 PMuv isn't doing anything magical. There HAS to be a reason why 🙂powerful-scooter-95162
07/30/2024, 7:17 PMwide-midnight-78598
07/30/2024, 7:19 PMuv is wildly parallel, pip doesn't seem to be (only 1 core on my machine was 100% during a pip install --report --dry-run --ignore-installed )
And pip seemed to just fall over on the dependency resolver
"INFO: pip is still looking at multiple versions of prefect-aws to determine which version is compatible with other requirements. This could take a while."
Now... What uv did here 🤷
Are the two sets of installs identical? 🤷
But, man was that good dev experienvecwide-midnight-78598
07/30/2024, 7:20 PMpowerful-scooter-95162
07/30/2024, 7:22 PMwide-midnight-78598
07/30/2024, 7:23 PMpowerful-scooter-95162
07/30/2024, 7:24 PMwide-midnight-78598
07/30/2024, 7:24 PMI see that it is possible to use uv for resolution to concrete versions and produce a requirements.txt that is unambiguous; that could be an easy way to capture uv's speedThere is a pants and pex ticket for some of this. https://github.com/pex-tool/pex/issues/2371 For me, feels like we might end up in a Vite situation, where we use one fast path for dev, one slower path for production 😆
wide-midnight-78598
07/30/2024, 7:24 PMuv has the trick where you only download partial pieces of the packagesRange requests?
powerful-scooter-95162
07/30/2024, 7:24 PMwide-midnight-78598
07/30/2024, 7:26 PM--use-feature fast-deps or some other flag enabled that for pip as well. It looks like there is some juicy perf improvements coming down from some of the pip tickets I've been reading, but I don't know timing. I think one specifically to help with metadata.
Re: using uv instead of (or within) pex, I think that needs some practical research into what it means, backwards compat, etc. I haven't looked into any of uv's lockfiles yet - as most of my time the past few weeks has been the time between meetings during the daypowerful-scooter-95162
07/30/2024, 7:39 PMshell_command(
name="uv_shell",
command=(
"uv pip compile <http://requirements.in|requirements.in> -o requirements.txt"
),
tools=["uv"],
)
adhoc_tool(
name="run_uv",
runnable=":uv_shell",
args=[""],
execution_dependencies=["<http://requirements.in|requirements.in>"],
output_files=["requirements.txt"],
)wide-midnight-78598
07/30/2024, 8:12 PMwide-midnight-78598
07/30/2024, 8:26 PMI couldn't quite put it together in the 10 minutes I gave it, but I was thinking of something like thisYeah, this is an interesting idea - I just did it, and the subsequent pip install was pretty quick (comparatively, obviously)
powerful-scooter-95162
07/30/2024, 8:33 PMwide-midnight-78598
07/30/2024, 8:41 PMwide-midnight-78598
07/30/2024, 8:55 PMuv pip compile requirements.in | grep -v "#" > requirements.txt
parallel -a requirements.txt -j12 pip installcurved-manchester-66006
07/30/2024, 9:45 PMwide-midnight-78598
07/30/2024, 9:46 PMcurved-manchester-66006
07/30/2024, 9:47 PMYeah, this bombs out for me on pyspark.The dep I have listed is just a bare
pyspark, (yolo!) so I'm not sure what you would be bombing out on therewide-midnight-78598
07/30/2024, 9:50 PMuv into pants/pex, or waiting on some upcoming pip improvements to trickle down, and then maybe some pex changes to support a different resolves, or pip install --report or something (not saying that would be a panacea, as it might have some quirks of its own when generating the lockfile)wide-midnight-78598
07/30/2024, 9:51 PMcurved-manchester-66006
07/30/2024, 9:58 PMpowerful-scooter-95162
07/30/2024, 10:53 PMwide-midnight-78598
07/31/2024, 12:07 AMwide-midnight-78598
07/31/2024, 12:21 AMfile(
name="requirements",
source="<http://requirements.in|requirements.in>",
)
system_binary(
name="uv",
binary_name="uv",
fingerprint_args=["--version"],
)
run_shell_command(
name="lock",
command="uv pip compile <http://requirements.in|requirements.in> -o didthiswork.txt",
runnable_dependencies=[":uv"],
execution_dependencies=[":requirements"],
)wide-midnight-78598
07/31/2024, 12:22 AMpants run :lock followed by generate-lockfiles?wide-midnight-78598
07/31/2024, 12:23 AMexecution_dependenciespowerful-scooter-95162
07/31/2024, 12:23 AMpowerful-scooter-95162
07/31/2024, 12:24 AMwide-midnight-78598
07/31/2024, 12:25 AMpowerful-scooter-95162
07/31/2024, 2:11 AM