-
-
Notifications
You must be signed in to change notification settings - Fork 237
Switch from Hatch to UV #815
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
Conversation
8eac358 to
0792bc8
Compare
dd2e791 to
43e2c71
Compare
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.
Pull Request Overview
This PR replaces Hatch with UV and Taskipy for environment and task management, updates documentation accordingly, and refines the CPU power estimation logic.
- Migrate project scripts and environments from Hatch to UV/Taskipy in pyproject.toml
- Update CONTRIBUTING.md to use UV commands instead of Hatch
- Change CPU load–based power calculation and debug logging in hardware.py
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pyproject.toml | Switched [tool.hatch] and optional-dependencies to UV’s dependency-groups and Taskipy tasks |
| codecarbon/external/hardware.py | Refactored CPU load measurement and power estimation, adjusted debug messages |
| CONTRIBUTING.md | Updated setup and command instructions from Hatch to UV |
Comments suppressed due to low confidence (3)
pyproject.toml:127
- [nitpick] Task names mix hyphens (
pre-commit-install) and no hyphens (precommit-install). Consider standardizing on one naming convention to improve clarity.
precommit-install = "pre-commit install"
codecarbon/external/hardware.py:215
- This comment is misleading—
cpu_loadis still in 0–100% range here. Either remove the comment or explicitly divide by 100 when assigning.
) # Convert to 0-1 range
codecarbon/external/hardware.py:221
- [nitpick] Using the debug spec
{self._tdp=}may clutter logs with the variable name. Consider formatting as{self._tdp}and logging load_factor separately for readability.
f"CPU load {self._tdp} W and {cpu_load:.1f}% {load_factor=} => estimation of {power} W for whole machine."
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SaboniAmine
left a comment
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.
LGTM, thanks Benoit!
43ca859 to
7f3c3ce
Compare
The goal of this PR is to use UV + Taskipy instead of Hatch.
TODO:
Maybe we could go with UV and Hatch for a first release and remove Hatch after some time ?