From 8c8aead29208c9c18e33b16e9a043ae6991934f2 Mon Sep 17 00:00:00 2001 From: benoit-cty Date: Thu, 17 Apr 2025 15:12:10 +0200 Subject: [PATCH 1/3] Remove duplicate PUE --- codecarbon/emissions_tracker.py | 1 - 1 file changed, 1 deletion(-) diff --git a/codecarbon/emissions_tracker.py b/codecarbon/emissions_tracker.py index 1407db3e5..71095eaff 100644 --- a/codecarbon/emissions_tracker.py +++ b/codecarbon/emissions_tracker.py @@ -1126,7 +1126,6 @@ def wrapped_fn(*args, **kwargs): log_level=log_level, on_csv_write=on_csv_write, logger_preamble=logger_preamble, - pue=pue, country_iso_code=country_iso_code, region=region, cloud_provider=cloud_provider, From 482e57a90ba005a6567a675a8c07df151f4e4eb7 Mon Sep 17 00:00:00 2001 From: benoit-cty Date: Thu, 17 Apr 2025 15:17:39 +0200 Subject: [PATCH 2/3] Add tests on pull_request --- .github/workflows/test-package.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test-package.yml diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml new file mode 100644 index 000000000..74e4b5457 --- /dev/null +++ b/.github/workflows/test-package.yml @@ -0,0 +1,28 @@ +name: test-package + +on: + pull_request: + paths: + - "codecarbon/**" + - "pyproject.toml" + - "requirements.txt" + +jobs: + python-test: + runs-on: ubuntu-24.04 + strategy: + matrix: + python-version: ["3.9", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install hatch==1.13.0 hatchling==1.25.0 + - name: Test package + run: | + hatch run +py=${{ matrix.python-version }} test:package From 2436c94db5bb0a499465568d0860457924dd7748 Mon Sep 17 00:00:00 2001 From: benoit-cty Date: Thu, 17 Apr 2025 15:20:52 +0200 Subject: [PATCH 3/3] doc --- codecarbon/emissions_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecarbon/emissions_tracker.py b/codecarbon/emissions_tracker.py index 71095eaff..24ee26c4f 100644 --- a/codecarbon/emissions_tracker.py +++ b/codecarbon/emissions_tracker.py @@ -1,6 +1,6 @@ """ Contains implementations of the Public facing API: EmissionsTracker, -OfflineEmissionsTracker and @track_emissions +OfflineEmissionsTracker, context manager and decorator @track_emissions """ import dataclasses