From 7d00b56d3a3ca865747a628e7244daa417868b10 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 27 Apr 2023 10:12:40 +0300 Subject: [PATCH 1/2] Migrate the metadata from `setup.py` into `setup.cfg`. Populate the version automatically from `git` history. --- pyproject.toml | 5 +++++ release | 14 ++++++++++---- setup.cfg | 29 +++++++++++++++++++++++++++++ setup.py | 44 -------------------------------------------- 4 files changed, 44 insertions(+), 48 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b4bb236 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools>=42.2", "setuptools_scm[toml]>=7"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] diff --git a/release b/release index 5020d6e..0dc1881 100755 --- a/release +++ b/release @@ -13,8 +13,13 @@ YELLOW="\033[0;33m" # yellow MAGENTA="\033[0;35m" # magenta CYAN="\033[0;36m" # cyan -# ensure wheel is available -pip install wheel > /dev/null +# ensure the needed deps are available +pip install --upgrade wheel build setuptools setuptools_scm > /dev/null + +if [[ "$PUBLIC" == "true" ]]; then + pip install --upgrade twine > /dev/null +fi + # ensure Pygment is available pip install Pygments > /dev/null @@ -134,11 +139,12 @@ git push -q origin master && git push -q --tags if [[ "$PUBLIC" == "true" ]]; then echo -e "${YELLOW}--->${COLOR_OFF} Creating python release" cp README.rst README - python setup.py sdist bdist_wheel upload > /dev/null + python -m build > dev.null + twine upload ./dist/* > /dev/null rm README else echo -e "${YELLOW}--->${COLOR_OFF} Creating local python dist and wheel for manual release" - python setup.py sdist bdist_wheel > /dev/null + python -m build > dev.null fi echo -e "\n${CYAN}RELEASED VERSION ${next_version}${COLOR_OFF}\n" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..7405c45 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,29 @@ +# Copyright (c) 2014 SeatGeek +# This file is part of thefuzz. + +[metadata] +name = thefuzz +author = Adam Cohen +author_email = adam@seatgeek.com +license = GPL-2.0-only +description = Fuzzy string matching in python +url = https://github.com/seatgeek/thefuzz +long_description = file: README.rst +classifiers = + Intended Audience :: Developers + License :: OSI Approved :: GNU General Public License v2 (GPLv2) + 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 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3 :: Only + +[options] +packages = thefuzz +zip_safe = True + +[options.extras_require] +speedup = python-levenshtein>=0.12 diff --git a/setup.py b/setup.py deleted file mode 100644 index a4e94bb..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2014 SeatGeek - -# This file is part of thefuzz. - -from thefuzz import __version__ -import os - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - - -def open_file(fname): - return open(os.path.join(os.path.dirname(__file__), fname)) - - -setup( - name='thefuzz', - version=__version__, - author='Adam Cohen', - author_email='adam@seatgeek.com', - packages=['thefuzz'], - extras_require={'speedup': ['python-levenshtein>=0.12']}, - url='https://github.com/seatgeek/thefuzz', - license="GPLv2", - classifiers=[ - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', - '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', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3 :: Only', - ], - description='Fuzzy string matching in python', - long_description=open_file('README.rst').read(), - zip_safe=True, -) From 4c82c705586f6f271998d638615bbf894df60a65 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 27 Apr 2023 10:20:36 +0300 Subject: [PATCH 2/2] Migrate the metadata from `setup.cfg` into `PEP 621`-compliant `pyproject.toml`. --- pyproject.toml | 34 +++++++++++++++++++++++++++++++++- setup.cfg | 29 ----------------------------- 2 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index b4bb236..f7dc96c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,37 @@ [build-system] -requires = ["setuptools>=42.2", "setuptools_scm[toml]>=7"] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=7"] build-backend = "setuptools.build_meta" +# Copyright (c) 2014 SeatGeek +# This file is part of thefuzz. + +[project] +name = "thefuzz" +authors = [{name = "Adam Cohen", email = "adam@seatgeek.com"}] +license = {text = "GPL-2.0-only"} +description = "Fuzzy string matching in python" +readme = "README.rst" +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "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", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", +] +urls = {Homepage = "https://github.com/seatgeek/thefuzz"} +dynamic = ["version"] + +[project.optional-dependencies] +speedup = ["python-levenshtein>=0.12"] + +[tool.setuptools] +packages = ["thefuzz"] +zip-safe = true +include-package-data = false + [tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7405c45..0000000 --- a/setup.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2014 SeatGeek -# This file is part of thefuzz. - -[metadata] -name = thefuzz -author = Adam Cohen -author_email = adam@seatgeek.com -license = GPL-2.0-only -description = Fuzzy string matching in python -url = https://github.com/seatgeek/thefuzz -long_description = file: README.rst -classifiers = - Intended Audience :: Developers - License :: OSI Approved :: GNU General Public License v2 (GPLv2) - 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 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3 :: Only - -[options] -packages = thefuzz -zip_safe = True - -[options.extras_require] -speedup = python-levenshtein>=0.12