Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/how-to/agent-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ Here's what you need to know to navigate and contribute effectively.
# Run specific test
uv run pytest tests/test_emissions_tracker.py

# Lint and format
uv run task lint
# Lint and format (runs the pre-commit hooks, which rewrite files in place)
uv run task format
```

Expand Down Expand Up @@ -112,7 +111,7 @@ Here's what you need to know to navigate and contribute effectively.
1. **Check existing tests** in `tests/` for similar functionality
2. **Add unit tests** first (test-driven development)
3. **Update documentation** if public interface changes
4. **Follow coding style**: Use `uv run task format` and `uv run task lint`
4. **Follow coding style**: Use `uv run task format`

### API Development
1. **Follow FastAPI patterns** - see routers in `carbonserver/carbonserver/api/routers/`
Expand All @@ -134,8 +133,7 @@ uv run task -l

# Main tasks:
# - test-package: Core package testing
# - lint: Code linting and style checks
# - format: Code formatting
# - format: Lint and format, by running the pre-commit hooks
# - test-api-unit: API unit tests
# - test-api-integ: API integration tests
# - dashboard: Run API locally
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ dev = [
"taskipy",
"bumpver",
"pre-commit",
"ruff",
"black",
"mypy",
"pytest",
Expand Down Expand Up @@ -138,16 +137,16 @@ carbonserver-api-requirements = "uv pip compile carbonserver/pyproject.toml --ge
build-doc = "uv run --only-group doc zensical build -f mkdocs.yml && uv run --only-group doc python scripts/check_docs_links.py site"
precommit-install = "pre-commit install"
precommit-update = "pre-commit autoupdate"
precommit = "c"
precommit = "pre-commit run --all-files"
mypy-check = "mypy -m codecarbon --ignore-missing-imports --no-strict-optional --disable-error-code attr-defined --disable-error-code assignment --disable-error-code misc"
lint = "black --check --diff . && ruff check . && mypy ."
format = "black . && ruff check --fix --exit-non-zero-on-fix ."
# No `lint` task: the pre-commit hooks fix what they can, so this rewrites
# files rather than only reporting. Use `mypy-check` for a read-only check.
format = "pre-commit run --all-files"
test-package = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
test-coverage = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --cov --cov-report=xml --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
test-package-integ = "CODECARBON_ALLOW_MULTIPLE_RUNS=True python -m pytest -vv tests/"
docs = "uv run --only-group doc zensical build -f mkdocs.yml && uv run --only-group doc python scripts/check_docs_links.py site"
docs-serve = "zensical serve -f mkdocs.yml"
docs-check-drift = "python scripts/check-docs-drift.py"
carbonboard = "python codecarbon/viz/carbonboard.py"

[tool.bumpver]
Expand Down
27 changes: 0 additions & 27 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading