diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 00af7b0..69f52c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: enable-cache: true - name: Install dependencies - run: uv sync --no-install-project --group lint + run: uv sync --only-dev - name: Cache pre-commit uses: actions/cache@v4 @@ -27,4 +27,4 @@ jobs: key: precommit-${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit - run: make fmt + run: uv run pre-commit run --all-files diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bb9fa1..9a04723 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: enable-cache: true - name: Install dependencies - run: uv sync --group test + run: uv sync - name: Run tests and generate coverage report run: make coverage diff --git a/README.md b/README.md index 663006f..a7592b3 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,9 @@ Simply run `make` to get an overview of available commands. [uv](https://docs.astral.sh/uv/) is an amazing, modern tool for developing Python packages. -Note that the dependency specification for this repository contains two [dependency groups](https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups): - -- `test`: Includes all testing dependencies. -- `lint`: Includes all linting dependencies. This can be useful to help your IDE do autoformatting or show in-line linting errors. - -Having these development dependencies in separate groups makes it easy to install only the required dependencies in the CI workflows. +Note that the dependency specification for this repository contains a single `dev` [dependency group](https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups). +With the speed that uv offers, it's not really required to further split this out into a `test` and `lint` group, for example. +Furthermore, using `dev` is the default and this offers some minor integration benefits. ## GitHub Actions diff --git a/pyproject.toml b/pyproject.toml index 50438ed..3679aa4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,14 +16,12 @@ dependencies = [ mycli = 'mypackage.__main__:main' [dependency-groups] -test = [ +dev = [ "coverage>=7.6.10", - "pytest>=8.3.4", - "pytest-mock>=3.14.0", -] -lint = [ "mypy>=1.14.1", "pre-commit>=4.1.0", + "pytest>=8.3.4", + "pytest-mock>=3.14.0", "ruff>=0.9.4", ] @@ -32,8 +30,9 @@ requires = ["hatchling"] build-backend = "hatchling.build" [tool.uv] -required-version = ">=0.5,<0.6" -default-groups = ["test", "lint"] +# TODO: Set to ">=0.5,<0.6" when bug is fixed +# https://github.com/astral-sh/setup-uv/issues/264 +required-version = "<0.6" [tool.ruff] src = ["src"] diff --git a/uv.lock b/uv.lock index 5953600..5060357 100644 --- a/uv.lock +++ b/uv.lock @@ -112,30 +112,26 @@ dependencies = [ ] [package.dev-dependencies] -lint = [ +dev = [ + { name = "coverage" }, { name = "mypy" }, { name = "pre-commit" }, - { name = "ruff" }, -] -test = [ - { name = "coverage" }, { name = "pytest" }, { name = "pytest-mock" }, + { name = "ruff" }, ] [package.metadata] requires-dist = [{ name = "polars", specifier = ">=1.21.0" }] [package.metadata.requires-dev] -lint = [ +dev = [ + { name = "coverage", specifier = ">=7.6.10" }, { name = "mypy", specifier = ">=1.14.1" }, { name = "pre-commit", specifier = ">=4.1.0" }, - { name = "ruff", specifier = ">=0.9.4" }, -] -test = [ - { name = "coverage", specifier = ">=7.6.10" }, { name = "pytest", specifier = ">=8.3.4" }, { name = "pytest-mock", specifier = ">=3.14.0" }, + { name = "ruff", specifier = ">=0.9.4" }, ] [[package]]