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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

An extremely fast Python task runner.

> **Note:** This is an **independent, third-party project**, not an official Astral tool. It is highly inspired by and designed to work seamlessly with Astral's excellent tools (such as `uv`/`uvx`, `ruff`, and `ty`). We're grateful for the amazing work the Astral team does for the Python ecosystem!

## Highlights

- ⚡ **Extremely fast** - Built for speed with zero installation overhead
- 📝 **Simple configuration** - Define scripts in `pyproject.toml`
- 🔗 **Pre/post hooks** - Automatically run hooks before and after commands
- 🎨 **Beautiful output** - Colorful, `uv`-inspired CLI
- 🎨 **Consistent UX** - Maintains visual and stylistic continuity with `uv`'s design language

## 🎯 Quick Start

Expand All @@ -27,7 +29,7 @@ Or install it and use it directly:

```shell
uv add --dev uvtask
uvtask <OPTIONS> [COMMAND]
uv run uvtask <OPTIONS> [COMMAND]
```

## 📝 Configuration
Expand Down
7 changes: 7 additions & 0 deletions uvtask/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from importlib.metadata import PackageNotFoundError, version
from pathlib import Path
from tomllib import loads

Expand Down Expand Up @@ -102,6 +103,12 @@ def get_version(self) -> str:
data = self._reader.read()
return data.get("project", {}).get("version", "unknown")

def get_package_version(self) -> str:
try:
return version("uvtask")
except PackageNotFoundError:
return "unknown"


pyproject_reader = PyProjectReader(Path("pyproject.toml"))

Expand Down
2 changes: 1 addition & 1 deletion uvtask/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def build_main_parser(self) -> CustomArgumentParser:
"-V",
"--version",
action="version",
version=f"%(prog)s {self._version_loader.get_version()}",
version=f"%(prog)s {self._version_loader.get_package_version()}",
)

return parser
Expand Down