Skip to content

Migrate from pyenv to uv #1995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Migrate from pyenv to uv #1995

wants to merge 4 commits into from

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Mar 11, 2025

This migrates the python workflow from pyenv to the fast modern rust based uv.

The only takeaway is that the pypy versions you can install from uv doesn't seem to work well with the "bitarray" dependency we have, as it fails to compile for me on linux. So i had to remove pypy python.

I also tried to update python to 3.13.2 but cairo-run doesnt work well, however cairo-compile does work well. In the end i kept the old python version 3.9

@edg-l edg-l marked this pull request as ready for review March 11, 2025 10:28
@edg-l
Copy link
Member Author

edg-l commented Mar 11, 2025

The non-required ci workflow Benchmark Hyper Threading / benchmark (pull_request) fails because main doesnt use uv yet

@edg-l edg-l force-pushed the modernize_python branch from e4e95e9 to fb610db Compare March 11, 2025 10:38
Copy link

github-actions bot commented Mar 11, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.127 ± 0.017 2.110 2.153 1.01 ± 0.01
head big_factorial 2.116 ± 0.008 2.106 2.131 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.072 ± 0.015 2.054 2.104 1.00 ± 0.01
head big_fibonacci 2.064 ± 0.021 2.044 2.109 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.825 ± 0.139 7.699 8.186 1.00
head blake2s_integration_benchmark 7.846 ± 0.192 7.677 8.356 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.184 ± 0.012 2.165 2.202 1.00
head compare_arrays_200000 2.187 ± 0.021 2.161 2.224 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.433 ± 0.009 1.423 1.448 1.00
head dict_integration_benchmark 1.437 ± 0.008 1.426 1.450 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.226 ± 0.009 1.212 1.239 1.00
head field_arithmetic_get_square_benchmark 1.229 ± 0.010 1.216 1.249 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.819 ± 0.061 7.699 7.880 1.01 ± 0.01
head integration_builtins 7.743 ± 0.063 7.697 7.868 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.029 ± 0.058 7.957 8.149 1.00
head keccak_integration_benchmark 8.066 ± 0.147 7.962 8.453 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.167 ± 0.017 2.148 2.197 1.00
head linear_search 2.170 ± 0.028 2.144 2.241 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.499 ± 0.007 1.490 1.509 1.00
head math_cmp_and_pow_integration_benchmark 1.524 ± 0.009 1.508 1.542 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.466 ± 0.017 1.446 1.499 1.00
head math_integration_benchmark 1.471 ± 0.012 1.460 1.502 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.206 ± 0.009 1.198 1.226 1.00
head memory_integration_benchmark 1.208 ± 0.005 1.201 1.218 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.570 ± 0.008 1.557 1.582 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.568 ± 0.005 1.560 1.575 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 532.5 ± 2.5 530.5 537.1 1.00
head pedersen 533.8 ± 2.6 530.8 538.5 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 624.5 ± 5.8 615.1 632.3 1.00 ± 0.01
head poseidon_integration_benchmark 623.1 ± 6.3 615.2 632.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.853 ± 0.011 1.840 1.871 1.00
head secp_integration_benchmark 1.866 ± 0.013 1.853 1.887 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 626.0 ± 2.0 624.1 631.1 1.00
head set_integration_benchmark 629.5 ± 4.5 625.2 636.4 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.261 ± 0.042 4.212 4.340 1.00
head uint256_integration_benchmark 4.284 ± 0.059 4.229 4.430 1.01 ± 0.02

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.53%. Comparing base (5c56712) to head (54f5242).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1995   +/-   ##
=======================================
  Coverage   96.53%   96.53%           
=======================================
  Files         103      103           
  Lines       42619    42619           
=======================================
  Hits        41142    41142           
  Misses       1477     1477           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gabrielbosio
Copy link
Collaborator

@edg-l I would consider to keep pyenv for now as an alternative if uv is not installed (I'm following #1754 as a reference). We can print a message with something like pyenv is deprecated if that's the case.

@yuvalsw yuvalsw removed their request for review April 10, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants