]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Use pep517 to install alembic.
authorCaselIT <cfederico87@gmail.com>
Fri, 20 Mar 2020 21:37:01 +0000 (22:37 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 7 May 2022 10:52:34 +0000 (10:52 +0000)
Change-Id: If7b9e9fca39e6a6abe45900ff396345c778bbaa9

MANIFEST.in
pyproject.toml
setup.cfg
setup.py

index cb795e03bc214d838a74fec2a9a09cd8daa03afd..dc8ec40b28515c1e41cf6d943a10d68e3ccad5aa 100644 (file)
@@ -7,6 +7,4 @@ recursive-include tools *.py
 include README* LICENSE CHANGES* tox.ini
 
 prune docs/build/output
-exclude pyproject.toml
-
 
index e766501faeb0a30de9300a40ce33ec9cc4e64d5e..cd87f7ce5b442bb8dfd14a4b7fc366da43d967ef 100644 (file)
@@ -1,3 +1,10 @@
+[build-system]
+build-backend = "setuptools.build_meta"
+requires = [
+    "setuptools>=47",
+    "wheel>=0.34",
+]
+
 [tool.black]
 line-length = 79
 
index 5a5917b5e0d7f88441959122e5c27d7248b99256..9e0c13186ade67c722d4dfd1931cc75c33eb2cf9 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,12 +1,7 @@
 [metadata]
 
 name = alembic
-
-# version comes from setup.py; setuptools
-# can't read the "attr:" here without importing
-# until version 47.0.0 which is too recent
-
-
+version = attr: alembic.__version__
 description = A database migration tool for SQLAlchemy.
 long_description = file: README.rst
 long_description_content_type = text/x-rst
index 1ca5fd71969681fd3c4a9ab6145b954c207979d0..1a4f69a8c0cc456cfe831517adad46568b4cbeb1 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,36 +1,7 @@
-import os
-import re
-import sys
-
+from setuptools import __version__
 from setuptools import setup
-from setuptools.command.test import test as TestCommand
-
-
-v = open(os.path.join(os.path.dirname(__file__), "alembic", "__init__.py"))
-VERSION = (
-    re.compile(r""".*__version__ = ["'](.*?)["']""", re.S)
-    .match(v.read())
-    .group(1)
-)
-v.close()
-
-
-class UseTox(TestCommand):
-    RED = 31
-    RESET_SEQ = "\033[0m"
-    BOLD_SEQ = "\033[1m"
-    COLOR_SEQ = "\033[1;%dm"
-
-    def run_tests(self):
-        sys.stderr.write(
-            "%s%spython setup.py test is deprecated by pypa.  Please invoke "
-            "'tox' with no arguments for a basic test run.\n%s"
-            % (self.COLOR_SEQ % self.RED, self.BOLD_SEQ, self.RESET_SEQ)
-        )
-        sys.exit(1)
 
+if not int(__version__.partition(".")[0]) >= 47:
+    raise RuntimeError(f"Setuptools >= 47 required. Found {__version__}")
 
-setup(
-    version=VERSION,
-    cmdclass={"test": UseTox},
-)
+setup()