diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f7dc96c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[build-system] +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/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.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, -)