Skip to content

Update project root dirs/files and introduce pyproject.toml + uv project manager. #379

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

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

stankudrow
Copy link

@stankudrow stankudrow commented May 30, 2025

Fixes #345 .

Similar to the #346 and #348 (closed) PRs.
Drags some changes from the #364 .
Prepares the ground for future drop of Python 3.8 ( #356 ) and Py3.9 with Py3.10 as a minimum version.
Enum tests are fixed to reduce warning messages ( partially in the #357 ).

Features: described in the CHANGELOG.md file.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should pass without the change. -> no need to.
  • Add or update relevant docs, in the docs folder and in code.
  • Ensure PR doesn't contain untouched code reformatting: spaces, etc.
  • Run flake8 and fix issues. -> done with flake8 and ruff.
  • Run pytest no tests failed. See https://clickhouse-sqlalchemy.readthedocs.io/en/latest/development.html. -> done as pytest --ignore=tests/types/test_json.py because of problems in the Fix tests #357 (won't be fixed in this PR).

@stankudrow stankudrow changed the title Update project root Update project root dirs/files and introduce pyproject.toml + uv project manager. May 30, 2025
@stankudrow stankudrow marked this pull request as draft May 30, 2025 08:11
@stankudrow
Copy link
Author

@DaniilAnichin, @9en9i, @dolfinus, @mayty, @jimenezj8, @xzkostyan , hello.

Could you possibly have thorough and multiple looks at this PR? I think it is high time for project refreshment concerning its infrastructure.

@stankudrow stankudrow marked this pull request as ready for review May 30, 2025 08:42
Comment on lines -7 to -8
VERSION = (0, 3, 2)
__version__ = '.'.join(str(x) for x in VERSION)
Copy link
Author

Choose a reason for hiding this comment

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

Honestly, I have not found an easier and cheaper way for uv to use dynamic versioning.

This solution - uv-dynamic-versioning - aims to retrieve data from a VCS.

I tried this solution - setuptools-scm - yet it didn't work (an unexpected version_file param or smth).

So, if you can find a better solution which allows the uv manager to support dynamic versioning in a cheap and an easy way, feel free to coautor and propose changes and even commits.

@@ -16,18 +16,14 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

from clickhouse_sqlalchemy import __version__, VERSION
# https://github.com/sphinx-toolbox/sphinx-pyproject
from sphinx_pyproject import SphinxConfig
Copy link
Author

Choose a reason for hiding this comment

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

This dependency is vital because the dynamic versioning is proposed to be replaced with a static one.

Copy link
Author

@stankudrow stankudrow Jun 1, 2025

Choose a reason for hiding this comment

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

Or with hatchling dynamic version is preservable (example). However, I think reading from the "pyproject.toml" as a single metadata source is beneficial in diminishing possible duplication.

Comment on lines +54 to +58
[project.entry-points."sqlalchemy.dialects"]
"clickhouse" = "clickhouse_sqlalchemy.drivers.http.base:ClickHouseDialect_http"
"clickhouse.asynch" = "clickhouse_sqlalchemy.drivers.asynch.base:ClickHouseDialect_asynch"
"clickhouse.http" = "clickhouse_sqlalchemy.drivers.http.base:ClickHouseDialect_http"
"clickhouse.native" = "clickhouse_sqlalchemy.drivers.native.base:ClickHouseDialect_native"
Copy link
Author

Choose a reason for hiding this comment

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

Ahem, could you give a hint how to test the fact these entry points work as before?

Choose a reason for hiding this comment

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

My guess would be something like "install locally in venv this version + sqlalchemy, try to load engine via dialect specified by dsn"

Copy link
Author

Choose a reason for hiding this comment

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

Could you help me with listing reproducible steps?

@stankudrow
Copy link
Author

A bit later I'll integrate the uv into the GHA worflow files: https://docs.astral.sh/uv/guides/integration/github/ .

Copy link

@DaniilAnichin DaniilAnichin left a comment

Choose a reason for hiding this comment

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

Couple minors, + as usual a bit iffy about removing version from init, though it also probably is not too important; otherwise lgtm

Comment on lines +54 to +58
[project.entry-points."sqlalchemy.dialects"]
"clickhouse" = "clickhouse_sqlalchemy.drivers.http.base:ClickHouseDialect_http"
"clickhouse.asynch" = "clickhouse_sqlalchemy.drivers.asynch.base:ClickHouseDialect_asynch"
"clickhouse.http" = "clickhouse_sqlalchemy.drivers.http.base:ClickHouseDialect_http"
"clickhouse.native" = "clickhouse_sqlalchemy.drivers.native.base:ClickHouseDialect_native"

Choose a reason for hiding this comment

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

My guess would be something like "install locally in venv this version + sqlalchemy, try to load engine via dialect specified by dsn"

@stankudrow stankudrow marked this pull request as draft June 12, 2025 12:11
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.

Add the "pyproject.toml" file backended with building/packaging/dependency manager.
2 participants