From 92f6b8bb91f2b3c02e793bc2b07943f0ebb33685 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Mon, 27 Jun 2022 16:48:32 +0300 Subject: [PATCH 1/2] Moved the metadata into `setup.cfg`. Added `pyproject.toml`. Utilized `setuptools_scm` for version retrieval. --- .gitignore | 4 +++- pyproject.toml | 6 ++++++ setup.cfg | 35 +++++++++++++++++++++++++++++++++-- setup.py | 38 -------------------------------------- trieregex/__init__.py | 2 +- 5 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index ec58103..32a38c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/trieregex/version.py + __pycache__/ .cache/ .pytest_cache/ @@ -7,4 +9,4 @@ __pycache__/ build/ dist/ htmlcov/ -.coverage \ No newline at end of file +.coverage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a981fa4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools>=42.1", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "trieregex/version.py" diff --git a/setup.cfg b/setup.cfg index 10f13c5..d629762 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,35 @@ [metadata] -license_files = LICENSE.txt +name = trieregex +author = Herman Leung +author_email = leung.hm@gmail.com +license = MIT +description = Build trie-based regular expressions from large word lists long_description = file: README.md -long_description_content_type = text/markdown \ No newline at end of file +long_description_content_type = text/markdown +keywords = + regular expressions + regex + pattern + trie +url = https://github.com/ermanh/trieregex +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 + +[options] +packages = find: +install_requires = +python_requires = >=3.6 + +[options.packages.find] +exclude = tests + +[options.extras_require] +testing = pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index f5c9027..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from os import path -from setuptools import setup, find_packages - -from trieregex import __version__ - - -this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, 'README.md'), 'r') as f: - readme = f.read() - -setup( - name='trieregex', - version=__version__, - description='Build trie-based regular expressions from large word lists', - long_description=readme, - author='Herman Leung', - author_email='leung.hm@gmail.com', - url='https://github.com/ermanh/trieregex', - packages=find_packages(exclude='tests'), - python_requires='>=3.6', - install_requires=[], - extras_require={ - 'testing': ['pytest'] - }, - 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', - ], - keywords=['regular expressions', 'regex', 'pattern', 'trie'], - license='MIT', -) diff --git a/trieregex/__init__.py b/trieregex/__init__.py index e5e7ebe..4d5c5e1 100644 --- a/trieregex/__init__.py +++ b/trieregex/__init__.py @@ -1,3 +1,3 @@ -__version__ = "1.0.0" +from .version import version as __version__ from .trieregex import TrieRegEx From f8ed7c9fad18f862f7ef45e9dcbe589cdb75f056 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Mon, 27 Jun 2022 16:54:24 +0300 Subject: [PATCH 2/2] Moved the metadata from `setup.cfg` into `PEP 621`-compliant `pyproject.toml`. --- pyproject.toml | 35 ++++++++++++++++++++++++++++++++++- setup.cfg | 35 ----------------------------------- 2 files changed, 34 insertions(+), 36 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index a981fa4..60383db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,39 @@ [build-system] -requires = ["setuptools>=42.1", "wheel", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3", "wheel"] + +[project] +name = "trieregex" +description = "Build trie-based regular expressions from large word lists" +readme = "README.md" +keywords = ["pattern", "regex", "regular expressions", "trie"] +license = {text = "MIT"} +authors = [{name = "Herman Leung", email = "leung.hm@gmail.com"}] +requires-python = ">=3.6" +dependencies = [] +dynamic = ["version"] +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", +] +urls = {Homepage = "https://github.com/ermanh/trieregex"} + +[project.optional-dependencies] +testing = ["pytest"] + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.packages.find] +exclude = ["tests"] +namespaces = false [tool.setuptools_scm] write_to = "trieregex/version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d629762..0000000 --- a/setup.cfg +++ /dev/null @@ -1,35 +0,0 @@ -[metadata] -name = trieregex -author = Herman Leung -author_email = leung.hm@gmail.com -license = MIT -description = Build trie-based regular expressions from large word lists -long_description = file: README.md -long_description_content_type = text/markdown -keywords = - regular expressions - regex - pattern - trie -url = https://github.com/ermanh/trieregex -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 - -[options] -packages = find: -install_requires = -python_requires = >=3.6 - -[options.packages.find] -exclude = tests - -[options.extras_require] -testing = pytest