Skip to content

Modernize packaging: migrate setup.py to PEP 621 pyproject.toml#645

Open
joshmarkovic wants to merge 1 commit into
dbt-msft:masterfrom
joshmarkovic:jm/modernize-packaging
Open

Modernize packaging: migrate setup.py to PEP 621 pyproject.toml#645
joshmarkovic wants to merge 1 commit into
dbt-msft:masterfrom
joshmarkovic:jm/modernize-packaging

Conversation

@joshmarkovic
Copy link
Copy Markdown

  • Replace setup.py with pyproject.toml (setuptools backend), reading version dynamically from dbt/adapters/sqlserver/version.py.
  • Restore pyodbc>=4.0.35,<5.2.0 as a direct dependency. It was previously pulled in transitively via dbt-fabric; that dep was dropped in 1.9.1rc1 but the runtime import pyodbc was not, leaving fresh installs broken.
  • Move azure-identity to an azure extra. The code already guards azure imports with try/except ModuleNotFoundError, so this makes the optionality first-class: pip install dbt-sqlserver[azure].
  • Move dev tooling to a dev extra; retire dev_requirements.txt. Use pip install -e .[dev].
  • Drop MANIFEST.in in favor of [tool.setuptools.package-data].
  • Ship dbt/adapters/sqlserver/py.typed.
  • requires-python = ">=3.10"; drop the Python 3.9 classifier (3.9 reached EOL in October 2025).
  • Update unit/integration/release workflows + Makefile accordingly. The release workflow now uses python -m build and an inline tag/version match instead of python setup.py sdist bdist_wheel and the old VerifyVersionCommand.

- Replace setup.py with pyproject.toml (setuptools backend), reading
  version dynamically from dbt/adapters/sqlserver/__version__.py.
- Restore pyodbc>=4.0.35,<5.2.0 as a direct dependency. It was
  previously pulled in transitively via dbt-fabric; that dep was
  dropped in 1.9.1rc1 but the runtime `import pyodbc` was not,
  leaving fresh installs broken.
- Move azure-identity to an `azure` extra. The code already guards
  azure imports with try/except ModuleNotFoundError, so this makes
  the optionality first-class: pip install dbt-sqlserver[azure].
- Move dev tooling to a `dev` extra; retire dev_requirements.txt.
  Use pip install -e .[dev].
- Drop MANIFEST.in in favor of [tool.setuptools.package-data].
- Ship dbt/adapters/sqlserver/py.typed.
- requires-python = ">=3.10"; drop the Python 3.9 classifier
  (3.9 reached EOL in October 2025).
- Update unit/integration/release workflows + Makefile accordingly.
  The release workflow now uses `python -m build` and an inline
  tag/version match instead of `python setup.py sdist bdist_wheel`
  and the old VerifyVersionCommand.

- 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.

Comment thread pyproject.toml
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 = [...]

@axellpadilla
Copy link
Copy Markdown
Collaborator

@axellpadilla axellpadilla added this to the v1.10.0 milestone May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants