HonahX commented on code in PR #3410: URL: https://github.com/apache/polaris/pull/3410#discussion_r2679134917
########## client/python/pyproject.toml: ########## @@ -44,39 +46,48 @@ repository = "https://github.com/apache/polaris/" [project.scripts] polaris = "apache_polaris.cli.polaris_cli:main" -[tool.poetry] -requires-poetry = "==2.2.1" -packages = [ - { include = "apache_polaris" } +[dependency-groups] +dev = [ + "pytest>= 7.2.1", + "pytest-cov>= 2.8.1", + "flake8>= 4.0.0", + "types-python-dateutil>= 2.8.19.14", + "mypy>=1.19, <=1.19.1", + "pyiceberg==0.10.0", + "pre-commit==4.5.1", + # 7.12.0 is the latest version to use due to OpenAPI spec version we are using + "openapi-generator-cli==7.12.0", + "pip-licenses-cli==3.0.1", ] + +[tool.hatch.build.targets.sdist] include = [ - { path = "apache_polaris/cli", format = ["sdist", "wheel"] }, - { path = "apache_polaris/sdk", format = ["sdist", "wheel"] }, - { path = "templates/**", format = "sdist" }, - { path = "spec/**", format = "sdist" }, + "generate_clients.py", + "apache_polaris", + "templates/", + ".openapi-generator-ignore" ] -[tool.poetry.group.dev.dependencies] -pytest = ">= 7.2.1" -pytest-cov = ">= 2.8.1" -flake8 = ">= 4.0.0" -types-python-dateutil = ">= 2.8.19.14" -mypy = ">=1.19, <=1.19.1" -pyiceberg = "==0.10.0" -pre-commit = "==4.5.1" -# 7.12.0 is the latest version to use due to OpenAPI spec version we are using -openapi-generator-cli = "==7.12.0" -pip-licenses-cli = "==3.0.1" +[tool.hatch.build.targets.sdist.force-include] +"spec" = "spec/" -[tool.pip-licenses] -partial-match = true -allow-only = "Apache;BSD License;BSD-3-Clause;ISC;MIT;Mozilla Public License;PSF-2.0;Python Software Foundation License;The Unlicense" +[tool.hatch.build.targets.wheel] +include = ["apache_polaris"] + +[tool.hatch.build.hooks.custom] +path = "hatch_build.py" [build-system] # 7.12.0 is the latest version to use due to OpenAPI spec version we are using -requires = ["poetry-core==2.2.1", "openapi-generator-cli==7.12.0"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling", "openapi-generator-cli==7.12.0"] +build-backend = "hatchling.build" Review Comment: This solves the problem with `poetry.core.masonry.api` that we cannot build universal wheel if using custom build script. I checked that now with `make client-build`, we will get ``` Successfully built dist/apache_polaris-1.4.0.tar.gz Successfully built dist/apache_polaris-1.4.0-py3-none-any.whl ``` This could significantly simplify the nightly build/release process that we do not need the additional wheel build workflow anymore: https://github.com/apache/polaris/pull/3036 ########## .gitignore: ########## @@ -20,12 +20,10 @@ regtests/derby.log regtests/metastore_db regtests/output/ -# This file, if checked in after running for example regtests, contains unmanaged dependencies that eventually -# cause unnecessary "security alerts" like https://github.com/apache/polaris/pull/718. Review Comment: [Question] Should we keep this comment since it explains why we exclude `*.lock" file from git? To be honest, I also wondered for a while why poetry.lock was excluded intially. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
