From 7f6731952502d3f5f5410f4e19cc26ef81796beb Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 20 Sep 2021 12:18:17 +0300 Subject: [PATCH] Use declarative metadata --- .pre-commit-config.yaml | 10 ++++++++-- setup.cfg | 30 ++++++++++++++++++++++++++++++ setup.py | 30 ------------------------------ 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c7b44e4..670c8c2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.23.1 + rev: v2.26.0 hooks: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/psf/black - rev: 21.7b0 + rev: 21.9b0 hooks: - id: black args: ["--target-version", "py36"] @@ -39,5 +39,11 @@ repos: - id: trailing-whitespace exclude: "^.github/.*_TEMPLATE.md" + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.17.0 + hooks: + - id: setup-cfg-fmt + args: ["--max-py-version=3.10"] + ci: autoupdate_schedule: quarterly diff --git a/setup.cfg b/setup.cfg index f4546adb..4cd1d339 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,32 @@ +[metadata] +name = ujson +description = Ultra fast JSON encoder and decoder for Python +long_description = file: README.rst +long_description_content_type = text/x-rst +url = https://github.com/ultrajson/ultrajson +author = Jonas Tarnstrom +license_file = LICENSE.txt +platforms = any +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: BSD License + Programming Language :: C + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 +download_url = https://github.com/ultrajson/ultrajson +project_urls = + Source=https://github.com/ultrajson/ultrajson + +[options] +python_requires = >=3.6 +setup_requires = + setuptools_scm + [flake8] max_line_length = 88 diff --git a/setup.py b/setup.py index 26c95832..64573fe6 100644 --- a/setup.py +++ b/setup.py @@ -2,20 +2,6 @@ from setuptools import Extension, setup -CLASSIFIERS = """ -Development Status :: 5 - Production/Stable -Intended Audience :: Developers -License :: OSI Approved :: BSD License -Programming Language :: C -Programming Language :: Python :: 3 -Programming Language :: Python :: 3.6 -Programming Language :: Python :: 3.7 -Programming Language :: Python :: 3.8 -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3 :: Only -""" - dconv_source_files = glob("./deps/double-conversion/double-conversion/*.cc") dconv_source_files.append("./lib/dconv_wrapper.cc") @@ -34,11 +20,6 @@ extra_link_args=["-lstdc++", "-lm"], ) - -with open("README.rst", encoding="utf-8") as f: - long_description = f.read() - - with open("python/version_template.h") as f: version_template = f.read() @@ -50,21 +31,10 @@ def local_scheme(version): setup( - name="ujson", - description="Ultra fast JSON encoder and decoder for Python", - long_description=long_description, ext_modules=[module1], - author="Jonas Tarnstrom", - download_url="https://github.com/ultrajson/ultrajson", - platforms=["any"], - url="https://github.com/ultrajson/ultrajson", - project_urls={"Source": "https://github.com/ultrajson/ultrajson"}, use_scm_version={ "local_scheme": local_scheme, "write_to": "python/version.h", "write_to_template": version_template, }, - setup_requires=["setuptools_scm"], - python_requires=">=3.6", - classifiers=[x for x in CLASSIFIERS.split("\n") if x], )