Skip to content

Conversation

@benoit-cty
Copy link
Contributor

@benoit-cty benoit-cty commented Apr 2, 2025

The goal of this PR is to use UV + Taskipy instead of Hatch.

TODO:

  • Migrate the CI
  • Check the documentation

Maybe we could go with UV and Hatch for a first release and remove Hatch after some time ?

@benoit-cty benoit-cty changed the title Switch from Hatch to UV [Version 3] Switch from Hatch to UV Apr 2, 2025
@benoit-cty benoit-cty force-pushed the feat/switch_to_uv branch from dd2e791 to 43e2c71 Compare July 2, 2025 10:29
@benoit-cty benoit-cty changed the base branch from codecarbon_v3_rc to master July 2, 2025 10:30
@benoit-cty benoit-cty changed the title [Version 3] Switch from Hatch to UV Switch from Hatch to UV Jul 2, 2025
@benoit-cty benoit-cty requested a review from Copilot July 2, 2025 12:01
Copy link
Contributor

Copilot AI left a 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_load is 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."

benoit-cty and others added 4 commits July 2, 2025 14:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@benoit-cty benoit-cty marked this pull request as ready for review July 6, 2025 11:07
Copy link
Member

@SaboniAmine SaboniAmine left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Benoit!

benoit-cty added 3 commits July 6, 2025 17:24
@benoit-cty benoit-cty force-pushed the feat/switch_to_uv branch from 43ca859 to 7f3c3ce Compare July 6, 2025 15:39
@benoit-cty benoit-cty merged commit b8550b0 into master Jul 6, 2025
11 checks passed
@benoit-cty benoit-cty deleted the feat/switch_to_uv branch July 6, 2025 19:23
@benoit-cty benoit-cty mentioned this pull request Jul 11, 2025
6 tasks
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.

3 participants