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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
python: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pdm sync -d
uv sync --locked --only-dev
- name: Run Prettier
uses: creyD/[email protected]
with:
dry: True
prettier_options: "--check **/*.{json,yaml,yml,md}"
- name: Run Tox
run: |
pdm run tox -e py,lint
uv run tox -e py,lint
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
python-version: 3.13
- name: Build
run: uv build
- name: Publish package distributions to PyPI
run: |
pdm publish
uv publish
- name: Install dependencies
run: |
pdm sync -G docs
uv sync --group docs
- name: Deploy docs
run: |
pdm run dbt-score list -f markdown -n dbt_score.rules.generic --title Generic > docs/rules/generic.md
pdm run mkdocs gh-deploy --force
uv run dbt-score list -f markdown -n dbt_score.rules.generic --title Generic > docs/rules/generic.md
uv run mkdocs gh-deploy --force
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ cover/
.pybuilder/
target/

# pdm
.pdm.toml
.pdm-python
.pdm-build/

# Environments
.env
.venv
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ repos:
- id: tox_lint
name: lint
description: Run lint
entry: pdm run tox -e lint
entry: uv run tox -e lint
language: system
pass_filenames: false
- id: tox_test
name: test
description: Run test
entry: pdm run tox -e py
entry: uv run tox -e py
language: system
pass_filenames: false
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
{
"label": "mypy",
"type": "shell",
"command": "pdm run mypy .",
"command": "uv run mypy .",
"problemMatcher": ["$go"]
},
{
"label": "ruff",
"type": "shell",
"command": "pdm run ruff check --fix .",
"command": "uv run ruff check --fix .",
"problemMatcher": ["$go"]
},
{
"label": "mkdocs serve",
"type": "shell",
"command": "pdm run mkdocs serve",
"command": "uv run mkdocs serve",
"problemMatcher": []
}
]
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to

## [Unreleased]

- Migrate to `uv` project manager.

## [0.14.0] - 2025-08-08

- Display the parse error message when `dbt parse` fails.
Expand Down
24 changes: 12 additions & 12 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ You'll need the following:

- Any Python version starting from 3.10
- [pre-commit](https://pre-commit.com/) (recommended)
- [PDM](https://pdm-project.org/2.12/)
- [uv](https://docs.astral.sh/uv/)

After cloning the repository with git, configure your development environment by
running these commands from the project's root:

```shell
pre-commit install
pdm install --group :all
uv sync --all-groups
```

The pdm command will install all project's dependency groups, including all the
The uv command will install all project's dependency groups, including all the
dependencies needed for development purposes.

### Lint
Expand All @@ -85,10 +85,10 @@ dependencies needed for development purposes.
Cheatsheet:

```shell
pdm run ruff check .
pdm run ruff check --fix
pdm run mypy .
pdm run tox -e lint
uv run ruff check .
uv run ruff check --fix
uv run mypy .
uv run tox -e lint
```

### Test
Expand All @@ -104,9 +104,9 @@ pdm run tox -e lint
Cheatsheet:

```shell
pdm run tox -e py
pdm run pytest
pdm run coverage run -m pytest
uv run tox -e py
uv run pytest
uv run coverage run -m pytest
```

### Docs
Expand All @@ -120,8 +120,8 @@ pdm run coverage run -m pytest
Cheatsheet:

```shell
pdm run mkdocs build
pdm run mkdocs serve
uv run mkdocs build
uv run mkdocs serve
```

### Pre-commit
Expand Down
1,781 changes: 0 additions & 1,781 deletions pdm.lock

This file was deleted.

18 changes: 7 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
requires = ["hatchling>=1.27.0, <2.0.0", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[project]
name = "dbt-score"
Expand Down Expand Up @@ -34,11 +37,10 @@ license = {text = "MIT"}
[project.scripts]
dbt-score = "dbt_score.__main__:main"

[tool.pdm]
[tool.pdm.dev-dependencies]
[dependency-groups]
dev = [
"dbt-core>=1.5",
"tox-pdm~=0.7.2",
"tox-uv~=1.28",
"tox~=4.13",
]
lint = [
Expand All @@ -54,12 +56,6 @@ docs = [
"mkdocstrings[python]~=0.26.0"
]

[tool.pdm.version]
source = "scm"

[tool.pdm.scripts]
dbt-score = {call = "dbt_score.__main__:main"}

### Mypy ###

[tool.mypy]
Expand Down
2 changes: 1 addition & 1 deletion src/dbt_score/dbt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DbtNotInstalledException(Exception):
class DbtParseException(Exception):
"""Raised when dbt parse fails."""

def __init__(self, root_cause: Exception | None = None):
def __init__(self, root_cause: BaseException | None = None):
"""Initialize the exception."""
super().__init__()
self.root_cause = root_cause
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ env_list = py{310,311,312,313},lint,docs
skip_missing_interpreters = true

[testenv]
runner = uv-venv-lock-runner
description = Run tests
groups = test
dependency_groups = test
commands =
pytest
coverage run -m pytest

[testenv:lint]
runner = uv-venv-lock-runner
description = Run lint
groups = lint, test
dependency_groups = lint, test
commands =
ruff check .
mypy .

[testenv:docs]
runner = uv-venv-lock-runner
description = Build docs
groups = docs
dependency_groups = docs
commands =
mkdocs build --clean
Loading