Skip to content

Commit f71ed8d

Browse files
authored
Refine dependencies to improve compatibility with core (#277)
* Refine dependencies to improve compatibility with core * Add nox test to verify that autofix does not conflict with core * Clarify that Python 3.14 is not compatible due to mashumaro version * Loosen pyyaml restriction for Python versions 3.10-3.12
1 parent f29afbf commit f71ed8d

File tree

6 files changed

+77
-150
lines changed

6 files changed

+77
-150
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Please describe the changes made and why they were made. Link to any relevant is
1111

1212
## Checklist
1313

14-
* [ ] Ran `uv tool ruff format --config pyproject.toml`
14+
* [ ] Ran `uv tool run ruff format --config pyproject.toml`
1515
* [ ] If this is a bug fix:
1616
* [ ] Updated integration tests with bug repro
1717
* [ ] Linked to bug report ticket

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ project2/*
2222
.DS_Store
2323

2424
# raw package hub output (because big)
25-
src/dbt_autofix/packages/scripts/output/*
25+
src/dbt_autofix/packages/scripts/output/*
26+
# profiles.yml temporarily added by unit tests
27+
tests/integration_tests/package_upgrades/dbt_utils_package_lookup_map_2/profiles.yml

noxfile.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,43 @@ def test_pre_commit_installation(session):
7474
"non_existent_file",
7575
"--verbose",
7676
)
77+
78+
79+
@nox.session(python=["3.10", "3.11", "3.12", "3.13"], venv_backend="uv")
80+
def test_core_1_10_installation(session):
81+
"""Test that dbt-autofix can be installed with dbt-core"""
82+
session.run_install(
83+
"uv",
84+
"sync",
85+
"--all-packages",
86+
f"--python={session.virtualenv.location}",
87+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
88+
)
89+
session.run_install(
90+
"uv",
91+
"add",
92+
"dbt-core==1.10.6",
93+
f"--python={session.virtualenv.location}",
94+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
95+
)
96+
session.run("dbt-autofix", "--help")
97+
98+
99+
@nox.session(python=["3.10", "3.11", "3.12", "3.13"], venv_backend="uv")
100+
def test_core_1_12_installation(session):
101+
"""Test that dbt-autofix can be installed with dbt-core"""
102+
session.run_install(
103+
"uv",
104+
"sync",
105+
"--all-packages",
106+
f"--python={session.virtualenv.location}",
107+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
108+
)
109+
session.run_install(
110+
"uv",
111+
"add",
112+
"dbt-core==1.11.2",
113+
f"--python={session.virtualenv.location}",
114+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
115+
)
116+
session.run("dbt-autofix", "--help")

packages/dbt_fusion_package_tools/pyproject.toml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
name = "dbt-fusion-package-tools"
33
description = "Add your description here"
44
readme = "README.md"
5-
requires-python = ">=3.10"
5+
requires-python = ">=3.10, <3.14" # can't support 3.14 without mashumaro 3.15
66
dependencies = [
77
"gitpython>=3.1.45",
88
"mashumaro>=3.9,<3.15", # matches dbt-core
9-
"pyyaml>=6.0.2",
9+
"pyyaml>=6.0.2 ; python_version >= '3.13'", # need 6.0.2 for python 3.13 support
10+
"pyyaml>=6.0 ; python_version < '3.13'", # matches dbt-core
1011
"dbt-protos>=1.0.410",
11-
"requests>=2.32.5",
12+
"requests<3.0.0", # matches dbt-common
1213
"rich>=14.0.0",
14+
"click>=8.2.0,<9.0", # matches dbt-core
1315
]
1416

1517
dynamic = ["version"]
@@ -28,8 +30,3 @@ build-backend = "pdm.backend"
2830
[tool.pdm.version]
2931
source = "scm"
3032
version_format = "pdm_build:format_version"
31-
32-
[project.optional-dependencies]
33-
docs = [
34-
"pydocstyle>=6.3.0",
35-
]

pyproject.toml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
name = "dbt-autofix"
33
description = "CLI to autofix deprecations in dbt projects"
44
readme = "README.md"
5-
requires-python = ">=3.10"
5+
requires-python = ">=3.10, <3.14" # can't support 3.14 without mashumaro 3.15
66
dependencies = [
7-
"pyyaml>=6.0.2",
7+
"pyyaml>=6.0.2 ; python_version >= '3.13'", # need 6.0.2 for python 3.13 support
8+
"pyyaml>=6.0 ; python_version < '3.13'", # matches dbt-core
89
"typer>=0.16.0",
910
"yamllint>=1.37.0",
1011
"rich>=13.7.0",
@@ -40,9 +41,6 @@ test = [
4041
"pre-commit>=4.2.0",
4142
"nox",
4243
]
43-
docs = [
44-
"pydocstyle>=6.3.0",
45-
]
4644

4745
[tool.pdm.build]
4846
# Include pre_commit_hooks/ directory in distribution
@@ -65,9 +63,17 @@ indent-width = 4
6563
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
6664
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
6765
# McCabe complexity (`C901`) by default.
68-
select = ["E4", "E7", "E9", "F", "I", "RUF", "PL", "TID", "T20"]
69-
ignore = []
70-
66+
select = ["E4", "E7", "E9", "F", "I", "RUF", "PL", "TID", "T20", "D"]
67+
# Ignore some doc warnings
68+
# D100: Missing docstring in public module
69+
# D101: Missing docstring in public class
70+
# D102: Missing docstring in public method
71+
# D103: Missing docstring in public function
72+
# D104: Missing docstring in public package
73+
# D105: Missing docstring in magic method
74+
# D107: Missing docstring in __init__
75+
# D202: No blank lines allowed after function docstring
76+
ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "D202"]
7177

7278
[tool.pyright]
7379
include = [
@@ -93,17 +99,8 @@ pythonpath = [
9399
]
94100
addopts = "--ignore-glob=**/dbt_packages/**"
95101

96-
[tool.pydocstyle]
102+
[tool.ruff.lint.pydocstyle]
97103
convention = "google"
98-
# D100: Missing docstring in public module
99-
# D101: Missing docstring in public class
100-
# D102: Missing docstring in public method
101-
# D103: Missing docstring in public function
102-
# D104: Missing docstring in public package
103-
# D105: Missing docstring in magic method
104-
# D107: Missing docstring in __init__
105-
# D202: No blank lines allowed after function docstring
106-
add-ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "D202"]
107104

108105
[[tool.uv.index]]
109106
name = "testpypi"

0 commit comments

Comments
 (0)