Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests-sqlserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Regular
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python_version: ["3.10", "3.11", "3.12", "3.13"]
msodbc_version: ["17", "18"]
sqlserver_version: ["2017", "2019", "2022"]
collation: ["SQL_Latin1_General_CP1_CS_AS", "SQL_Latin1_General_CP1_CI_AS"]
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run: pip install -r dev_requirements.txt
run: pip install -e ".[dev]"

- name: Run functional tests
run: pytest -ra -v tests/functional --profile "ci_sql_server"
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'

- name: Install dependencies
run: pip install -r dev_requirements.txt
- name: Install build tooling
run: pip install build twine

- name: Verify version match
run: python setup.py verify
- name: Verify version matches tag
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this python script to an actual script rather than inline? Right now this python code can't get tested or go through our normal python pre-commit steps.

env:
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
python - <<'PY'
import os, re, sys
tag = os.environ["GITHUB_REF_NAME"]
tag_version = tag.lstrip("v")
with open("dbt/adapters/sqlserver/__version__.py") as f:
match = re.search(r"""version\s*=\s*["'](.+)["']""", f.read())
if not match:
sys.exit("could not find version in __version__.py")
pkg_version = match.group(1)
if tag_version != pkg_version:
sys.exit(
f"Git tag {tag_version!r} does not match package version {pkg_version!r}"
)
PY

- name: Initialize .pypirc
run: |
Expand All @@ -31,5 +47,5 @@ jobs:

- name: Build and publish package
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Unit tests
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python_version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run: pip install -r dev_requirements.txt
run: pip install -e ".[dev]"

- name: Run unit tests
run: pytest -n auto -ra -v tests/unit
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ THREADS ?= auto
.PHONY: dev
dev: ## Installs adapter in develop mode along with development dependencies
@\
pip install -r dev_requirements.txt && pre-commit install
pip install -e ".[dev]" && pre-commit install

.PHONY: mypy
mypy: ## Runs mypy against staged changes for static type checking.
Expand Down
Empty file added dbt/adapters/sqlserver/py.typed
Empty file.
24 changes: 0 additions & 24 deletions dev_requirements.txt

This file was deleted.

77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[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",
"pyodbc>=4.0.35,<5.2.0",
]
dynamic = ["version"]

[project.optional-dependencies]
azure = [
"azure-identity>=1.12.0",
]
dev = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want people to be able to do dbt-sqlserver[dev] to install? Would it make more sense to put these into dependency-groups so that consumers of the package can't install the dev stuff, people developing could do uv sync --group dev?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the correct structure example:
[project.optional-dependencies]
external = [...]
another = [...]

[dependency-groups]
dev = [...]

"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"]
94 changes: 0 additions & 94 deletions setup.py

This file was deleted.