-
Notifications
You must be signed in to change notification settings - Fork 158
Convert setup.py to pyproject.toml
#593
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
f5db213 to
9fc12fd
Compare
9fc12fd to
98188bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
98188bd to
db34b5e
Compare
| platforms='any', | ||
| classifiers=[ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| 'License :: OSI Approved :: Apache Software License', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a classifier as license apache but in the license file you say "MIT". Under what license is this project released?
| 'dbt-adapters>=1.16.7,<1.17', # This version should be dbt-adapters>=1.16.7,<2.0, but keeping it fixed for now to avoid unexpected issues. We need to frequently update it. | ||
| 'clickhouse-connect>=0.10.0', | ||
| 'clickhouse-driver>=0.2.10', | ||
| 'setuptools>=0.69', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, I assumed this was a mistake and you meant version 69.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| def test_version_compatibility(): | ||
| """Check our version is never newer than dbts version""" |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the comment: "dbts version" should be "dbt's version" or "dbt version".
| """Check our version is never newer than dbts version""" | |
| """Check our version is never newer than dbt's version""" |
| @@ -1,3 +1,55 @@ | |||
| [build-system] | |||
| requires = ["setuptools>=69", "wheel"] | |||
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setuptools version requirement was changed from "setuptools>=0.69" in setup.py to "setuptools>=69" in both the build-system requirements and runtime dependencies. This is a significant increase (from version 0.69 to version 69.x) and may break installations on older systems. While this may be intentional for the migration to pyproject.toml, please verify this is the intended version requirement change and ensure it's documented in the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For @koletzilla to confirm if this is needed and it was a mistake (the runtime one, the build time one should not matter)
Move to declarative packaging to provide better tooling integration and build isolation (by enabling `python-build`). This will run the build in isolation with the environment and being explicit about the dependencies that are used to build the sdists and bdists, making sure that the build is reproducible and isolated. The check for the version compatibility has been moved to a unit test, to move any scripting out of the project metadata.
db34b5e to
08c5987
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
| [tool.setuptools.package-data] | ||
| "dbt.include.clickhouse" = [ | ||
| "dbt_project.yml", | ||
| "sample_profiles.yml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package data references non-existent file
Medium Severity
The package data configuration references sample_profiles.yml, but this file doesn't exist in the repository. The original setup.py did not include this file in its package_data configuration, so this appears to be an erroneous addition during the migration to pyproject.toml. While the build won't fail (setuptools silently skips missing files), the package won't include the expected sample profile that might be needed by users.
| f"Invalid metadata in pyproject.toml: package_version={clickhouse_version_str} is greater than " | ||
| f"dbt version. The adapter version should indicate the minimum supported " | ||
| f"dbt version. Current installed dbt-core version is {dbt_version_str}." | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version test semantics differ from original build check
Medium Severity
The new version compatibility test has fundamentally different semantics from the original setup.py check. The original checked if the package version started with a hardcoded "1.9" string (static, build-time validation). The new test compares clickhouse_version <= dbt_version against the installed dbt-core (dynamic, test-time validation). This causes test failures when running against the minimum supported dbt-core>=1.9 (e.g., 1.9.0) while the adapter is 1.9.7, since Version("1.9.7") <= Version("1.9.0") is False. The original protection against misaligned version bumps is also lost.
Summary
Move to declarative packaging to provide better tooling integration and build isolation (by enabling
python-build).This will run the build in isolation with the environment and being explicit about the dependencies that are used to build the sdists and bdists, making sure that the build is reproducible and isolated.
The check for the version compatibility has been moved to a unit test, to move any scripting out of the project metadata.
Checklist
Delete items not relevant to your PR:
Let me know if you want me to add things to changelog/docs.
Relates to #592
Note
Moves packaging to declarative config and modern build tooling.
setup.pywithpyproject.toml(PEP 517/518): defines build backend, project metadata, dependencies, packages, package data, and dynamic version fromdbt.adapters.clickhouse.__version__build/twineand build viapython -m buildtests/unit/test_version_compatibility.pyto assert adapter version <= installeddbt-coreversionWritten by Cursor Bugbot for commit 08c5987. This will update automatically on new commits. Configure here.