diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 2aa41c4..393038f 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -1,20 +1,18 @@ --- -name: Setup - Install poetry, python, and dependencies +name: Setup - Install uv, python, and dependencies +description: This action contains some setup steps that are common to several workflows runs: using: "composite" steps: - - name: Install poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - poetry self add poetry-exec-plugin - shell: bash + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true - name: Install Python uses: actions/setup-python@v5 with: - python-version: 3.12 - # attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op) - cache: poetry + python-version-file: "pyproject.toml" - name: Install Python dependencies - run: poetry install + run: uv sync --all-extras --dev shell: bash diff --git a/.github/workflows/tests-on-push.yml b/.github/workflows/tests-on-push.yml index c77f2dd..f465744 100644 --- a/.github/workflows/tests-on-push.yml +++ b/.github/workflows/tests-on-push.yml @@ -15,21 +15,21 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Install poetry, python, and dependencies + - name: Install uv, python, and dependencies uses: ./.github/actions/setup - name: Linting with ruff - run: poetry run ruff check . --output-format=github + run: uvx ruff check . --output-format=github - name: Check formatting with ruff - run: poetry run ruff format --check . + run: uvx ruff format --check . - name: Linting with mypy - run: poetry run mypy . + run: uvx mypy . tests: runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Install poetry, python, and dependencies + - name: Install uv, python, and dependencies uses: ./.github/actions/setup - name: unittests - run: poetry run pytest tests/ + run: uvx pytest tests/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e68cf2e..9f4f3e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.5 + rev: v0.6.9 hooks: - id: ruff args: [ @@ -15,7 +15,7 @@ repos: - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-added-large-files args: ['--maxkb=1000'] diff --git a/README.md b/README.md index 611a9d7..bc8ff67 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,8 @@ Replace `your-pkg` / `your_pkg` at these places: ## Quick Start ```bash -curl -sSL https://install.python-poetry.org | python3 - -poetry self add poetry-exec-plugin -poetry install -poetry shell +curl -LsSf https://astral.sh/uv/install.sh | sh +uv sync --all-extras --dev +source .venv/bin/activate pre-commit install ``` diff --git a/pyproject.toml b/pyproject.toml index c4fad97..1b778fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,26 +1,27 @@ -[tool.poetry] +[project] name = "your-pkg" version = "0.1.0" description = "Add a description here" -authors = ["Johannes Nussbaum "] +authors = [{name = "Johannes Nussbaum", email = "johannes.nussbaum@dasch.swiss"}] readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "loguru>=0.7.2", +] -[tool.poetry.dependencies] -python = "^3.12" -loguru = "^0.7.2" - - -[tool.poetry.group.dev.dependencies] -pytest = "^8.2.1" -mypy = "^1.10.0" -ruff = "^0.4.5" -pre-commit = "^3.7.0" +[tool.uv] +dev-dependencies = [ + "pytest>=8.2.1", + "mypy>=1.11.2", + "ruff>=0.6.9", + "pre-commit>=3.8.0", +] [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build" [tool.pytest.ini_options]