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

CI: Use uv installer instead of pip (take 2) #578

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented Mar 17, 2024

uv is the new cool kid in the town of Python packaging, from the creators of ruff. It currently serves as a (much) faster drop-in replacement for pip.

For AWB, uv without cache runs in ~10s, compared to 1m10s for pip with cache. 🤯 So overall speedup around 30% for our workflows.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.07%. Comparing base (8190dc0) to head (8a27ced).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #578   +/-   ##
=======================================
  Coverage   87.07%   87.07%           
=======================================
  Files          27       27           
  Lines        4649     4649           
=======================================
  Hits         4048     4048           
  Misses        601      601           
Flag Coverage Δ
python-3.10 87.07% <ø> (ø)
python-3.9 87.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

# Ideally, these would be fixed, but vapory is largely unmaintained,
# so here we simply keep the pip behaviour with the --compile flag.
# See https://github.com/astral-sh/uv/issues/1928#issuecomment-1968857514
run: uv pip install --compile --system "aiidalab_widgets_base[dev,smiles,optimade] @ ." aiida-core==${{ matrix.aiida-core-version }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: uv currently does not allow the simpler syntax .[dev,smiles,optimade]. But it will in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess beside this, all other stuff will be the same? It is not another package manage but simply an installer I assume? Which means the installed packages can be inspected by the normal pip command, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, uv is only an installer for now, for the most part you simply substitute pip ... with uv pip .... There are difference in behaviour, as explained in uvs README, and not everything is implemented yet, but it should be stable enough for the CI to use (and we pin the version).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: uv currently does not allow the simpler syntax .[dev,smiles,optimade]. But it will in the future.

This simpler syntax is actually allowed for editable installs, so I switched to editable install.

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good, thanks! Nice stuff @danielhollas

@danielhollas danielhollas merged commit cc4291b into aiidalab:master Mar 18, 2024
11 checks passed
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.

None yet

2 participants