Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...'",
Expand Down
33 changes: 18 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,31 @@ 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

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"
Expand Down
2 changes: 2 additions & 0 deletions uvtask/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pathlib import Path
from sys import exit, stderr

Expand Down
2 changes: 2 additions & 0 deletions uvtask/colors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from enum import StrEnum
from os import getenv
from sys import argv, stderr
Expand Down
2 changes: 2 additions & 0 deletions uvtask/commands.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from sys import exit, stderr

from uvtask.colors import color_service, preference_manager
Expand Down
2 changes: 2 additions & 0 deletions uvtask/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pathlib import Path
from tomllib import loads

Expand Down
2 changes: 2 additions & 0 deletions uvtask/executor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import subprocess
from subprocess import run
from sys import stderr
Expand Down
2 changes: 2 additions & 0 deletions uvtask/formatters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import argparse
import re
from collections.abc import Iterable
Expand Down
2 changes: 2 additions & 0 deletions uvtask/hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from sys import argv, exit, stderr

from uvtask.colors import color_service
Expand Down
2 changes: 2 additions & 0 deletions uvtask/parser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from sys import argv

from uvtask.colors import preference_manager
Expand Down