Skip to content
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

Switch to uv #6499

Merged
merged 18 commits into from
Feb 22, 2024
Merged

Switch to uv #6499

merged 18 commits into from
Feb 22, 2024

Conversation

matmair
Copy link
Member

@matmair matmair commented Feb 15, 2024

Uv, a new tool by the creators of ruff could speed up the pre-commit step considerably

Copy link

netlify bot commented Feb 15, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 01b0753
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/65d7c7f93ab3b40008772413

@SchrodingersGat
Copy link
Member

@matmair you are seeing good performance improvement?

@matmair
Copy link
Member Author

matmair commented Feb 16, 2024

@SchrodingersGat yes—around 20 seconds on the pipeline and 15 on my device. The pre-commit hooks become nearly unnoticable.

@matmair
Copy link
Member Author

matmair commented Feb 16, 2024

We can not merge right now though as there are still some unresolved issues upstream due to it being this new.
astral-sh/uv#1522 astral-sh/uv#1447 astral-sh/uv#1343

@matmair matmair self-assigned this Feb 22, 2024
@matmair matmair added CI CI / unit testing ecosystem setup Relates to the InvenTree setup / installation process labels Feb 22, 2024
@matmair matmair marked this pull request as ready for review February 22, 2024 22:20
@matmair
Copy link
Member Author

matmair commented Feb 22, 2024

OK with 0.1.8 uv is functionally the same as pip tools. I think this could be reviewed/merged. @SchrodingersGat @wolflu05

Changes:

  • Switches internal and invoke install commands to use uv (there is a new optional switch --nouv that disables that)
  • The pre-commit compile hook is very fast now ;-)
  • The pre-commit compile hook now has a target Python version set - ie. you can run your dev setup on a newer, faster version of Python than 3.9 and will not get different requirements due to different standard libraries etc.

There are 3 changes in the requirement files as visible in this diff:

  • the tool header changes to uv
  • there are no via .... references anymore - they are observed, just not listed
  • extras (ie toml in this sample coverage[toml]) are not listed but observed (there seems to be some discussions with pip-tools too if those should be in the lockfile)

All of those are cosmetic

@matmair matmair changed the title Test UV performance Swtich to UV :speed: Feb 22, 2024
@matmair matmair changed the title Swtich to UV :speed: Switch to uv Feb 22, 2024
@SchrodingersGat SchrodingersGat added this to the 0.14.0 milestone Feb 22, 2024
@SchrodingersGat
Copy link
Member

@matmair looks good to me - thanks for putting the time into this!

@SchrodingersGat SchrodingersGat merged commit f5e02fd into inventree:master Feb 22, 2024
24 checks passed
@matmair matmair deleted the uv-testing branch February 22, 2024 23:17
@matmair matmair mentioned this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI / unit testing ecosystem setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants