From 128717639723f035cca1acc8f9c1e1a427247c34 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Nov 2020 18:51:37 +0000 Subject: [PATCH 1/5] apply setup-py-upgrade --- setup.cfg | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 52 ++-------------------------------------------------- 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/setup.cfg b/setup.cfg index 107d9e61..db57b835 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,53 @@ +[metadata] +name = humanize +description = Python humanize utilities +long_description = file: README.md +long_description_content_type = text/markdown +author = Jason Moiron +author_email = jmoiron@jmoiron.net +maintainer = Hugo van Kemenade +url = https://github.com/jmoiron/humanize +project_urls = + Source=https://github.com/jmoiron/humanize + Issue tracker=https://github.com/jmoiron/humanize/issues + Funding=https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi +license = MIT +keywords = humanize time size +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python + 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 :: Only + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Topic :: Text Processing + Topic :: Text Processing :: General + +[options] +packages = find: +package_dir = =src +include_package_data = True +zip_safe = False +install_requires = setuptools +setup_requires = setuptools_scm +python_requires = >=3.6 + +[options.packages.find] +where = src + +[options.extras_require] +tests = + freezegun + pytest + pytest-cov + [flake8] max_line_length = 88 diff --git a/setup.py b/setup.py index fefb6561..ce2ecd06 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,4 @@ -from setuptools import find_packages, setup - -with open("README.md", encoding="UTF-8") as f: - long_description = f.read() - +from setuptools import setup def local_scheme(version): """Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) @@ -10,48 +6,4 @@ def local_scheme(version): return "" -setup( - name="humanize", - description="Python humanize utilities", - long_description=long_description, - long_description_content_type="text/markdown", - author="Jason Moiron", - author_email="jmoiron@jmoiron.net", - maintainer="Hugo van Kemenade", - url="https://github.com/jmoiron/humanize", - project_urls={ - "Source": "https://github.com/jmoiron/humanize", - "Issue tracker": "https://github.com/jmoiron/humanize/issues", - "Funding": "https://tidelift.com/subscription/pkg/pypi-humanize?" - "utm_source=pypi-humanize&utm_medium=pypi", - }, - license="MIT", - keywords="humanize time size", - packages=find_packages(where="src"), - package_dir={"": "src"}, - include_package_data=True, - zip_safe=False, - use_scm_version={"local_scheme": local_scheme}, - install_requires=["setuptools"], # pkg_resources - setup_requires=["setuptools_scm"], - extras_require={"tests": ["freezegun", "pytest", "pytest-cov"]}, - python_requires=">=3.6", - # Get strings from https://pypi.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "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 :: Only", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Text Processing", - "Topic :: Text Processing :: General", - ], -) +setup(use_scm_version={"local_scheme": local_scheme}) From d97c61c00375f7c70654d5901cc39e2e22d63854 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Nov 2020 18:55:29 +0000 Subject: [PATCH 2/5] move setuptools_scm config to pyproject.toml --- pyproject.toml | 7 +++++++ setup.py | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a291cb69..be3aee9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,9 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +build-backend = "setuptools.build_meta" + [tool.black] target_version = ["py36"] + +[tool.setuptools_scm] +local_scheme = "no-local-version" diff --git a/setup.py b/setup.py index ce2ecd06..60684932 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,3 @@ from setuptools import setup -def local_scheme(version): - """Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) - to be able to upload to Test PyPI""" - return "" - - -setup(use_scm_version={"local_scheme": local_scheme}) +setup() From b2785e9671bbbe260a82bc7689a3db0308866592 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Nov 2020 18:57:53 +0000 Subject: [PATCH 3/5] setuptools_scm no-longer required at setup time --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index db57b835..0ce0e366 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,6 @@ package_dir = =src include_package_data = True zip_safe = False install_requires = setuptools -setup_requires = setuptools_scm python_requires = >=3.6 [options.packages.find] From 3b8505d5bfd805462303afb53252f75a2d2069a0 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Nov 2020 20:12:23 +0000 Subject: [PATCH 4/5] add and apply setup-cfg-fmt --- .pre-commit-config.yaml | 5 +++++ setup.cfg | 28 +++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7af3b16d..32c0c2b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,3 +40,8 @@ repos: - id: pydocstyle args: ["--convention", "google"] files: "src/" + + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.15.1 + hooks: + - id: setup-cfg-fmt diff --git a/setup.cfg b/setup.cfg index 0ce0e366..bc71a943 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,16 +3,12 @@ name = humanize description = Python humanize utilities long_description = file: README.md long_description_content_type = text/markdown +url = https://github.com/jmoiron/humanize author = Jason Moiron author_email = jmoiron@jmoiron.net maintainer = Hugo van Kemenade -url = https://github.com/jmoiron/humanize -project_urls = - Source=https://github.com/jmoiron/humanize - Issue tracker=https://github.com/jmoiron/humanize/issues - Funding=https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi license = MIT -keywords = humanize time size +license_file = LICENCE classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers @@ -20,26 +16,29 @@ classifiers = Operating System :: OS Independent Programming Language :: Python 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 :: Only Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Text Processing Topic :: Text Processing :: General +keywords = humanize time size +project_urls = + Source=https://github.com/jmoiron/humanize + Issue tracker=https://github.com/jmoiron/humanize/issues + Funding=https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi [options] packages = find: -package_dir = =src +install_requires = + setuptools +python_requires = >=3.6 include_package_data = True +package_dir = =src zip_safe = False -install_requires = setuptools -python_requires = >=3.6 - -[options.packages.find] -where = src [options.extras_require] tests = @@ -47,6 +46,9 @@ tests = pytest pytest-cov +[options.packages.find] +where = src + [flake8] max_line_length = 88 From 55b5c18b003efd27a82e330619c3774adf306ebb Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Nov 2020 20:17:54 +0000 Subject: [PATCH 5/5] apply pre-commit autoupdate --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32c0c2b6..5320a9e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.7.2 + rev: v2.7.4 hooks: - id: pyupgrade args: ["--py36-plus"] @@ -12,23 +12,23 @@ repos: args: ["--target-version", "py36"] - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 + rev: 3.8.4 hooks: - id: flake8 additional_dependencies: [flake8-2020, flake8-implicit-str-concat] - repo: https://github.com/timothycrosley/isort - rev: 5.4.2 + rev: 5.6.4 hooks: - id: isort - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.6.0 + rev: v1.7.0 hooks: - id: python-check-blanket-noqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v3.3.0 hooks: - id: check-merge-conflict - id: check-toml