diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 53aea6d..86e474d 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -14,17 +14,18 @@ jobs: if: github.actor != 'dependabot[bot]' runs-on: ubuntu-latest outputs: - python-template-docker-tag: ${{ steps.python-template-docker-tag.outputs.python-template-docker-tag }} + docker-tag: ${{ steps.docker-tag.outputs.docker-tag }} env: - PYTHON_APP_ENVIRONMENT: Development + PYTHON_APP_ENVIRONMENT: development steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Install uv - uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1 + uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0 with: - version: 0.9.0 + version-file: pyproject.toml + resolution-strategy: lowest - name: Install Python uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 @@ -52,14 +53,14 @@ jobs: uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - name: Set docker tag - id: python-template-docker-tag - run: echo "python-template-docker-tag=myregistry/python-template:${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT + id: docker-tag + run: echo "docker-tag=myregistry/python-template:${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: file: src/python_template/api/Dockerfile - tags: ${{ steps.python-template-docker-tag.outputs.python-template-docker-tag }} + tags: ${{ steps.docker-tag.outputs.docker-tag }} push: false deploy-dev: @@ -67,7 +68,7 @@ jobs: uses: ./.github/workflows/_deploy.yaml with: environment: dev - docker_tag: ${{ needs.continuous-integration.outputs.python-template-docker-tag }} + docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }} secrets: inherit deploy-stg: @@ -75,7 +76,7 @@ jobs: uses: ./.github/workflows/_deploy.yaml with: environment: stg - docker_tag: ${{ needs.continuous-integration.outputs.python-template-docker-tag }} + docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }} secrets: inherit deploy-pro: @@ -83,5 +84,5 @@ jobs: uses: ./.github/workflows/_deploy.yaml with: environment: pro - docker_tag: ${{ needs.continuous-integration.outputs.python-template-docker-tag }} + docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }} secrets: inherit diff --git a/pyproject.toml b/pyproject.toml index c503bb4..3be92ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,12 @@ dev = [ ] [build-system] -requires = ["uv_build>=0.9.0,<0.10.0"] +requires = ["uv_build"] build-backend = "uv_build" +[tool.uv] +required-version = ">=0.9.2,<0.10.0" + [tool.pyright] typeCheckingMode = "strict" diff --git a/src/python_template/api/Dockerfile b/src/python_template/api/Dockerfile index 0aa3032..762b247 100644 --- a/src/python_template/api/Dockerfile +++ b/src/python_template/api/Dockerfile @@ -1,5 +1,5 @@ -# 0.9.0-python3.13-bookworm-slim -FROM astral/uv@sha256:3cb1f6710acffab0693c9efaaa32ab21ff10a4f8e38efaa5f2688abb49f35687 AS builder +# 0.9.2-python3.13-bookworm-slim +FROM astral/uv@sha256:7072fbb9cf84e6b76bee43905c27a1cf4afa48bfa49de3cb2b57f748ada6cc10 AS builder ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0 diff --git a/tests/unit/domain/__init__.py b/tests/unit/domain/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/domain/entities/__init__.py b/tests/unit/domain/entities/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/domain/entities/test_product.py b/tests/unit/domain/entities/test_product.py new file mode 100644 index 0000000..cfcf304 --- /dev/null +++ b/tests/unit/domain/entities/test_product.py @@ -0,0 +1,8 @@ +from decimal import Decimal + +from python_template.domain.entities.product import Product + + +class TestProduct: + def test_publish_product(self) -> None: + Product(name="Product name", price=Decimal("1.0"), is_discontinued=False)