From 2c8248d6fc5a0957c0f4cfd4df789b92067eb069 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 28 Sep 2022 09:31:04 +0200 Subject: [PATCH] migrate to hatch --- pyproject.toml | 108 ++++++++++++++++++++++++++++++++----------------- setup.cfg | 50 ----------------------- setup.py | 5 --- 3 files changed, 71 insertions(+), 92 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 0b1c9028..86077047 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,69 @@ [build-system] requires = [ - "setuptools", - "setuptools-scm", - "wheel", + "hatchling>=1.3.1", + "hatch-vcs", +] +build-backend = "hatchling.build" + +[project] +name = "pluggy" +description = "plugin and hook calling mechanisms for python" +readme = "README.rst" +license = "MIT" +requires-python = ">=3.7" +authors = [ + { name = "Holger Krekel", email = "holger@merlinux.eu" }, +] +classifiers = [ + "Development Status :: 6 - Mature", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Testing", + "Topic :: Utilities", +] +dependencies = [ + "importlib-metadata>=0.12;python_version<\"3.8\"", +] +dynamic = [ + "version", +] + +[project.optional-dependencies] +dev = [ + "pre-commit", + "tox", +] +testing = [ + "pytest", + "pytest-benchmark", +] + +[project.urls] +Homepage = "https://github.com/pytest-dev/pluggy" + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "src/pluggy/_version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", ] -[tool.setuptools_scm] -write_to = "src/pluggy/_version.py" [tool.towncrier] package = "pluggy" @@ -15,42 +72,19 @@ filename = "CHANGELOG.rst" directory = "changelog/" title_format = "pluggy {version} ({project_date})" template = "changelog/_template.rst" - - [[tool.towncrier.type]] - directory = "removal" - name = "Deprecations and Removals" - showcontent = true - - [[tool.towncrier.type]] - directory = "feature" - name = "Features" - showcontent = true - - [[tool.towncrier.type]] - directory = "bugfix" - name = "Bug Fixes" - showcontent = true - - [[tool.towncrier.type]] - directory = "vendor" - name = "Vendored Libraries" - showcontent = true - - [[tool.towncrier.type]] - directory = "doc" - name = "Improved Documentation" - showcontent = true - - [[tool.towncrier.type]] - directory = "trivial" - name = "Trivial/Internal Changes" - showcontent = true +type = [ + { directory = "removal", name = "Deprecations and Removals", showcontent = true }, + { directory = "feature", name = "Features", showcontent = true }, + { directory = "bugfix", name = "Bug Fixes", showcontent = true }, + { directory = "vendor", name = "Vendored Libraries", showcontent = true }, + { directory = "doc", name = "Improved Documentation", showcontent = true }, + { directory = "trivial", name = "Trivial/Internal Changes", showcontent = true }, +] [tool.mypy] +python_version = "3.7" mypy_path = "src" check_untyped_defs = true -# Hopefully we can set this someday! -# disallow_any_expr = true disallow_any_generics = true disallow_any_unimported = true disallow_subclassing_any = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index adb6d4fc..00000000 --- a/setup.cfg +++ /dev/null @@ -1,50 +0,0 @@ -[metadata] -name = pluggy -description = plugin and hook calling mechanisms for python -long_description = file: README.rst -long_description_content_type = text/x-rst -license = MIT -platforms = unix, linux, osx, win32 -author = Holger Krekel -author_email = holger@merlinux.eu -url = https://github.com/pytest-dev/pluggy -classifiers = - Development Status :: 6 - Mature - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: POSIX - Operating System :: Microsoft :: Windows - Operating System :: MacOS :: MacOS X - Topic :: Software Development :: Testing - Topic :: Software Development :: Libraries - Topic :: Utilities - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - 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 - -[options] -packages = - pluggy -install_requires = - importlib-metadata>=0.12;python_version<"3.8" -python_requires = >=3.6 -package_dir = - =src -setup_requires = - setuptools-scm -[options.extras_require] -dev = - pre-commit - tox -testing = - pytest - pytest-benchmark - -[devpi:upload] -formats=sdist.tgz,bdist_wheel diff --git a/setup.py b/setup.py deleted file mode 100644 index ed442375..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -from setuptools import setup - - -if __name__ == "__main__": - setup(use_scm_version={"write_to": "src/pluggy/_version.py"})