Skip to content

Commit

Permalink
feat: replace poetry with uv (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal authored Jan 28, 2025
1 parent bf38358 commit e6c1f25
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 251 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,16 @@ jobs:
echo "short_version=${short_version}" >> $GITHUB_OUTPUT
echo "base_image_tag=${base_image_tag}" >> $GITHUB_OUTPUT
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --without dev,test
run: |
uv venv
uv pip install -r pyproject.toml
- name: Create Dockerfile from template
run: poetry run python3 render_templates/main.py --flavor ${{ matrix.image }} --print-dockerfile --enable-patches --immich-version ${{ steps.tags.outputs.immich_version }}
run: uv run python3 -m render_templates.main --flavor ${{ matrix.image }} --print-dockerfile --enable-patches --immich-version ${{ steps.tags.outputs.immich_version }}

- name: Generate docker image tags
id: metadata
Expand Down
46 changes: 14 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --with dev,test
run: |
uv venv
uv sync
- name: Run python linter
run: poetry run ruff check render_templates
run: uv run ruff check render_templates
if: ${{ !cancelled() }}

- name: Run python formatter
run: poetry run ruff format --check render_templates
run: uv run ruff format --check render_templates
if: ${{ !cancelled() }}

- name: Run tests and coverage
run: poetry run pytest render_templates
run: uv run pytest render_templates
if: ${{ !cancelled() }}

Linter:
Expand All @@ -59,25 +50,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --without dev,test
run: |
uv venv
uv pip install -r pyproject.toml
- name: Create Dockerfile from template
run: poetry run python3 render_templates/main.py --flavor ${{ matrix.flavor }}
run: uv run python3 -m render_templates.main --flavor ${{ matrix.flavor }}

- name: Run Hadolint
uses: hadolint/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build-*/
node_modules
package*.json
.venv/
__pycache__/
187 changes: 0 additions & 187 deletions poetry.lock

This file was deleted.

29 changes: 12 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
[tool.poetry]
[project]
name = "docker-immich"
version = "0.1.1"
description = "AIO image for Immich"
authors = ["martabal <[email protected]>"]
authors = [{name = "martabal",email = "[email protected]"}]
readme = "README.md"
packages = [{include = "render_templates"}]
requires-python = ">=3.13"
dependencies = [
"jinja2>=3.1.5",
]

[dependency-groups]
dev = [
"ruff>=0.9.3",
"pytest>=8.3.4"
]

[tool.ruff]
cache-dir = "~/.cache/ruff"

[tool.poetry.dependencies]
python = "^3.12"
jinja2 = "^3.1.5"

[tool.poetry.group.dev.dependencies]
ruff = "^0.9.2"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading

0 comments on commit e6c1f25

Please sign in to comment.