]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
use pep639
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 May 2025 15:34:49 +0000 (11:34 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 May 2025 19:14:57 +0000 (15:14 -0400)
The pyproject.toml configuration has been amended to use the updated
:pep:`639` configuration for license, which eliminates loud deprecation
warnings when building the package.   Note this necessarily bumps
setuptools build requirement to 77.0.3.

Also bump black, flake8, see what's coming.

this change is modeled after the same change made in dogpile.cache
which has since been released.

Fixes: #1637
Change-Id: I9a9e22ebaebe0d257f003f5ff5b81088df3c8901

.pre-commit-config.yaml
alembic/op.pyi
alembic/script/revision.py
docs/build/unreleased/1637.rst [new file with mode: 0644]
pyproject.toml
tools/write_pyi.py
tox.ini

index 7ee8e2b4f55e7ed886d9f688c75ecf55c21253d9..21a8658025586356fa59ccb220994039673c5974 100644 (file)
@@ -2,7 +2,7 @@
 # See https://pre-commit.com/hooks.html for more hooks
 repos:
 -   repo: https://github.com/python/black
-    rev: 24.10.0
+    rev: 25.1.0
     hooks:
     -   id: black
 
@@ -14,7 +14,7 @@ repos:
             - --keep-unused-type-checking
 
 -   repo: https://github.com/pycqa/flake8
-    rev: 6.1.0
+    rev: 7.2.0
     hooks:
     -   id: flake8
         additional_dependencies:
index 8292a724c45a9b6152a2077dbae455fba3d5bc76..548beb09e021fdc8918b847eebe2833b522150ef 100644 (file)
@@ -1276,7 +1276,7 @@ def invoke(
         BulkInsertOp,
         DropTableOp,
         ExecuteSQLOp,
-    ]
+    ],
 ) -> None: ...
 @overload
 def invoke(operation: MigrateOperation) -> Any:
index c3108e985a0a013922793489dbd9b03df95b3e07..587e90497ce0e4313452441b3611957453eb6349 100644 (file)
@@ -1708,7 +1708,7 @@ def tuple_rev_as_scalar(rev: None) -> None: ...
 
 @overload
 def tuple_rev_as_scalar(
-    rev: Union[Tuple[_T, ...], List[_T]]
+    rev: Union[Tuple[_T, ...], List[_T]],
 ) -> Union[_T, Tuple[_T, ...], List[_T]]: ...
 
 
diff --git a/docs/build/unreleased/1637.rst b/docs/build/unreleased/1637.rst
new file mode 100644 (file)
index 0000000..08ddf60
--- /dev/null
@@ -0,0 +1,8 @@
+.. change::
+    :tags: bug, general
+    :tickets: 1637
+
+    The pyproject.toml configuration has been amended to use the updated
+    :pep:`639` configuration for license, which eliminates loud deprecation
+    warnings when building the package.   Note this necessarily bumps
+    setuptools build requirement to 77.0.3.
index a62f7e8948cf591627ef73162871b1c135fb2cb9..389f95c912e2cbdc0b949a215f243cca5ee3efff 100644 (file)
@@ -1,20 +1,18 @@
 [build-system]
 build-backend = "setuptools.build_meta"
-requires = [
-    "setuptools>=61.2",
-]
+requires = ["setuptools>=77.0.3"]
 
 
 [project]
 name = "alembic"
 description = "A database migration tool for SQLAlchemy."
 authors = [{name = "Mike Bayer", email = "mike_mp@zzzcomputing.com"}]
-license = {text = "MIT"}
+license = "MIT"
+license-files = ["LICENSE"]
 classifiers = [
     "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "Environment :: Console",
-    "License :: OSI Approved :: MIT License",
     "Operating System :: OS Independent",
     "Programming Language :: Python",
     "Programming Language :: Python :: 3",
@@ -56,7 +54,6 @@ alembic = "alembic.config:main"
 include-package-data = true
 zip-safe = false
 package-dir = {"" = "."}
-license-files = ["LICENSE"]
 
 [tool.setuptools.package-data]
 "*" = ["*.pyi", "py.typed", "*.mako", "README"]
index 1efe0ee79d063212e0b983980e868bd1166a7edb..cd11e2e90d3a5339698c2a69c70c2d10520962d4 100644 (file)
@@ -13,11 +13,11 @@ import typing
 
 sys.path.append(str(Path(__file__).parent.parent))
 
-from alembic.autogenerate.api import AutogenContext
-from alembic.ddl.impl import DefaultImpl
-from alembic.runtime.migration import MigrationInfo
 
 if True:  # avoid flake/zimports messing with the order
+    from alembic.autogenerate.api import AutogenContext
+    from alembic.ddl.impl import DefaultImpl
+    from alembic.runtime.migration import MigrationInfo
     from alembic.operations.base import BatchOperations
     from alembic.operations.base import Operations
     from alembic.runtime.environment import EnvironmentContext
@@ -130,7 +130,7 @@ def generate_pyi_for_proxy(
 
     console_scripts(
         str(destination_path),
-        {"entrypoint": "black", "options": "-l79"},
+        {"entrypoint": "black", "options": "-l79 --target-version py39"},
         ignore_output=ignore_output,
     )
 
diff --git a/tox.ini b/tox.ini
index c2f58da875903fe69ee1d151541be7b2f5b0ff59..126bcb1d546019a4d4148e82ccdddc47a289ff3a 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -3,6 +3,7 @@
 envlist = py-sqlalchemy
 
 SQLA_REPO = {env:SQLA_REPO:git+https://github.com/sqlalchemy/sqlalchemy.git}
+BLACK_VERSION = 25.1.0
 
 [testenv]
 cov_args=--cov=alembic --cov-report term --cov-report xml
@@ -22,7 +23,7 @@ deps=pytest>4.6,<8.4
      mako
      tzdata
      zimports
-     black==24.10.0
+     black=={[tox]BLACK_VERSION}
      greenlet>=1
 
 
@@ -92,7 +93,7 @@ deps=
       pydocstyle<4.0.0
       # used by flake8-rst-docstrings
       pygments
-      black==24.10.0
+      black=={[tox]BLACK_VERSION}
 commands =
      flake8 ./alembic/ ./tests/ setup.py docs/build/conf.py {posargs}
      black --check setup.py tests alembic
@@ -103,5 +104,5 @@ deps=
     sqlalchemy>=2
     mako
     zimports
-    black==24.10.0
+    black=={[tox]BLACK_VERSION}
 commands = python tools/write_pyi.py