-
Notifications
You must be signed in to change notification settings - Fork 111
Modernize packaging: migrate setup.py to PEP 621 pyproject.toml #645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
axellpadilla
merged 7 commits into
dbt-msft:master
from
joshmarkovic:jm/modernize-packaging
May 20, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9b8b82a
Modernize packaging: migrate setup.py to PEP 621 pyproject.toml
joshmarkovic 5984830
Merge upstream/master, apply PR review feedback
joshmarkovic b0d1147
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1c0766e
Move pyodbc to optional
joshmarkovic f36d17e
Merge upstream/master (v1.9.1)
joshmarkovic 428bf17
Update pip install command for SQL Server integration
axellpadilla 7fb4612
Update pip install command to include pyodbc
axellpadilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env python3 | ||
| """Verify the packaged version matches the release git tag. | ||
|
|
||
| Usage: | ||
| python .github/scripts/verify_version.py <tag> | ||
|
|
||
| The tag typically comes from ``$GITHUB_REF_NAME`` and may be prefixed with | ||
| ``v`` (e.g. ``v1.9.1``). The leading ``v`` is stripped before comparison. | ||
|
|
||
| Exits 0 on match, 1 on mismatch, 2 on usage error. | ||
| """ | ||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[2] | ||
| VERSION_FILE = REPO_ROOT / "dbt" / "adapters" / "sqlserver" / "__version__.py" | ||
| VERSION_RE = re.compile(r"""version\s*=\s*["'](?P<version>.+?)["']""") | ||
|
|
||
|
|
||
| def read_package_version(version_file: Path = VERSION_FILE) -> str: | ||
| match = VERSION_RE.search(version_file.read_text()) | ||
| if not match: | ||
| raise ValueError(f"could not find version in {version_file}") | ||
| return match.group("version") | ||
|
|
||
|
|
||
| def main(argv: list[str]) -> int: | ||
| if len(argv) != 2: | ||
| print("usage: verify_version.py <tag>", file=sys.stderr) | ||
| return 2 | ||
| tag_version = argv[1].lstrip("v") | ||
| pkg_version = read_package_version() | ||
| if tag_version != pkg_version: | ||
| print( | ||
| f"Git tag {tag_version!r} does not match " f"package version {pkg_version!r}", | ||
| file=sys.stderr, | ||
| ) | ||
| return 1 | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main(sys.argv)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=68", "wheel"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "dbt-sqlserver" | ||
| description = "A Microsoft SQL Server adapter plugin for dbt" | ||
| readme = "README.md" | ||
| license = { text = "MIT" } | ||
| authors = [ | ||
| { name = "Mikael Ene" }, | ||
| { name = "Anders Swanson" }, | ||
| { name = "Sam Debruyn" }, | ||
| { name = "Cor Zuurmond" }, | ||
| { name = "Cody Scott" }, | ||
| ] | ||
| requires-python = ">=3.10" | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: Microsoft :: Windows", | ||
| "Operating System :: MacOS :: MacOS X", | ||
| "Operating System :: POSIX :: Linux", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| ] | ||
| dependencies = [ | ||
| "dbt-core>=1.9.0,<2.0", | ||
| "dbt-common>=1.0,<2.0", | ||
| "dbt-adapters>=1.11.0,<2.0", | ||
| ] | ||
| dynamic = ["version"] | ||
|
|
||
| [project.optional-dependencies] | ||
| azure = [ | ||
| "azure-identity>=1.12.0", | ||
| ] | ||
| pyodbc = [ | ||
| "pyodbc>=5.2.0", | ||
| ] | ||
|
|
||
|
axellpadilla marked this conversation as resolved.
|
||
| [dependency-groups] | ||
| dev = [ | ||
|
axellpadilla marked this conversation as resolved.
|
||
| "dbt-tests-adapter>=1.9.0,<2.0", | ||
| "azure-identity>=1.12.0", | ||
| "build", | ||
| "bumpversion", | ||
| "flaky", | ||
| "freezegun==1.4.0", | ||
| "ipdb", | ||
| "mypy==1.11.2", | ||
| "pre-commit", | ||
| "pytest", | ||
| "pytest-csv", | ||
| "pytest-dotenv", | ||
| "pytest-xdist", | ||
| "pytz", | ||
| "ruff", | ||
| "tox>=3.13", | ||
| "twine", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| "Setup & configuration" = "https://docs.getdbt.com/reference/warehouse-profiles/mssql-profile" | ||
| "Documentation & usage" = "https://docs.getdbt.com/reference/resource-configs/mssql-configs" | ||
| "Changelog" = "https://github.com/dbt-msft/dbt-sqlserver/blob/master/CHANGELOG.md" | ||
| "Issue Tracker" = "https://github.com/dbt-msft/dbt-sqlserver/issues" | ||
| "Source" = "https://github.com/dbt-msft/dbt-sqlserver" | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = { attr = "dbt.adapters.sqlserver.__version__.version" } | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| include = ["dbt", "dbt.*"] | ||
| namespaces = true | ||
|
|
||
| [tool.setuptools.package-data] | ||
| "dbt" = ["include/**/*.sql", "include/**/*.yml", "include/**/*.md"] | ||
| "dbt.adapters.sqlserver" = ["py.typed"] | ||
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.