Skip to content

Commit 481aeac

Browse files
Migrate to uv (#132)
Migrate from `pdm` to `uv`.
1 parent 47cf9d3 commit 481aeac

File tree

12 files changed

+1829
-1831
lines changed

12 files changed

+1829
-1831
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
python: ["3.10", "3.11", "3.12", "3.13"]
1818

1919
steps:
20-
- uses: actions/checkout@v4
21-
- name: Set up PDM
22-
uses: pdm-project/setup-pdm@v4
20+
- uses: actions/checkout@v5
21+
- name: Install uv and set the Python version
22+
uses: astral-sh/setup-uv@v6
2323
with:
2424
python-version: ${{ matrix.python }}
2525
- name: Install dependencies
2626
run: |
27-
pdm sync -d
27+
uv sync --locked --only-dev
2828
- name: Run Prettier
2929
uses: creyD/[email protected]
3030
with:
3131
dry: True
3232
prettier_options: "--check **/*.{json,yaml,yml,md}"
3333
- name: Run Tox
3434
run: |
35-
pdm run tox -e py,lint
35+
uv run tox -e py,lint

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,23 @@ jobs:
1414
contents: write
1515

1616
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up PDM
19-
uses: pdm-project/setup-pdm@v4
17+
- uses: actions/checkout@v5
18+
- name: Install uv and set the Python version
19+
uses: astral-sh/setup-uv@v6
2020
with:
21-
python-version: "3.11"
21+
python-version: 3.13
22+
- name: Build
23+
run: uv build
2224
- name: Publish package distributions to PyPI
2325
run: |
24-
pdm publish
26+
uv publish
2527
- name: Install dependencies
2628
run: |
27-
pdm sync -G docs
29+
uv sync --group docs
2830
- name: Deploy docs
2931
run: |
30-
pdm run dbt-score list -f markdown -n dbt_score.rules.generic --title Generic > docs/rules/generic.md
31-
pdm run mkdocs gh-deploy --force
32+
uv run dbt-score list -f markdown -n dbt_score.rules.generic --title Generic > docs/rules/generic.md
33+
uv run mkdocs gh-deploy --force
3234
- uses: ncipollo/release-action@v1
3335
with:
3436
generateReleaseNotes: true

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ cover/
6262
.pybuilder/
6363
target/
6464

65-
# pdm
66-
.pdm.toml
67-
.pdm-python
68-
.pdm-build/
69-
7065
# Environments
7166
.env
7267
.venv

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ repos:
2525
- id: tox_lint
2626
name: lint
2727
description: Run lint
28-
entry: pdm run tox -e lint
28+
entry: uv run tox -e lint
2929
language: system
3030
pass_filenames: false
3131
- id: tox_test
3232
name: test
3333
description: Run test
34-
entry: pdm run tox -e py
34+
entry: uv run tox -e py
3535
language: system
3636
pass_filenames: false

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
{
55
"label": "mypy",
66
"type": "shell",
7-
"command": "pdm run mypy .",
7+
"command": "uv run mypy .",
88
"problemMatcher": ["$go"]
99
},
1010
{
1111
"label": "ruff",
1212
"type": "shell",
13-
"command": "pdm run ruff check --fix .",
13+
"command": "uv run ruff check --fix .",
1414
"problemMatcher": ["$go"]
1515
},
1616
{
1717
"label": "mkdocs serve",
1818
"type": "shell",
19-
"command": "pdm run mkdocs serve",
19+
"command": "uv run mkdocs serve",
2020
"problemMatcher": []
2121
}
2222
]

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
- Migrate to `uv` project manager.
12+
1113
## [0.14.0] - 2025-08-08
1214

1315
- Display the parse error message when `dbt parse` fails.

docs/contributing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ You'll need the following:
6060

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

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

6868
```shell
6969
pre-commit install
70-
pdm install --group :all
70+
uv sync --all-groups
7171
```
7272

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

7676
### Lint
@@ -85,10 +85,10 @@ dependencies needed for development purposes.
8585
Cheatsheet:
8686

8787
```shell
88-
pdm run ruff check .
89-
pdm run ruff check --fix
90-
pdm run mypy .
91-
pdm run tox -e lint
88+
uv run ruff check .
89+
uv run ruff check --fix
90+
uv run mypy .
91+
uv run tox -e lint
9292
```
9393

9494
### Test
@@ -104,9 +104,9 @@ pdm run tox -e lint
104104
Cheatsheet:
105105

106106
```shell
107-
pdm run tox -e py
108-
pdm run pytest
109-
pdm run coverage run -m pytest
107+
uv run tox -e py
108+
uv run pytest
109+
uv run coverage run -m pytest
110110
```
111111

112112
### Docs
@@ -120,8 +120,8 @@ pdm run coverage run -m pytest
120120
Cheatsheet:
121121

122122
```shell
123-
pdm run mkdocs build
124-
pdm run mkdocs serve
123+
uv run mkdocs build
124+
uv run mkdocs serve
125125
```
126126

127127
### Pre-commit

pdm.lock

Lines changed: 0 additions & 1781 deletions
This file was deleted.

pyproject.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[build-system]
2-
requires = ["pdm-backend"]
3-
build-backend = "pdm.backend"
2+
requires = ["hatchling>=1.27.0, <2.0.0", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[tool.hatch.version]
6+
source = "vcs"
47

58
[project]
69
name = "dbt-score"
@@ -34,11 +37,10 @@ license = {text = "MIT"}
3437
[project.scripts]
3538
dbt-score = "dbt_score.__main__:main"
3639

37-
[tool.pdm]
38-
[tool.pdm.dev-dependencies]
40+
[dependency-groups]
3941
dev = [
4042
"dbt-core>=1.5",
41-
"tox-pdm~=0.7.2",
43+
"tox-uv~=1.28",
4244
"tox~=4.13",
4345
]
4446
lint = [
@@ -54,12 +56,6 @@ docs = [
5456
"mkdocstrings[python]~=0.26.0"
5557
]
5658

57-
[tool.pdm.version]
58-
source = "scm"
59-
60-
[tool.pdm.scripts]
61-
dbt-score = {call = "dbt_score.__main__:main"}
62-
6359
### Mypy ###
6460

6561
[tool.mypy]

src/dbt_score/dbt_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DbtNotInstalledException(Exception):
2121
class DbtParseException(Exception):
2222
"""Raised when dbt parse fails."""
2323

24-
def __init__(self, root_cause: Exception | None = None):
24+
def __init__(self, root_cause: BaseException | None = None):
2525
"""Initialize the exception."""
2626
super().__init__()
2727
self.root_cause = root_cause

0 commit comments

Comments
 (0)