Skip to content

Commit 974c5df

Browse files
author
benoit-cty
committed
Doc cleaning
1 parent a0b2514 commit 974c5df

4 files changed

Lines changed: 13 additions & 45 deletions

File tree

.github/copilot-instructions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Here's what you need to know to navigate and contribute effectively.
4141
- **docs/** - Sphinx documentation (build with `uv run task docs`)
4242
- **examples/** - Usage examples and demos
4343
- **deploy/** - Deployment configurations and scripts
44-
- **requirements/** - Dependency specifications for different environments
4544

4645
## Development Setup
4746

@@ -149,7 +148,6 @@ uv run task -l
149148
- **pyproject.toml**: Main project configuration
150149
- **.codecarbon.config**: Runtime configuration for API connection
151150
- **docker-compose.yml**: Local development with PostgreSQL
152-
- **requirements/**: Pinned dependencies for different environments
153151

154152
## Documentation and Help
155153

CONTRIBUTING.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,9 @@ To test CodeCarbon, it is useful to stress your computer to make it use its full
144144
<!-- TOC --><a name="update-all-dependancies"></a>
145145
### Update all dependancies
146146

147-
```sh
148-
uv pip compile requirements.in -o requirements.txt
149-
```
150-
151147
For multiple requirement files:
152-
153148
```sh
154-
uv pip compile requirements/dev.in -o requirements/dev.txt
155-
uv pip compile requirements/test.in -o requirements/test.txt
149+
uv sync --upgrade
156150
```
157151

158152
<!-- TOC --><a name="branching-and-pull-requests"></a>
@@ -256,7 +250,7 @@ You can also run `pre-commit` with `uv run pre-commit run -v` if you have some c
256250
Dependencies are defined in different places:
257251

258252
- 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 UV, do not edit them.
253+
- In [uv.lock](uv.lock), those are the locked dependencies managed by UV, do not edit them.
260254
- In [.conda/meta.yaml](.conda/meta.yaml#L21), those are the dependencies for the Conda pacakge targeting Python 3.7 and higher versions.
261255

262256

@@ -268,8 +262,8 @@ To make generating documentation easier, we use [`sphinx` package](https://www.s
268262

269263
In order to make changes, edit the `.rst` files that are in the `/docs/edit` folder, and then run in root folder:
270264

271-
```
272-
uv run docs
265+
```sh
266+
uv run --only-group doc task docs
273267
```
274268

275269
to regenerate the html files.
@@ -281,8 +275,6 @@ to regenerate the html files.
281275
- Create a PR bumping the version with `uv run bumpver update --patch`. For a release candidate, use `uv run bumpver update --set-version 3.0.0_rc1`.
282276
- Run `uv run python3 .github/check_version.py` to check version consistancy.
283277
- Update the dependencies with `uv sync --upgrade`
284-
- Export a requirements.txt `uv pip freeze > requirements.txt`.
285-
- Keep pre-commit up-to-date with `uv run task precommit-update`.
286278
- [Build Documentation](#documentation) with `uv run --only-group doc task docs`.
287279
- Push the changes.
288280
- Merge the PR.
@@ -304,8 +296,6 @@ Inside the docker container, run:
304296
- `conda build --python 3.11 .conda/ -c conda-forge --output-folder /conda_dist`
305297
- `anaconda upload --user codecarbon /conda_dist/noarch/codecarbon-*.tar.bz2`
306298

307-
308-
309299
<!-- TOC --><a name="api-and-dashboard"></a>
310300
## API and Dashboard
311301

carbonserver/tests/TESTING.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Testing the carbon server
22

3-
4-
## Behaviors to test :
5-
3+
## Behaviors to test
64

75
### Domain logic
86
To test the interface exposed by entities, in memory repositories can be used to isolate the domain logic from technical
@@ -29,55 +27,34 @@ To test the interface exposed by entities, in memory repositories can be used to
2927
Domain logic can be tested at a higher level, with more complex setups, in service/use cases tests.
3028
Use case tests mocks repositories returns to focus on
3129

32-
33-
3430
### Routers
3531
To test a router, validation parameters are ensured by pydantic (available on the swagger documentation),
3632
and logic is tested by interfaces.
3733
A Postman collection of requests is available: ```carbonserver/tests/postman/TestCollection.postman_collection.json```.
3834

39-
40-
4135
### Integration
4236
- Database: in the CI, a prod-like database can be used to test features on real data (TODO)
4337
- Code Carbon package: Launch a train scenario (TODO)
4438

45-
4639
## Running the tests:
4740

48-
### Install the test setup
49-
50-
In a virtual environment, install and build the api package:
5141
```bash
52-
git clone git@github.com:mlco2/codecarbon.git
53-
git checkout api
54-
cd carbonserver
55-
python -m setup install
56-
python -m setup build # Verify the build on local environment
57-
pip install -r requirements-dev.txt # Install test dependencies
42+
uv run --extra api task test-api-unit # Unit tests on api
43+
uv run --extra api task test-api-integ # Integration tests
5844
```
5945

60-
61-
### Run tests
62-
```bash
63-
uv run task test-api-unit # Unit tests on api
64-
uv run task test-api-integ # Integration tests
65-
```
66-
67-
6846
To test the HTTP layer, you can also deploy a local instance:
6947

7048
```bash
7149
cd carbonserver/
72-
uvicorn main:app --reload
50+
uv run --extra api uvicorn main:app --reload
7351
```
7452

7553
Swagger documentation is available at http://localhost:8000/docs
7654

7755

7856
### Run locally the CI
7957

80-
8158
To test the full build process, the Github Actions workflow can be executed locally with act ([install available here](https://raw.githubusercontent.com/nektos/act/master/install.sh)):
8259
```bash
8360
# Build patched dockerfile from project root

examples/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Getting Started
22

33
## Setup
4+
45
The following examples use Keras from TensorFlow 2.0. The dependencies can be installed as follows
5-
```
6-
pip install -r requirements-examples.txt
6+
7+
```bash
8+
pip install -r examples/requirements-examples.txt
79
```
810

911
## Examples
@@ -13,3 +15,4 @@ pip install -r requirements-examples.txt
1315
* [mnist-comet.py](mnist-comet.py): Using `CO2Tracker` with [`Comet`](https://www.comet.ml/site) for automatic experiment and emissions tracking.
1416
* [api_call_demo.py](api_call_demo.py): Simplest demo to send computer emissions to CodeCarbon API.
1517
* [api_call_debug.py](api_call_debug.py): Script to send computer emissions to CodeCarbon API. Made for debugging: debug log and send data every 20 seconds.
18+
* And many more in the [examples](../examples) folder.

0 commit comments

Comments
 (0)