Skip to content

chore: PyPI metadata, docs links in warnings, release-drafter versioning - #1431

Merged
davidberenstein1957 merged 2 commits into
masterfrom
chore/metadata-and-warnings
Sep 29, 2026
Merged

davidberenstein1957 merged 2 commits into
masterfrom
chore/metadata-and-warnings

Conversation

@davidberenstein1957

Copy link
Copy Markdown
Collaborator

Description

Split out of #1302 at the maintainer's request, to keep that PR documentation-only. This PR carries the non-docs changes from #1302: PyPI package metadata, the RAPL/CPU-model warning refactor with docs links, a signal-handler docstring and typo fix, Release Drafter version wiring, and the tests that cover the warning refactor.

Related Issue

Split from #1302. Part of #1301.

Motivation and Context

#1302 mixed documentation work with packaging metadata and source changes, which makes it harder to review as a docs-only change. This PR isolates the non-docs pieces so #1302 can merge as docs-only, and this one can be reviewed as a code/config change.

How Has This Been Tested?

uv run task test-package passes (all package tests green). Pre-commit hooks (autoflake, isort, black, flake8) pass on the full tree. uv run bumpver update --dry --patch runs cleanly against the files touched here.

Screenshots (if appropriate):

N/A

What is in here

Packaging metadata (pyproject.toml)

  • Adds description, 15 keywords, and PyPI classifiers (status, audience, OS, topic).
  • Note: the [tool.bumpver.file_patterns] entries for CITATION.cff and README.md stay in docs: complete metadata, citation, troubleshooting and accuracy docs #1302, since those files (and their version-line format) are only introduced/changed there; adding the patterns here without those files would break bumpver update.

Warning message refactor (codecarbon/core/cpu.py, codecarbon/core/powermetrics.py)

  • Introduces a shared RAPL_PERMISSION_HELP constant reused by the RAPL permission-denied warnings (was duplicated string literals).
  • Points the RAPL permission and unknown-CPU-model warnings at the new troubleshooting doc anchors (#rapl-permission-denied, #unknown-cpu-model), and the powermetrics sudo warning at #macos instead of the old methodology anchor.
  • Note: these URLs point at anchors that only exist once docs/how-to/troubleshooting.md merges in docs: complete metadata, citation, troubleshooting and accuracy docs #1302; the links will 404 until that PR merges. Flagging this coupling rather than hiding it — sequencing (merge docs: complete metadata, citation, troubleshooting and accuracy docs #1302 first, or land this URL change after) is a maintainer call.

codecarbon/emissions_tracker.py

  • Docstring for service_shutdown (usage example for registering as a SIGTERM/SIGINT handler).
  • Fixes a Sphinx-style docstring typo (:param: tracker: → :param tracker:, :param: task_name: → :param task_name:) in track_task_emissions.

Tests

  • tests/test_rapl_permissions.py: two new tests covering the shared warning constant (warn-once behavior, unreadable-domain warning).
  • tests/test_emissions_tracker.py: new test for the track_task_emissions decorator.
  • tests/test_readme_links.py: new test guarding that relative links in examples/README.md resolve.

CI/release (.github/release-drafter.yml, .github/workflows/release-drafter.yml)

  • Release Drafter now reads the release number from [tool.bumpver] current_version in pyproject.toml instead of auto-incrementing the patch version, and uses $RESOLVED_VERSION in the name/tag templates.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

AI Usage Disclosure

  • 🟥 AI-vibecoded: You cannot explain the logic. Car analogy : the car drive by itself, you are outside it and just tell it where to go.
  • 🟠 AI-generated: Car analogy : the car drive by itself, you are inside and give instructions.
  • ⭐ AI-assisted. Car analogy : you drive the car, AI help you find your way.
  • ♻️ No AI used. Car analogy : you drive the car.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the docs/how-to/contributing.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Commits

  • 92a3a4c chore: add PyPI metadata, docs links in warnings and release-drafter versioning

@davidberenstein1957
davidberenstein1957 requested a review from a team as a code owner September 28, 2026 10:56
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.02%. Comparing base (cfabf92) to head (b3838f4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1431      +/-   ##
==========================================
+ Coverage   91.69%   92.02%   +0.33%     
==========================================
  Files          49       49              
  Lines        5152     5153       +1     
==========================================
+ Hits         4724     4742      +18     
+ Misses        428      411      -17     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SaboniAmine SaboniAmine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! A quick ping to @inimaz to check if the version can be picked from a more reliable source but this should be OK

Comment thread .github/workflows/release-drafter.yml Outdated
Address review on #1431: use codecarbon/_version.py as the single
runtime version source instead of parsing pyproject.toml in CI.
@davidberenstein1957
davidberenstein1957 merged commit e8bccc6 into master Sep 29, 2026
18 checks passed
@davidberenstein1957
davidberenstein1957 deleted the chore/metadata-and-warnings branch September 29, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants