Skip to content

Conversation

@amotl
Copy link
Member

@amotl amotl commented Dec 21, 2025

Just maintenance while modernizing project metadata: Remove outmoded setup.py, and transfer a few more details to new pyproject.toml.

@coderabbitai

This comment was marked as spam.

@amotl amotl force-pushed the rm-setup-py branch 4 times, most recently from 1feba49 to 9daed8a Compare December 21, 2025 00:30
@amotl amotl changed the title Project metadata: Remove setup.py Project metadata: Remove setup.py. Improve Python compatibility. Dec 21, 2025
@amotl amotl requested review from seut and surister and removed request for surister December 22, 2025 17:52
@amotl amotl marked this pull request as draft December 22, 2025 18:10
Base automatically changed from spdx-verlib2 to main December 22, 2025 21:46
@amotl amotl force-pushed the rm-setup-py branch 2 times, most recently from 4b4e060 to fd534ff Compare December 23, 2025 00:06
@amotl amotl marked this pull request as ready for review December 23, 2025 18:11
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also add the other supported python versions here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Fixed.

@amotl amotl requested a review from seut January 13, 2026 10:36
Copy link
Member

@seut seut left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!
Pinging @mfussenegger to ensure we do not miss any feedback on this.

description = "CrateDB Python Client"
authors = [{ name = "Crate.io", email = "office@crate.io" }]
requires-python = ">=3.10"
requires-python = ">=3.6"
Copy link
Member

Choose a reason for hiding this comment

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

Why do we lower this now? Afaik newer versions intentionally bumped this so that pip install on older python versions would install an old crate-python version - allowing us to drop compat logic for older versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

setup.py says python_requires=">=3.6", I've just transferred this to pyproject.toml.

# check if tag to create has already been created
WORKING_DIR=`dirname $0`
VERSION=`python setup.py --version`
VERSION=`hatch project metadata version`
Copy link
Member

Choose a reason for hiding this comment

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

This implies that there's now a hatch executable available in $PATH. Looks like this isn't mentioned in DEVELOP.rst - the whole file looks sort of outdated, together with the bootstrap.sh

Can we simplify that, so there's some sort of standard uv venv venv; uv pip install -Ue ".[dev]" with no special custom logic?

Copy link
Member Author

@amotl amotl Jan 13, 2026

Choose a reason for hiding this comment

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

Hatch was introduced with GH-739, but updating the files you've mentioned apparently has been missed. Let's track this with a separate ticket so @surister can address it?

Copy link
Member Author

@amotl amotl Jan 13, 2026

Choose a reason for hiding this comment

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

I've created a dedicated ticket. Thank you.

Copy link
Member

Choose a reason for hiding this comment

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

Why not fix it? Seems like things are sort of broken as they are in this PR

Copy link
Member Author

@amotl amotl Jan 13, 2026

Choose a reason for hiding this comment

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

Seems like things are sort of broken as they are in this PR.

This patch was merely thought cosmetic to remove setup.py as intended. GH-739 already made the project use Hatch, because pyproject.toml takes precedence even when using the traditional setuptools build backend like before. In this spirit, the project would already be broken right now?

Why not fix it?

Switching to setuptools again requires more changes, because standard setuptools uses a different format in pyproject.toml than hatch. Let's discuss here?

Copy link
Member

@mfussenegger mfussenegger Jan 13, 2026

Choose a reason for hiding this comment

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

Switching to setuptools again requires more changes, because standard setuptools uses a different format in pyproject.toml than hatch. Let's discuss #766 (comment)?

I don't see the advantage of going from A (broken) -> B (this version - also broken) -> C (version that works) when we can do A (broken) -> C (not broken).

Also note that this doesn't require switching away from hatch. It just needs to become a build time dependency that's documented. Could even make use of uvx hatch if we already depend on uv (which should also be documented if that's the case, and isn't mentioned)

Copy link
Member Author

@amotl amotl Jan 13, 2026

Choose a reason for hiding this comment

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

Hi. Apologies that I still can't follow what is exactly broken here. Can you share an error message? Hatch is currently a build time dependency, and this works well.

[build-system]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"

Copy link
Member Author

@amotl amotl Jan 13, 2026

Choose a reason for hiding this comment

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

I might be seeing the problem now: Is it hatchling vs. hatch? So, let's just add hatch, right! See 8a9a172.

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.

4 participants