From 12ff78c2bc2676fb383f23fb76796637a2017027 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Sun, 19 Nov 2023 11:01:29 -0500 Subject: [PATCH] Switch to Hatch --- .github/dependabot.yml | 10 ++++ .gitignore | 9 --- CHANGELOG.md | 1 + MANIFEST.in | 6 -- docs/changelog.rst | 1 + pyproject.toml | 127 ++++++++++++++++++++++++++++++++++++++++- setup.cfg | 113 ------------------------------------ 7 files changed, 137 insertions(+), 130 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 81579cb..ef3b2be 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,15 @@ version: 2 updates: + - package-ecosystem: pip + directory: / + schedule: + interval: weekly + commit-message: + prefix: "[python]" + labels: + - dependencies + - d:python + - package-ecosystem: github-actions directory: / schedule: diff --git a/.gitignore b/.gitignore index 9eaf843..350c421 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,7 @@ -*.egg -*.egg-info/ -*.pyc -.cache/ .coverage* -.eggs/ .mypy_cache/ .nox/ -.pytest_cache/ .tox/ __pycache__/ -build/ dist/ -docs/.doctrees/ docs/_build/ -venv/ diff --git a/CHANGELOG.md b/CHANGELOG.md index fa77e5c..a425851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ v2.4.0 (in development) ----------------------- +- Migrated from setuptools to hatch v2.3.0 (2023-11-19) ------------------- diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 7a2cb7d..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG.* CONTRIBUTORS.* LICENSE tox.ini -graft src -graft docs -prune docs/_build -graft test -global-exclude *.py[cod] diff --git a/docs/changelog.rst b/docs/changelog.rst index 6208cfa..7e1d2cb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,7 @@ Changelog v2.4.0 (in development) ----------------------- +- Migrated from setuptools to hatch v2.3.0 (2023-11-19) diff --git a/pyproject.toml b/pyproject.toml index b3491a3..868c2f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,126 @@ [build-system] -requires = ["setuptools >= 46.4.0"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "versioningit" +dynamic = ["version"] +description = "Versioning It with your Version In Git" +readme = "README.rst" +requires-python = ">=3.7" +license = "MIT" +license-files = { paths = ["LICENSE"] } +authors = [ + { name = "John Thorvald Wodder II", email = "versioningit@varonathe.org" } +] + +keywords = [ + "Git", + "Mercurial", + "VCS", + "packaging", + "version", +] + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3 :: Only", + "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.12", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "License :: OSI Approved :: MIT License", + "Framework :: Hatch", + "Framework :: Setuptools Plugin", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Topic :: Software Development :: Version Control", + "Topic :: Software Development :: Version Control :: Git", + "Topic :: Software Development :: Version Control :: Mercurial", + "Typing :: Typed", +] + +dependencies = [ + "importlib-metadata >= 3.6; python_version < '3.10'", + "packaging >= 17.1", + "tomli >= 1.2, < 3.0; python_version < '3.11'", +] + +[project.scripts] +versioningit = "versioningit.__main__:main" + +[project.entry-points."setuptools.finalize_distribution_options"] +versioningit = "versioningit.hook:setuptools_finalizer" + +[project.entry-points."hatch"] +versioningit = "versioningit.hatch" + +[project.entry-points."versioningit.vcs"] +git = "versioningit.git:describe_git" +git-archive = "versioningit.git:describe_git_archive" +hg = "versioningit.hg:describe_hg" + +[project.entry-points."versioningit.tag2version"] +basic = "versioningit.basics:basic_tag2version" + +[project.entry-points."versioningit.next_version"] +minor = "versioningit.next_version:next_minor_version" +minor-release = "versioningit.next_version:next_minor_release_version" +smallest = "versioningit.next_version:next_smallest_version" +smallest-release = "versioningit.next_version:next_smallest_release_version" +null = "versioningit.next_version:null_next_version" + +[project.entry-points."versioningit.format"] +basic = "versioningit.basics:basic_format" + +[project.entry-points."versioningit.template_fields"] +basic = "versioningit.basics:basic_template_fields" + +[project.entry-points."versioningit.write"] +basic = "versioningit.basics:basic_write" + +[project.entry-points."versioningit.onbuild"] +replace-version = "versioningit.onbuild:replace_version_onbuild" + +[project.urls] +"Source Code" = "https://github.com/jwodder/versioningit" +"Bug Tracker" = "https://github.com/jwodder/versioningit/issues" +"Documentation" = "https://versioningit.readthedocs.io" + +[tool.hatch.version] +path = "src/versioningit/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/docs", + "/src", + "/test", + "CHANGELOG.*", + "CONTRIBUTORS.*", + "tox.ini", +] + +[tool.hatch.envs.default] +python = "3" + +[tool.mypy] +allow_incomplete_defs = false +allow_untyped_defs = false +ignore_missing_imports = false +# : +no_implicit_optional = true +implicit_reexport = false +local_partial_types = true +pretty = true +show_error_codes = true +show_traceback = true +strict_equality = true +warn_redundant_casts = true +warn_return_any = true +warn_unreachable = true +exclude = "test/data/" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 766f76d..0000000 --- a/setup.cfg +++ /dev/null @@ -1,113 +0,0 @@ -[metadata] -name = versioningit -version = attr:versioningit.__version__ -description = Versioning It with your Version In Git -long_description = file:README.rst -long_description_content_type = text/x-rst -author = John Thorvald Wodder II -author_email = versioningit@varonathe.org -license = MIT -license_files = LICENSE -url = https://github.com/jwodder/versioningit - -keywords = - Git - Mercurial - VCS - packaging - version - -classifiers = - Development Status :: 5 - Production/Stable - Programming Language :: Python :: 3 :: Only - 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.12 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - License :: OSI Approved :: MIT License - Framework :: Hatch - Framework :: Setuptools Plugin - Intended Audience :: Developers - Topic :: Software Development :: Build Tools - Topic :: Software Development :: Version Control - Topic :: Software Development :: Version Control :: Git - Topic :: Software Development :: Version Control :: Mercurial - Typing :: Typed - -project_urls = - Source Code = https://github.com/jwodder/versioningit - Bug Tracker = https://github.com/jwodder/versioningit/issues - Documentation = https://versioningit.readthedocs.io - -[options] -packages = find: -package_dir = - =src -include_package_data = True -python_requires = >=3.7 -install_requires = - importlib-metadata >= 3.6; python_version < "3.10" - packaging >= 17.1 - tomli >= 1.2, < 3.0; python_version < "3.11" - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - versioningit = versioningit.__main__:main - -setuptools.finalize_distribution_options = - versioningit = versioningit.hook:setuptools_finalizer - -hatch = - versioningit = versioningit.hatch - -versioningit.vcs = - git = versioningit.git:describe_git - git-archive = versioningit.git:describe_git_archive - hg = versioningit.hg:describe_hg - -versioningit.tag2version = - basic = versioningit.basics:basic_tag2version - -versioningit.next_version = - minor = versioningit.next_version:next_minor_version - minor-release = versioningit.next_version:next_minor_release_version - smallest = versioningit.next_version:next_smallest_version - smallest-release = versioningit.next_version:next_smallest_release_version - null = versioningit.next_version:null_next_version - -versioningit.format = - basic = versioningit.basics:basic_format - -versioningit.template_fields = - basic = versioningit.basics:basic_template_fields - -versioningit.write = - basic = versioningit.basics:basic_write - -versioningit.onbuild = - replace-version = versioningit.onbuild:replace_version_onbuild - -[mypy] -allow_incomplete_defs = False -allow_untyped_defs = False -ignore_missing_imports = False -# : -no_implicit_optional = True -implicit_reexport = False -local_partial_types = True -pretty = True -show_error_codes = True -show_traceback = True -strict_equality = True -warn_redundant_casts = True -warn_return_any = True -warn_unreachable = True -exclude = test/data/