]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Move most setup options to setup.cfg
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Jun 2020 22:45:40 +0000 (18:45 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Jun 2020 16:31:33 +0000 (12:31 -0400)
Installation has been modernized to use setup.cfg for most package
metadata.

Fixes: #5404
Change-Id: Id59c0c4e7f81eca89999d1f1f8b03c89835a09d1

doc/build/changelog/unreleased_14/5404.rst [new file with mode: 0644]
setup.cfg
setup.py

diff --git a/doc/build/changelog/unreleased_14/5404.rst b/doc/build/changelog/unreleased_14/5404.rst
new file mode 100644 (file)
index 0000000..c252fea
--- /dev/null
@@ -0,0 +1,6 @@
+.. change::
+    :tags: installation
+    :tickets: 5404
+
+    Installation has been modernized to use setup.cfg for most package
+    metadata.
index 6529ad07fbd0b459cb174cd6c006fedc261b86be..dcccf6883f1d96717ac0531ffa8662f22db717cd 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,12 +1,61 @@
+[metadata]
+name = SQLAlchemy
+version = attr: sqlalchemy.__version__
+description = Database Abstraction Library
+long_description = file: README.dialects.rst
+long_description_content_type = text/x-rst
+url = http://www.sqlalchemy.org
+author = Mike Bayer
+author_email = mike_mp@zzzcomputing.com
+license = MIT
+license_file = LICENSE
+classifiers =
+    Development Status :: 5 - Production/Stable
+    Intended Audience :: Developers
+    License :: OSI Approved :: MIT License
+    Operating System :: OS Independent
+    Programming Language :: Python
+    Programming Language :: Python :: 2
+    Programming Language :: Python :: 2.7
+    Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.5
+    Programming Language :: Python :: 3.6
+    Programming Language :: Python :: 3.7
+    Programming Language :: Python :: 3.8
+    Programming Language :: Python :: Implementation :: CPython
+    Programming Language :: Python :: Implementation :: PyPy
+    Topic :: Database :: Front-Ends
+project_urls =
+    Documentation=https://docs.sqlalchemy.org
+    Issue Tracker=https://github.com/sqlalchemy/sqlalchemy/
+
+[options]
+packages = find:
+python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
+package_dir =
+    =lib
+
+[options.extras_require]
+mssql = pyodbc
+mssql_pymssql = pymssql
+mssql_pyodbc = pyodbc
+mysql = mysqlclient
+oracle = cx_oracle
+postgresql = psycopg2
+postgresql_pg8000 = pg8000
+postgresql_psycopg2binary = psycopg2-binary
+postgresql_psycopg2cffi = psycopg2cffi
+pymysql = pymysql
+
 [egg_info]
 tag_build = dev
 
-[metadata]
-license_file = LICENSE
+[options.packages.find]
+where = lib
 
 [tool:pytest]
-addopts= --tb native -v -r sfxX --maxfail=25 -p no:warnings -p no:logging
-python_files=test/*test_*.py
+addopts = --tb native -v -r sfxX --maxfail=25 -p no:warnings -p no:logging
+python_files = test/*test_*.py
 
 [upload]
 sign = 1
@@ -15,6 +64,7 @@ identity = C4DAFEE1
 [flake8]
 show-source = false
 enable-extensions = G
+
 # E203 is due to https://github.com/PyCQA/pycodestyle/issues/373
 ignore =
     A003,
@@ -27,15 +77,15 @@ exclude = .venv,.git,.tox,dist,doc,*egg,build
 import-order-style = google
 application-import-names = sqlalchemy,test
 
-
 [sqla_testing]
-requirement_cls=test.requirements:DefaultRequirements
-profile_file=test/profiles.txt
+requirement_cls = test.requirements:DefaultRequirements
+profile_file = test/profiles.txt
 
 # name of a "loopback" link set up on the oracle database.
 # to create this, suppose your DB is scott/tiger@xe.  You'd create it
 # like:
-# create public database link test_link connect to scott identified by tiger using 'xe';
+# create public database link test_link connect to scott identified by tiger
+# using 'xe';
 oracle_db_link = test_link
 
 # host name of a postgres database that has the postgres_fdw extension.
@@ -45,24 +95,18 @@ oracle_db_link = test_link
 # this can be localhost to create a loopback foreign table
 # postgres_test_db_link = localhost
 
-
 [db]
-default=sqlite:///:memory:
-sqlite=sqlite:///:memory:
-sqlite_file=sqlite:///querytest.db
-
-postgresql=postgresql://scott:tiger@127.0.0.1:5432/test
-pg8000=postgresql+pg8000://scott:tiger@127.0.0.1:5432/test
-postgresql_psycopg2cffi=postgresql+psycopg2cffi://scott:tiger@127.0.0.1:5432/test
-
-mysql=mysql://scott:tiger@127.0.0.1:3306/test?charset=utf8mb4
-pymysql=mysql+pymysql://scott:tiger@127.0.0.1:3306/test?charset=utf8mb4
-
-mssql=mssql+pyodbc://scott:tiger^5HHH@mssql2017:1433/test?driver=ODBC+Driver+13+for+SQL+Server
-mssql_pymssql=mssql+pymssql://scott:tiger@ms_2008
-docker_mssql=mssql+pymssql://scott:tiger^5HHH@127.0.0.1:1433/test
-
-oracle=oracle://scott:tiger@127.0.0.1:1521
-oracle8=oracle://scott:tiger@127.0.0.1:1521/?use_ansi=0
-
-firebird=firebird://sysdba:masterkey@localhost//Users/classic/foo.fdb
+default = sqlite:///:memory:
+sqlite = sqlite:///:memory:
+sqlite_file = sqlite:///querytest.db
+postgresql = postgresql://scott:tiger@127.0.0.1:5432/test
+pg8000 = postgresql+pg8000://scott:tiger@127.0.0.1:5432/test
+postgresql_psycopg2cffi = postgresql+psycopg2cffi://scott:tiger@127.0.0.1:5432/test
+mysql = mysql://scott:tiger@127.0.0.1:3306/test?charset=utf8mb4
+pymysql = mysql+pymysql://scott:tiger@127.0.0.1:3306/test?charset=utf8mb4
+mssql = mssql+pyodbc://scott:tiger^5HHH@mssql2017:1433/test?driver=ODBC+Driver+13+for+SQL+Server
+mssql_pymssql = mssql+pymssql://scott:tiger@ms_2008
+docker_mssql = mssql+pymssql://scott:tiger^5HHH@127.0.0.1:1433/test
+oracle = oracle://scott:tiger@127.0.0.1:1521
+oracle8 = oracle://scott:tiger@127.0.0.1:1521/?use_ansi=0
+firebird = firebird://sysdba:masterkey@localhost//Users/classic/foo.fdb
index 3fa3e864a0c724a6efec2e12289bb9da4273bc30..25ea7e2a222369153ba00427c62a5bf4d5c7d476 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -4,19 +4,15 @@ from distutils.errors import DistutilsExecError
 from distutils.errors import DistutilsPlatformError
 import os
 import platform
-import re
 import sys
 
 from setuptools import Distribution as _Distribution
 from setuptools import Extension
-from setuptools import find_packages
 from setuptools import setup
 from setuptools.command.test import test as TestCommand
 
 
 cmdclass = {}
-if sys.version_info < (2, 7):
-    raise Exception("SQLAlchemy requires Python 2.7 or higher.")
 
 cpython = platform.python_implementation() == "CPython"
 
@@ -120,19 +116,6 @@ def status_msgs(*msgs):
     print("*" * 75)
 
 
-with open(
-    os.path.join(os.path.dirname(__file__), "lib", "sqlalchemy", "__init__.py")
-) as v_file:
-    VERSION = (
-        re.compile(r""".*__version__ = ["'](.*?)['"]""", re.S)
-        .match(v_file.read())
-        .group(1)
-    )
-
-with open(os.path.join(os.path.dirname(__file__), "README.rst")) as r_file:
-    readme = r_file.read()
-
-
 def run_setup(with_cext):
     kwargs = {}
     if with_cext:
@@ -146,56 +129,7 @@ def run_setup(with_cext):
 
         kwargs["ext_modules"] = []
 
-    setup(
-        name="SQLAlchemy",
-        version=VERSION,
-        description="Database Abstraction Library",
-        author="Mike Bayer",
-        author_email="mike_mp@zzzcomputing.com",
-        url="http://www.sqlalchemy.org",
-        project_urls={
-            "Documentation": "https://docs.sqlalchemy.org",
-            "Issue Tracker": "https://github.com/sqlalchemy/sqlalchemy/",
-        },
-        packages=find_packages("lib"),
-        package_dir={"": "lib"},
-        license="MIT",
-        cmdclass=cmdclass,
-        long_description=readme,
-        python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
-        classifiers=[
-            "Development Status :: 5 - Production/Stable",
-            "Intended Audience :: Developers",
-            "License :: OSI Approved :: MIT License",
-            "Programming Language :: Python",
-            "Programming Language :: Python :: 2",
-            "Programming Language :: Python :: 2.7",
-            "Programming Language :: Python :: 3",
-            "Programming Language :: Python :: 3.5",
-            "Programming Language :: Python :: 3.6",
-            "Programming Language :: Python :: 3.7",
-            "Programming Language :: Python :: 3.8",
-            "Programming Language :: Python :: 3.9",
-            "Programming Language :: Python :: Implementation :: CPython",
-            "Programming Language :: Python :: Implementation :: PyPy",
-            "Topic :: Database :: Front-Ends",
-            "Operating System :: OS Independent",
-        ],
-        distclass=Distribution,
-        extras_require={
-            "mysql": ["mysqlclient"],
-            "pymysql": ["pymysql"],
-            "postgresql": ["psycopg2"],
-            "postgresql_psycopg2binary": ["psycopg2-binary"],
-            "postgresql_pg8000": ["pg8000"],
-            "postgresql_psycopg2cffi": ["psycopg2cffi"],
-            "oracle": ["cx_oracle"],
-            "mssql_pyodbc": ["pyodbc"],
-            "mssql_pymssql": ["pymssql"],
-            "mssql": ["pyodbc"],
-        },
-        **kwargs
-    )
+    setup(cmdclass=cmdclass, distclass=Distribution, **kwargs)
 
 
 if not cpython: