Skip to content

Commit 3dfd207

Browse files
Copilotbenoit-cty
authored andcommitted
Remove Hatch completely and replace with setuptools + UV
Co-authored-by: benoit-cty <6603048+benoit-cty@users.noreply.github.com>
1 parent 450dbe3 commit 3dfd207

13 files changed

Lines changed: 3196 additions & 283 deletions

File tree

.github/workflows/package.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
run: uv python install 3.12
2121
- name: Check versions
2222
run: |
23-
uv pip install --system requests
24-
python3 .github/check_version.py -o
23+
uv run python .github/check_version.py -o
2524
- name: Build pip package
2625
run: |
2726
uv build

.github/workflows/python-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
run: uv python install 3.12
2424
- name: Check versions
2525
run: |
26-
uv pip install --system requests
27-
python3 .github/check_version.py
26+
uv run python .github/check_version.py
2827
- name: Build package
2928
run: uv build
3029
- name: Publish package

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ You can also run `pre-commit` with `uv run pre-commit run -v` if you have some c
256256
Dependencies are defined in different places:
257257

258258
- In [pyproject.toml](pyproject.toml#L28), those are all the dependencies.
259-
- In [requirements.txt](requirements.txt) and [requirements/](requirements/), those are locked dependencies managed by [Hatch plugin pip-compile](https://github.com/juftin/hatch-pip-compile), do not edit them.
259+
- In [requirements.txt](requirements.txt) and [requirements/](requirements/), those are locked dependencies managed by UV, do not edit them.
260260
- In [.conda/meta.yaml](.conda/meta.yaml#L21), those are the dependencies for the Conda pacakge targeting Python 3.7 and higher versions.
261261

262262

@@ -299,7 +299,7 @@ Start a Docker image in the same directory and bind-mount the current directory
299299

300300
Inside the docker container, run:
301301

302-
- `conda install -y conda-build conda-verify conda-forge::hatchling`
302+
- `conda install -y conda-build conda-verify`
303303
- `cd /data && mkdir -p /conda_dist`
304304
- `conda build --python 3.11 .conda/ -c conda-forge --output-folder /conda_dist`
305305
- `anaconda upload --user codecarbon /conda_dist/noarch/codecarbon-*.tar.bz2`

carbonserver/tests/TESTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ pip install -r requirements-dev.txt # Install test dependencies
6060

6161
### Run tests
6262
```bash
63-
hatch run api:test-unit # Unit tests on api
64-
hatch run api:test-integ # Integration tests
63+
uv run task test-api-unit # Unit tests on api
64+
uv run task test-api-integ # Integration tests
6565
```
6666

6767

carbonserver/tests/api/integration/test_api_black_box.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export CODECARBON_API_URL=http://localhost:8008
44
export DATABASE_URL=postgresql://codecarbon-user:supersecret@localhost:5480/codecarbon_db
55
Then execute the tests:
6-
hatch run api:test-integ
6+
uv run task test-api-integ
77
"""
88

99
import os

codecarbon/data/hardware/cpu_dataset_builder/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ To update the CPU database, you have to run:
44

55
```bash
66
cd codecarbon/data/hardware/cpu_dataset_builder
7-
hatch run pip install playwright beautifulsoup4
8-
hatch run python intel_cpu_scrapper.py
9-
hatch run python amd_cpu_scrapper.py
10-
hatch run python merge_scrapped_cpu_power.py
7+
uv run pip install playwright beautifulsoup4
8+
uv run python intel_cpu_scrapper.py
9+
uv run python amd_cpu_scrapper.py
10+
uv run python merge_scrapped_cpu_power.py
1111
```
1212

1313
Then commit the changes to the CSV files.

codecarbon/data/hardware/cpu_dataset_builder/amd_cpu_scrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
This script uses Playwright to scrape AMD CPU data from their website and save it as a CSV file.
33
4-
hatch run pip install playwright
5-
hatch run python amd_cpu_scrapper.py
4+
uv run pip install playwright
5+
uv run python amd_cpu_scrapper.py
66
"""
77

88
import asyncio

codecarbon/data/hardware/cpu_dataset_builder/intel_cpu_scrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
This script uses requests and BeautifulSoup to scrape CPU names and their associated TDP values
66
from the Intel ARK website using the advanced filter search URL.
77
8-
hatch run pip install beautifulsoup4
9-
hatch run python intel_cpu_scrapper.py
8+
uv run pip install beautifulsoup4
9+
uv run python intel_cpu_scrapper.py
1010
1111
"""
1212

codecarbon/data/hardware/cpu_dataset_builder/merge_scrapped_cpu_power.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
It ensures that the TDP values are numeric and updates existing entries or adds new ones.
55
66
cd codecarbon/data/hardware/cpu_dataset_builder
7-
hatch run python merge_scrapped_cpu_power.py
7+
uv run python merge_scrapped_cpu_power.py
88
99
"""
1010

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ docker logs codecarbon-api_codecarbon_api_1
4141

4242
## Execute tests
4343
```sh
44-
docker exec codecarbon-api_codecarbon_api_1 hatch run api:test-integtox
44+
docker exec codecarbon-api_codecarbon_api_1 uv run task test-api-integ
4545
```
4646

4747
## Force build

0 commit comments

Comments
 (0)