diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 77445ac..610c158 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -69,7 +69,7 @@ jobs: - name: Upload package to artifact registry uses: actions/upload-artifact@v6 with: - name: uvtask + name: uvtask-${{ env.VERSION }} path: dist/ - name: Publish package diff --git a/README.md b/README.md index 198ab3e..b87328d 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ Define your scripts in `pyproject.toml` under the `[tool.run-script]` section: ```toml [tool.run-script] install = "uv sync --dev --all-extras" -format = "ruff format ." -lint = { command = "ruff check .", description = "Check code quality" } -check = ["ty check .", "mypy ."] +format = "uv run ruff format ." +lint = { command = "uv run ruff check .", description = "Check code quality" } +check = ["uv run ty check .", "uv run mypy ."] pre-test = "echo 'Running tests...'" -test = "pytest" +test = "uv run pytest" post-test = "echo 'Tests completed!'" deploy = [ "echo 'Building...'", diff --git a/pyproject.toml b/pyproject.toml index 2df4e8f..dde41a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,20 +125,23 @@ exclude = [ ] [tool.run-script] -install = "uv sync --frozen --no-dev" -upgrade-install = "uv sync --frozen --no-dev --upgrade --refresh" -dev-install = "uv sync --dev --all-extras" -upgrade-dev-install = "uv sync --dev --all-extras --upgrade --refresh" -code-formatter = "uv run ruff format uvtask tests" -"security-analysis:licenses" = "uv run pip-licenses" -"security-analysis:vulnerabilities" = "uv run bandit -r -c pyproject.toml uvtask tests" -"static-analysis:linter" = "uv run ruff check uvtask tests" -"static-analysis:types" = "uv run ty check uvtask tests" -unit-tests = "uv run pytest tests/unit" -integration-tests = "uv run pytest tests/integration" -functional-tests = "uv run pytest -n1 tests/functional" -coverage = "uv run pytest -n1 --cov --cov-report=html" -clean = """python3 -c " +install = { command = "uv sync --frozen --no-dev", description = "Install dependencies as specified in lockfile, excluding dev dependencies" } +upgrade-install = { command = "uv sync --frozen --no-dev --upgrade --refresh", description = "Upgrade and refresh installation of non-dev dependencies" } +dev-install = { command = "uv sync --dev --all-extras", description = "Install all dependencies including dev and extras" } +upgrade-dev-install = { command = "uv sync --dev --all-extras --upgrade --refresh", description = "Upgrade and refresh installation of all dependencies including dev and extras" } +code-formatter = { command = "uv run ruff format uvtask tests", description = "Format code with ruff" } +"security-analysis" = { command = ["security-analysis:licenses", "security-analysis:vulnerabilities"], description = "Run all security analysis checks" } +"security-analysis:licenses" = { command = "uv run pip-licenses", description = "Check third-party dependencies licenses using pip-licenses" } +"security-analysis:vulnerabilities" = { command = "uv run bandit -r -c pyproject.toml uvtask tests", description = "Scan code for security vulnerabilities using bandit" } +"static-analysis" = { command = ["static-analysis:linter", "static-analysis:types"], description = "Run all static analysis checks" } +"static-analysis:linter" = { command = "uv run ruff check uvtask tests", description = "Run linter checks using ruff" } +"static-analysis:types" = { command = "uv run ty check uvtask tests", description = "Run type checks using ty" } +test = { command = ["unit-tests", "integration-tests", "functional-tests"], description = "Run all tests with pytest" } +unit-tests = { command = "uv run pytest tests/unit", description = "Run unit tests with pytest" } +integration-tests = { command = "uv run pytest tests/integration", description = "Run integration tests with pytest" } +functional-tests = { command = "uv run pytest -n1 tests/functional", description = "Run functional tests with pytest" } +coverage = { command = "uv run pytest -n1 --cov --cov-report=html", description = "Run tests with coverage report in HTML using pytest" } +clean = { command = """python3 -c " from glob import iglob from shutil import rmtree @@ -146,7 +149,7 @@ for pathname in ['./build', './*.egg-info', './dist', './var', '**/__pycache__'] for path in iglob(pathname, recursive=True): rmtree(path, ignore_errors=True) " -""" +""", description = "Clean build artifacts" } [project.scripts] uvtask = "uvtask.cli:main" diff --git a/uvtask/cli.py b/uvtask/cli.py index fddbce3..b99197a 100644 --- a/uvtask/cli.py +++ b/uvtask/cli.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from sys import exit, stderr diff --git a/uvtask/colors.py b/uvtask/colors.py index a82a7a2..012b4e2 100644 --- a/uvtask/colors.py +++ b/uvtask/colors.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from enum import StrEnum from os import getenv from sys import argv, stderr diff --git a/uvtask/commands.py b/uvtask/commands.py index e1de628..a81683d 100644 --- a/uvtask/commands.py +++ b/uvtask/commands.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from sys import exit, stderr from uvtask.colors import color_service, preference_manager diff --git a/uvtask/config.py b/uvtask/config.py index 064ed0a..04316b8 100644 --- a/uvtask/config.py +++ b/uvtask/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path from tomllib import loads diff --git a/uvtask/executor.py b/uvtask/executor.py index 3b71624..2413c38 100644 --- a/uvtask/executor.py +++ b/uvtask/executor.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import subprocess from subprocess import run from sys import stderr diff --git a/uvtask/formatters.py b/uvtask/formatters.py index 4faae16..e00f072 100644 --- a/uvtask/formatters.py +++ b/uvtask/formatters.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import re from collections.abc import Iterable diff --git a/uvtask/hooks.py b/uvtask/hooks.py index dd53891..679f9d8 100644 --- a/uvtask/hooks.py +++ b/uvtask/hooks.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from sys import argv, exit, stderr from uvtask.colors import color_service diff --git a/uvtask/parser.py b/uvtask/parser.py index 8cf9399..5b5e860 100644 --- a/uvtask/parser.py +++ b/uvtask/parser.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from sys import argv from uvtask.colors import preference_manager