Skip to content

Commit d6ff468

Browse files
authored
Merge pull request #109 from dbt-labs/move-to-uv
2 parents b1caade + 56f3e7a commit d6ff468

6 files changed

Lines changed: 923 additions & 50 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ jobs:
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040

41-
- name: Install Poetry
42-
uses: snok/install-poetry@v1
43-
44-
- name: Install dependencies
45-
run: |
46-
poetry install
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v3
4743

4844
- name: Run pytest (parallel)
4945
if: matrix.python-version != '3.13'

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
with:
3333
persist-credentials: false
3434

35-
- name: Install Poetry
36-
uses: snok/install-poetry@v1
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v3
3737

3838
- name: Build artifacts
39-
run: poetry build
39+
run: uv build
4040

4141
- name: Publish artifacts to PyPI Test
4242
if: inputs.deploy-to == 'PypiTest'

CONTRIBUTING.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ discussions and issues. We encourage you to first read our higher-level document
1313

1414
The rest of this document serves as a more granular guide for contributing code changes to `dbt-jobs-as-code` (this
1515
repository). It is not intended as a guide for using `dbt-jobs-as-code`, and some pieces assume a level of familiarity
16-
with Python development (poetry, pip, etc). Specific code snippets in this guide assume you are using macOS or Linux and
16+
with Python development (uv, pip, etc). Specific code snippets in this guide assume you are using macOS or Linux and
1717
are comfortable with the command line.
1818

1919
## Getting the code
20+
2021
## Installing git
2122

22-
You will need git in order to download and modify this project's source code. On macOS, the best way to download git is
23-
to just install Xcode.
23+
You will need git in order to download and modify this project's source code. On macOS, the best way to download git is to just install Xcode.
2424

2525
### External contributors
2626

@@ -49,7 +49,7 @@ There are some tools that will be helpful to you in developing locally. While th
4949

5050
These are the tools used in `dbt-jobs-as-code` development and testing:
5151

52-
- [`poetry`](https://python-poetry.org/docs/) for packaging and virtual environment setup.
52+
- [`uv`](https://docs.astral.sh/uv/) for packaging and virtual environment setup.
5353
- [`pytest`](https://docs.pytest.org/en/latest/) to define, discover, and run tests.
5454
- [`ruff`](https://github.com/astral-sh/ruff) for code linting and formatting.
5555

@@ -59,19 +59,21 @@ checking out the attached documentation if you're interested in learning more ab
5959
#### Virtual environments
6060

6161
We strongly recommend using virtual environments when developing code in `dbt-jobs-as-code`. We recommend creating this
62-
environment in the root of the `dbt-jobs-as-code` repository using `poetry`. To create a new environment, run:
62+
environment in the root of the `dbt-jobs-as-code` repository using `uv`. To create and activate a new environment, run:
6363
```sh
64-
poetry install
65-
poetry shell
64+
uv sync
65+
source .venv/bin/activate
6666
```
6767

6868
This will create and activate a new Python virtual environment.
6969

70+
Alternatively, you can just call `uv run dbt-jobs-as-code`
7071

7172
## Testing
7273

7374
Once you're able to manually test that your code change is working as expected, it's important to run existing automated
7475
tests, as well as adding some new ones. These tests will ensure that:
76+
7577
- Your code changes do not unexpectedly break other established functionality
7678
- Your code changes can handle all known edge cases
7779
- The functionality you're adding will _keep_ working in the future
@@ -81,10 +83,10 @@ With a virtualenv active and dev dependencies installed you can do things like:
8183

8284
```sh
8385
# Run all unit tests in a file
84-
poetry run pytest tests/exporter/test_export.py
86+
uv run pytest tests/exporter/test_export.py
8587

8688
# Run a specific unit test
87-
poetry run pytest tests/exporter/test_export.py::test_export_jobs_yml
89+
uv run pytest tests/exporter/test_export.py::test_export_jobs_yml
8890
```
8991

9092
## Submitting a Pull Request

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
test-parallel:
2-
poetry run pytest \
2+
uv run pytest \
33
-m 'not not_in_parallel'
44

55
test-full:
6-
poetry run pytest \
6+
uv run pytest \
77
--junitxml=coverage.xml \
88
--cov-report=term-missing:skip-covered \
99
--cov=src/dbt_jobs_as_code/

pyproject.toml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,54 @@
1-
[tool.poetry]
1+
[project]
2+
authors = [
3+
{name = "dbt Labs", email = "info@dbtlabs.com"},
4+
]
5+
license = {text = "Apache License 2.0"}
6+
requires-python = "<3.13,>=3.9"
7+
dependencies = [
8+
"click<9.0.0,>=8.1.3",
9+
"requests<3.0.0,>=2.32.0",
10+
"loguru<1.0.0,>=0.6.0",
11+
"deepdiff<7.0.0,>=6.2.2",
12+
"pydantic<3.0.0,>=2.0.0",
13+
"croniter<2.0.0,>=1.3.8",
14+
"ruamel-yaml<1.0.0,>=0.17.21",
15+
"rich<13.0.0,>=12.6.0",
16+
"PyYAML<7.0.0,>=6.0.1",
17+
"python-dateutil<3.0,>=2.9",
18+
"beartype<1.0.0,>=0.18.5",
19+
"jinja2<4.0.0,>=3.1.4",
20+
"importlib-metadata<7,>=6.0",
21+
]
222
name = "dbt-jobs-as-code"
323
version = "0.10.0"
424
description = "A CLI to allow defining dbt Cloud jobs as code"
5-
authors = ["dbt Labs <info@dbtlabs.com>"]
6-
license = "Apache License 2.0"
725
readme = "README.md"
8-
packages = [{include = "dbt_jobs_as_code", from = "src"}]
26+
keywords = [
27+
"dbt",
28+
"dbt Cloud",
29+
]
30+
31+
[project.urls]
932
repository = "https://github.com/dbt-labs/dbt-jobs-as-code.git"
10-
keywords = ["dbt", "dbt Cloud"]
1133

12-
[tool.poetry.dependencies]
13-
python = ">=3.9,<3.13"
14-
click = "^8.1.3"
15-
requests = "^2.32.0"
16-
loguru = "^0.6.0"
17-
deepdiff = "^6.2.2"
18-
pydantic = "^2.0.0"
19-
croniter = "^1.3.8"
20-
"ruamel.yaml" = "^0.17.21"
21-
rich = "^12.6.0"
22-
PyYAML = "^6.0.1"
23-
python-dateutil = "^2.9"
24-
beartype = "^0.18.5"
25-
jinja2 = "^3.1.4"
26-
importlib-metadata = ">=6.0,<7"
34+
[project.scripts]
35+
dbt-jobs-as-code = "dbt_jobs_as_code.main:cli"
2736

28-
[tool.poetry.group.dev.dependencies]
29-
coverage = "^7.6.3"
30-
jsonschema = "^4.17.3"
31-
pytest = "^7.2.0"
32-
pytest-beartype = "^0.0.2"
33-
pytest-cov = "^5.0.0"
37+
[dependency-groups]
38+
dev = [
39+
"coverage<8.0.0,>=7.6.3",
40+
"jsonschema<5.0.0,>=4.17.3",
41+
"pytest<8.0.0,>=7.2.0",
42+
"pytest-beartype<1.0.0,>=0.0.2",
43+
"pytest-cov<6.0.0,>=5.0.0",
44+
]
3445

35-
[tool.poetry.scripts]
36-
dbt-jobs-as-code = "dbt_jobs_as_code.main:cli"
46+
[tool.pdm.build]
47+
includes = ["src/dbt_jobs_as_code"]
3748

3849
[build-system]
39-
requires = ["poetry-core"]
40-
build-backend = "poetry.core.masonry.api"
50+
requires = ["pdm-backend"]
51+
build-backend = "pdm.backend"
4152

4253
[tool.pytest.ini_options]
4354
pythonpath = [

0 commit comments

Comments
 (0)