-
Notifications
You must be signed in to change notification settings - Fork 25
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
Migrate CI dependency installation from pip to uv #338
Conversation
This reverts commit 2377b15.
WalkthroughThe pull request introduces modifications to the CI workflow and updates to the Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
pyproject.toml (1)
95-109
: Consider reorganising dependency groupsThe new optional group contains packages that overlap with existing groups like
crystal_space
,featurisers
, andvisualisation
. Consider:
- Using the existing groups as building blocks for the optional group
- Defining the version constraints in a single location to avoid inconsistencies
Example reorganisation:
[project.optional-dependencies] # Base groups with version constraints crystal_space = [ "mp-api==0.42.2", "ElementEmbeddings==0.6.1", "umap-learn==0.5.3", "kaleido==0.2.1", "pydantic==2.9.2" ] # Combined groups optional = [ "crystal_space", "featurisers", "visualisation" ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/ci.yml
(1 hunks)pyproject.toml
(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci.yml
[error] 41-41: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
.github/workflows/ci.yml (1)
33-34
: LGTM: Proper cache configuration
The cache configuration is correctly set up with pyproject.toml
as the dependency path, which will improve CI performance by caching Python packages between runs.
.github/workflows/ci.yml
Outdated
pip install uv | ||
uv pip install -e ".[optional,dev]" --system | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider pinning uv version and fix whitespace
Whilst the migration to UV is a good improvement for faster dependency installation, consider:
- Pin the UV version for reproducible builds
- Remove the trailing whitespace on line 41
Apply this diff:
- pip install uv
- uv pip install -e ".[optional,dev]" --system
-
+ pip install uv==0.1.5
+ uv pip install -e ".[optional,dev]" --system
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
pip install uv | |
uv pip install -e ".[optional,dev]" --system | |
pip install uv==0.1.5 | |
uv pip install -e ".[optional,dev]" --system |
🧰 Tools
🪛 yamllint (1.35.1)
[error] 41-41: trailing spaces
(trailing-spaces)
optional = [ | ||
"pydantic>=2.9.2", | ||
"mp-api>=0.42.2", | ||
"pymatviz>=0.14", | ||
"seaborn>=0.13.2", | ||
"pymatgen>=2024.2.20", | ||
"matminer>=0.9.2", | ||
"umap-learn>=0.5.3", | ||
"kaleido>=0.2.1", | ||
"ase>=3.22.0", | ||
"numpy", | ||
"ElementEmbeddings>=0.4", | ||
"dash>=2.18.2", | ||
|
||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Version constraints in optional dependencies require adjustment
The codebase analysis reveals:
pymatgen
is extensively used across the project, particularly in core functionality like structure prediction and screeningElementEmbeddings
is not directly imported, only referenced in a comment for an adapted function
Recommendations:
- Align the optional
pymatgen
version (>=2024.2.20) closer to the strict version (==2024.11.13) to ensure consistent behaviour, suggest using>=2024.11.13
- Remove
ElementEmbeddings
from optional dependencies as it's not actively used in the codebase
🔗 Analysis chain
Review version inconsistencies between optional and strict groups
There are notable version differences between the optional and strict groups:
pymatgen
: >=2024.2.20 vs ==2024.11.13ElementEmbeddings
: >=0.4 vs ==0.6.1
These differences could lead to inconsistent behaviour between development and production environments.
Let's verify the compatibility of these versions:
Version differences between optional and strict dependencies need attention
The version history shows significant updates between the specified versions:
pymatgen
: 20+ releases between 2024.2.20 and 2024.11.13ElementEmbeddings
: 4 releases between 0.4 and 0.6.1
Let's verify if these packages are actively used in the codebase to assess the impact:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for breaking changes in the version differences
# Check pymatgen releases between 2024.2.20 and 2024.11.13
curl -s https://pypi.org/pypi/pymatgen/json | jq -r '.releases | keys[]' | grep -E "2024\.(2|3|4|5|6|7|8|9|10|11)\.[0-9]+" | sort -V
# Check ElementEmbeddings releases between 0.4 and 0.6.1
curl -s https://pypi.org/pypi/ElementEmbeddings/json | jq -r '.releases | keys[]' | grep -E "0\.[4-6]" | sort -V
Length of output: 494
Script:
#!/bin/bash
# Check usage of pymatgen and ElementEmbeddings in the codebase
echo "=== pymatgen usage ==="
rg "import.*pymatgen" -A 2
rg "from pymatgen" -A 2
echo -e "\n=== ElementEmbeddings usage ==="
rg "import.*ElementEmbeddings" -A 2
rg "from ElementEmbeddings" -A 2
Length of output: 5785
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #338 +/- ##
=======================================
Coverage 77.44% 77.44%
=======================================
Files 31 31
Lines 2589 2589
=======================================
Hits 2005 2005
Misses 584 584 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
Improvements