Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.3
rev: 2d3853a9f31d97783fb2e181d41cd82a6babd666 # v2.3.3
hooks:
- id: autoflake
args:
Expand All @@ -11,18 +11,18 @@ repos:
--expand-star-imports,
]
- repo: https://github.com/pycqa/isort
rev: 8.0.1
rev: a333737ed43df02b18e6c95477ea1b285b3de15a # 8.0.1
hooks:
- id: isort
args: ["--filter-files"]
- repo: https://github.com/psf/black
rev: 26.5.1
rev: 87928e6d6761a4a6d22250e1fee5601b3998086e # 26.5.1
hooks:
- id: black
args: [--safe]
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
rev: d93590f5be797aabb60e3b09f2f52dddb02f349f # 7.3.0
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: ['flake8-bugbear==23.9.16']
additional_dependencies: ['flake8-bugbear==23.9.16']
4 changes: 2 additions & 2 deletions carbonserver/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ RUN sh /uv-installer.sh && rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH"

# Copy project files
COPY pyproject.toml /app/
COPY requirements/requirements-api.txt /app/requirements/requirements-api.txt
COPY codecarbon /app/codecarbon
COPY carbonserver /app/carbonserver

# Install carbonserver dependencies.
RUN uv pip install --system -e ./carbonserver
RUN uv pip install --system --require-hashes -r requirements/requirements-api.txt

COPY ./carbonserver/docker/entrypoint.sh /opt
RUN chmod a+x /opt/entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ test-api-unit = "uv run --project carbonserver --extra dev python -m pytest -vv
test-api-integ = "uv run --project carbonserver --extra dev python -m pytest -vv carbonserver/tests/api/integration/"
setup-db = "cd carbonserver && uv run --project carbonserver python -m alembic -c carbonserver/database/alembic.ini upgrade head"
downgrade-db = "cd carbonserver && uv run --project carbonserver python -m alembic -c carbonserver/database/alembic.ini downgrade base"
carbonserver-api-requirements = "uv pip compile carbonserver/pyproject.toml --output-file requirements/requirements-api.txt"
carbonserver-api-requirements = "uv pip compile carbonserver/pyproject.toml --generate-hashes --output-file requirements/requirements-api.txt"
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"
Expand Down
2 changes: 1 addition & 1 deletion requirements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This file contains all dependencies needed to run the CodeCarbon API server (car
When you modify dependencies in `carbonserver/pyproject.toml`, you **must** regenerate this file:

```bash
uv pip compile carbonserver/pyproject.toml --output-file requirements/requirements-api.txt
uv pip compile carbonserver/pyproject.toml --generate-hashes --output-file requirements/requirements-api.txt
```

Then commit the updated file.
1,790 changes: 1,715 additions & 75 deletions requirements/requirements-api.txt

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM node:24-alpine@sha256:d32cdf619f63fe0471182d08996dd516c6275bb5fd31ae06e55a570bd9e1ad43 AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME/bin:$PATH"
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm@10.8.0 && pnpm install --frozen-lockfile
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build

Expand Down
1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "codecarbon-webapp",
"version": "0.1.0",
"private": true,
"packageManager": "pnpm@10.8.0+sha512.0e82714d1b5b43c74610193cb20734897c1d00de89d0e18420aebc5977fa13d780a9cb05734624e81ebd81cc876cd464794850641c48b9544326b5622ca29971",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
Loading