Skip to content

Commit

Permalink
fix: deprecated use of docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenengelsen committed Aug 23, 2024
1 parent a096868 commit 1677750
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 82 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Set up uv
run: |
curl -LsSf https://astral.sh/uv/0.3.2/install.sh | sh
cd api
- name: Set up python
uses: actions/setup-python@v5
with:
python-version-file: "api/pyproject.toml"
- name: Restore uv cache
uses: actions/cache@v4
with:
Expand All @@ -42,8 +40,13 @@ jobs:
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install deps
run: |
cd api
uv sync --dev --all-extras
- name: Run tests
run: uv run pre-commit run --all-files
run: uv run pytest

- name: Minimize uv cache
run: uv cache prune --ci
Expand All @@ -63,10 +66,10 @@ jobs:
- name: BDD Integration tests
if: ${{ false }} # disable for now
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml run api behave
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run api uv run behave

- name: Pytest Integration tests
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pytest --integration
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api uv run pytest --integration

test-web:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ RUN mkdir -p /.cache/uv && \
chown -R 1000:1000 /.cache/uv/

FROM base as development
RUN uv sync --dev
RUN uv sync --frozen --no-cache
WORKDIR /code/src
COPY src .
USER 1000

FROM base as prod
RUN uv sync
RUN uv sync --frozen --no-cache
WORKDIR /code/src
COPY src .
USER 1000
13 changes: 11 additions & 2 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/"]

[project]
name = "api"
version = "1.4.0" # x-release-please-version
Expand All @@ -15,7 +22,8 @@ dependencies = [
"opencensus-ext-azure>=1.1.9,<2",
"pydantic>=2.1,<2.4",
"pydantic-settings>=2.0.1,<3",
"pydantic-extra-types>=2.0.0,<3"
"pydantic-extra-types>=2.0.0,<3",
"setuptools>=73.0.1",
]

[tool.uv]
Expand All @@ -26,6 +34,7 @@ dev-dependencies = [
]



[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
Expand Down Expand Up @@ -86,7 +95,7 @@ ignore = [
"src/tests/*" = ["S101"] # Allow the use of ´assert´ in tests

[tool.codespell]
skip = "*.lock,*.cjs"
skip = "*.lock,*.cjs,documentation/docs/changelog/changelog.md"
ignore-words-list = "ignored-word"

[tool.pytest]
Expand Down
Loading

0 comments on commit 1677750

Please sign in to comment.