Modernize packaging: migrate setup.py to PEP 621 pyproject.toml#645
Modernize packaging: migrate setup.py to PEP 621 pyproject.toml#645joshmarkovic wants to merge 1 commit into
Conversation
- 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 |
There was a problem hiding this comment.
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.
| azure = [ | ||
| "azure-identity>=1.12.0", | ||
| ] | ||
| dev = [ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
this is the correct structure example:
[project.optional-dependencies]
external = [...]
another = [...]
[dependency-groups]
dev = [...]
|
@joshmarkovic I migrated this to uv, thats why you have conflicts, PEP 621 + 735. |
import pyodbcwas not, leaving fresh installs broken.azureextra. The code already guards azure imports with try/except ModuleNotFoundError, so this makes the optionality first-class: pip install dbt-sqlserver[azure].devextra; retire dev_requirements.txt. Use pip install -e .[dev].python -m buildand an inline tag/version match instead ofpython setup.py sdist bdist_wheeland the old VerifyVersionCommand.