From 3fa56ccf284598b417d68b664d1707f9562dd307 Mon Sep 17 00:00:00 2001 From: dorschw <81086590+dorschw@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:00:20 +0200 Subject: [PATCH] uv --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/pytest.yml | 7 +-- .github/workflows/release.yml | 5 +- pyproject.toml | 80 ++++++++++++++++---------------- 4 files changed, 45 insertions(+), 49 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 363bd94..738b7cc 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,4 +10,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pre-commit/action@v3.0.1 + - uses: tox-dev/action-pre-commit-uv@v1 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3bc9b54..207afa7 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Install dependencies - run: poetry install --with dev + - uses: tox-dev/action-pre-commit-uv@v1 - name: Run pytest - run: poetry run pytest . + run: uv run pytest . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7b808d..ead7482 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: tox-dev/action-pre-commit-uv@v1 - name: Build and publish to PyPi - uses: JRubics/poetry-publish@v2.0 with: - pypi_token: ${{ secrets.PYPI_TOKEN }} + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: uv publish diff --git a/pyproject.toml b/pyproject.toml index e4b006b..65756cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,45 +1,6 @@ -[tool.poetry] -name = "riff" -version = "0.1.9.0" -description = "Run ruff, but only fail on modified lines." -authors = ["dorschw <81086590+dorschw@users.noreply.github.com>"] -license = "MIT" -readme = "README.md" -exclude = ["riff/release", "riff/tests"] - -[tool.poetry.urls] -"Homepage" = "https://github.com/dorschw/riff" -"Source" = "https://github.com/dorschw/riff" -"Bug Tracker" = "https://github.com/dorschw/riff/issues" - -[tool.poetry.dependencies] -python = "^3.10" -typer = ">=0.7.0" -unidiff = "^0.7.5" -loguru = "^0.7.0" -gitpython = "^3.1.27" -packaging = "^23.2" - - -[tool.poetry.group.dev] -optional = true - -[tool.poetry.group.dev.dependencies] -ruff = "^0.8.1" -pre-commit = "^4.0.0" -pytest = "^8.0.0" -ipykernel = "^6.25.1" -toml = "^0.10.2" -types-unidiff = "^0.7.0.20240505" -types-toml = "^0.10.8.20240310" -pytest-mock = "^3.14.0" - -[tool.poetry.scripts] -riff = "riff.riff:app" - [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build" [tool.ruff] lint.select = ["ALL"] @@ -62,3 +23,40 @@ line-length = 88 [tool.ruff.lint.flake8-tidy-imports.banned-api] "loguru".msg = "use riff.logger instead" + +[project] +name = "riff" +version = "0.1.9.0" +description = "Run ruff, but only fail on modified lines." +authors = [{"name"="dorschw", "email"="81086590+dorschw@users.noreply.github.com"},] +license = "MIT" +readme = "README.md" +exclude = ["riff/release", "riff/tests"] + +dependencies = [ + "gitpython == 3.1.43", + "loguru == 0.7.3", + "packaging == 23.2", + "python >=3.10", + "typer == 0.15.1", + "unidiff == 0.7.5", + ] +[project.scripts] +riff = "riff.riff:app" + +[project.optional-dependencies] +dev = [ + "ruff == 0.8.3", + "pre-commit == 4.0.1", + "pytest == 8.3.4", + "ipykernel == 6.29.5", + "toml == 0.10.2", + "types-unidiff == 0.7.0.20240505", + "types-toml == 0.10.8.20240310", + "pytest-mock == 3.14.0", + ] + +[project.urls] +"Homepage" = "https://github.com/dorschw/riff" +"Source" = "https://github.com/dorschw/riff" +"Bug Tracker" = "https://github.com/dorschw/riff/issues"