diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ced34de2d..136d7b76f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,7 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "pip3 install --user -e canopeum_backend[dev]", // https://github.com/astral-sh/uv/issues/5964 - // "postCreateCommand": "cd canopeum_backend && uv sync --locked --extra dev", + // "postCreateCommand": "cd canopeum_backend && uv sync --locked", "features": { "ghcr.io/devcontainers/features/node:1": {} }, diff --git a/.github/workflows/canopeum_backend_pr_validation.yml b/.github/workflows/canopeum_backend_pr_validation.yml index d50df8f0e..f2e8465bb 100644 --- a/.github/workflows/canopeum_backend_pr_validation.yml +++ b/.github/workflows/canopeum_backend_pr_validation.yml @@ -33,7 +33,7 @@ jobs: with: enable-cache: true cache-dependency-glob: "canopeum_backend/uv.lock" - - run: uv sync --locked --extra dev + - run: uv sync --locked - name: Run Django Tests run: uv run manage.py test mypy: @@ -48,7 +48,7 @@ jobs: with: enable-cache: true cache-dependency-glob: "canopeum_backend/uv.lock" - - run: uv sync --locked --extra dev + - run: uv sync --locked - run: uv run mypy . --python-version=3.12 pyright: @@ -63,7 +63,7 @@ jobs: with: enable-cache: true cache-dependency-glob: "canopeum_backend/uv.lock" - - run: uv sync --locked --extra dev + - run: uv sync --locked - run: echo "$PWD/.venv/bin" >> $GITHUB_PATH - uses: jakebailey/pyright-action@v2 with: diff --git a/README.md b/README.md index 7042028c2..0866fc3c7 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ For backend ```shell cd canopeum_backend docker compose up - uv sync --locked --extra dev + uv sync --locked uv run manage.py initialize_database uv run manage.py runserver ``` diff --git a/canopeum_backend/Dockerfile b/canopeum_backend/Dockerfile index 9b54bafb8..605878c4c 100644 --- a/canopeum_backend/Dockerfile +++ b/canopeum_backend/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /app COPY 'pyproject.toml' /app/ COPY 'uv.lock' /app/ -RUN uv sync --locked +RUN uv sync --locked --no-dev COPY . /app/ diff --git a/canopeum_backend/pyproject.toml b/canopeum_backend/pyproject.toml index 927d2e01e..3da267d96 100644 --- a/canopeum_backend/pyproject.toml +++ b/canopeum_backend/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "requests-cache>=1.2.1", "retry-requests>=2.0.0", ] -[project.optional-dependencies] +[dependency-groups] dev = [ # Tools "mypy", # version taken from [compatible-mypy], diff --git a/canopeum_backend/uv.lock b/canopeum_backend/uv.lock index 703e647c7..bce744309 100644 --- a/canopeum_backend/uv.lock +++ b/canopeum_backend/uv.lock @@ -40,7 +40,7 @@ dependencies = [ { name = "retry-requests" }, ] -[package.optional-dependencies] +[package.dev-dependencies] dev = [ { name = "django-stubs", extra = ["compatible-mypy"] }, { name = "djangorestframework-stubs", extra = ["compatible-mypy"] }, @@ -55,23 +55,27 @@ requires-dist = [ { name = "dj-database-url" }, { name = "django", specifier = ">=5.0.8" }, { name = "django-cors-headers" }, - { name = "django-stubs", extras = ["compatible-mypy"], marker = "extra == 'dev'", specifier = ">=5.0.0" }, { name = "djangorestframework", specifier = ">=3.15.2" }, { name = "djangorestframework-camel-case" }, { name = "djangorestframework-simplejwt" }, - { name = "djangorestframework-stubs", extras = ["compatible-mypy"], marker = "extra == 'dev'", specifier = ">=3.15.0" }, { name = "drf-spectacular", specifier = ">=0.27.2" }, { name = "drf-spectacular-sidecar" }, { name = "googlemaps" }, - { name = "mypy", marker = "extra == 'dev'" }, { name = "mysqlclient" }, { name = "openmeteo-requests", specifier = ">=1.3.0" }, - { name = "pyright", marker = "extra == 'dev'", specifier = ">=1.1.374" }, { name = "python-dotenv" }, { name = "requests-cache", specifier = ">=1.2.1" }, { name = "retry-requests", specifier = ">=2.0.0" }, - { name = "ruff", marker = "extra == 'dev'", specifier = "~=0.7.4" }, - { name = "types-jsonschema", marker = "extra == 'dev'" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "django-stubs", extras = ["compatible-mypy"], specifier = ">=5.0.0" }, + { name = "djangorestframework-stubs", extras = ["compatible-mypy"], specifier = ">=3.15.0" }, + { name = "mypy" }, + { name = "pyright", specifier = ">=1.1.374" }, + { name = "ruff", specifier = "~=0.7.4" }, + { name = "types-jsonschema" }, ] [[package]] diff --git a/start-local-env.ps1 b/start-local-env.ps1 index 8bb514b5e..ab0e74526 100644 --- a/start-local-env.ps1 +++ b/start-local-env.ps1 @@ -28,7 +28,7 @@ function Start-MySQLContainer { # Run Django server $commandsBackend = @' cd canopeum_backend - uv sync --locked --extra dev + uv sync --locked uv run manage.py runserver '@