From b6d66adc8be682fa31e847b7e100c512ff1e1326 Mon Sep 17 00:00:00 2001 From: Takayuki SHIMIZUKAWA Date: Sat, 1 Jun 2024 08:38:36 +0000 Subject: [PATCH] Modernize packaging: use pyproject.toml instead of setup.py/cfg --- pyproject.toml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-- setup.cfg | 54 ------------------------------------------------ setup.py | 3 --- tox.ini | 5 +++++ 4 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index d2b85d6..84a0984 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,60 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "django-redshift-backend" +dynamic = ["version"] +description = "Redshift database backend for Django" +readme = "README.rst" +license = {file = "LICENSE"} +requires-python = ">=3.7, <4" +authors = [ + { name = "shimizukawa", email = "shimizukawa@gmail.com" }, +] +keywords = [ + "django", + "redshift", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Django", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "django", +] + +[project.optional-dependencies] +psycopg2 = [ + "psycopg2", +] +psycopg2-binary = [ + "psycopg2-binary", +] + +[project.urls] +Documentation = "https://django-redshift-backend.readthedocs.io/" +Homepage = "https://github.com/jazzband/django-redshift-backend" +"Release notes" = "https://django-redshift-backend.readthedocs.io/en/master/changes.html" +Source = "https://github.com/jazzband/django-redshift-backend" +Tracker = "https://github.com/jazzband/django-redshift-backend/issues" + +[tool.setuptools] +include-package-data = true [tool.setuptools_scm] # this empty section means: use_scm_version=True version_scheme = "guess-next-dev" local_scheme = "no-local-version" - diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c4371f0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,54 +0,0 @@ -[metadata] -name = django-redshift-backend -url= https://github.com/jazzband/django-redshift-backend -author = shimizukawa -author_email = shimizukawa@gmail.com -license = Apache Software License -license_file = LICENSE -description = Redshift database backend for Django -long_description = file: README.rst, CHANGES.rst -long_description_content_type = text/x-rst -keywords = django, redshift -classifiers = - Development Status :: 5 - Production/Stable - License :: OSI Approved :: Apache Software License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Framework :: Django - Framework :: Django :: 3.2 - Framework :: Django :: 4.0 - Intended Audience :: Developers - Environment :: Plugins - Topic :: Software Development :: Libraries :: Python Modules -project_urls = - Documentation = https://django-redshift-backend.readthedocs.io/ - Release notes = https://django-redshift-backend.readthedocs.io/en/master/changes.html - Source = https://github.com/jazzband/django-redshift-backend - Tracker = https://github.com/jazzband/django-redshift-backend/issues - -[options] -python_requires = >=3.7, <4 -packages = find: -include_package_data = false -zip_safe = false -install_requires = - django -setup_requires = - setuptools_scm - -[options.extras_require] -psycopg2-binary = psycopg2-binary -psycopg2 = psycopg2 - -[bdist_wheel] -universal = 0 -# 0 to make the generated wheels have `py3` tag - -[flake8] -max-line-length=120 -ignore = W504 -exclude = tests/testapp/migrations diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/tox.ini b/tox.ini index 4ee4a51..e109f31 100644 --- a/tox.ini +++ b/tox.ini @@ -62,3 +62,8 @@ deps = commands = python -m build twine check dist/* + +[flake8] +max-line-length=120 +ignore = W504 +exclude = tests/testapp/migrations