From 8f4c793bef9f982cbc47270f26879ae344e8b941 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 19 Dec 2022 15:15:51 +0000 Subject: [PATCH] Switch to hatchling as the build backend --- .bumpversion.cfg | 4 --- .github/workflows/conda_ci.yml | 2 +- .github/workflows/python_ci_linux.yml | 2 +- MANIFEST.in | 7 ---- pyproject.toml | 23 ++++++++++-- repo_helper.yml | 1 + setup.cfg | 52 --------------------------- setup.py | 28 --------------- 8 files changed, 24 insertions(+), 95 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 18deaa19..bd975db2 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -19,8 +19,4 @@ replace = : str = "{new_version}" search = version = "{current_version}" replace = version = "{new_version}" -[bumpversion:file:setup.cfg] -search = version = {current_version} -replace = version = {new_version} - [bumpversion:file:.github/workflows/conda_ci.yml] diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index dc9c0292..8ec700d0 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -37,7 +37,7 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade "whey-conda" "setuptools!=61.*,>=40.6.0" "wheel>=0.34.2" + python -m pip install --upgrade "whey-conda" "hatch-requirements-txt" # $CONDA is an environment variable pointing to the root of the miniconda directory $CONDA/bin/conda update -n base conda $CONDA/bin/conda config --add channels conda-forge diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 35f7b2e4..ea4ac476 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -200,7 +200,7 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade "mkrecipe" "setuptools!=61.*,>=40.6.0" "wheel>=0.34.2" + python -m pip install --upgrade "mkrecipe" "hatch-requirements-txt" # $CONDA is an environment variable pointing to the root of the miniconda directory $CONDA/bin/conda config --set always_yes yes --set changeps1 no $CONDA/bin/conda update -n base conda diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index bb6de38a..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include __pkginfo__.py -include LICENSE -include requirements.txt -prune **/__pycache__ -include domdf_python_tools/google-10000-english-no-swears.txt -recursive-include domdf_python_tools *.pyi -include domdf_python_tools/py.typed diff --git a/pyproject.toml b/pyproject.toml index a04d1883..238f7252 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = [ "setuptools!=61.*,>=40.6.0", "wheel>=0.34.2",] -build-backend = "setuptools.build_meta" +requires = [ "hatch-requirements-txt",] +build-backend = "hatchling.build" [project] name = "domdf_python_tools" @@ -177,6 +177,16 @@ include = false order = 30 include = false +[tool.hatch.build] +exclude = [ + "/*", + "!/domdf_python_tools", + "!/domdf_python_tools/**/requirements.txt", + "!/requirements.txt", + "tests", + "doc-source", +] + [tool.snippet-fmt.languages.python] reformat = true @@ -186,3 +196,12 @@ reformat = true [tool.snippet-fmt.languages.ini] [tool.snippet-fmt.languages.json] + +[tool.hatch.build.sdist] +include = [ "domdf_python_tools", "requirements.txt",] + +[tool.hatch.build.wheel] +include = [ "domdf_python_tools",] + +[tool.hatch.metadata.hooks.requirements_txt] +files = [ "requirements.txt",] diff --git a/repo_helper.yml b/repo_helper.yml index bef9302a..a1c3df18 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -14,6 +14,7 @@ min_coverage: 95 tox_testenv_extras: all pre_commit_exclude: "^domdf_python_tools/compat/importlib_resources.py$" docs_fail_on_warning: true +use_hatch: true conda_channels: - conda-forge diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 063a0215..00000000 --- a/setup.cfg +++ /dev/null @@ -1,52 +0,0 @@ -# This file is managed by 'repo_helper'. -# You may add new sections, but any changes made to the following sections will be lost: -# * metadata -# * options -# * options.packages.find -# * mypy -# * options.entry_points - -[metadata] -name = domdf_python_tools -version = 3.5.1 -author = Dominic Davis-Foster -author_email = dominic@davis-foster.co.uk -license = MIT License -keywords = utilities -long_description = file: README.rst -long_description_content_type = text/x-rst -platforms = Windows, macOS, Linux -url = https://github.com/domdfcoding/domdf_python_tools -project_urls = - Documentation = https://domdf_python_tools.readthedocs.io/en/latest - Issue Tracker = https://github.com/domdfcoding/domdf_python_tools/issues - Source Code = https://github.com/domdfcoding/domdf_python_tools -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 :: 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 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Software Development :: Libraries :: Python Modules - Typing :: Typed - -[options] -python_requires = >=3.6 -zip_safe = False -include_package_data = True -packages = find: - -[options.packages.find] -exclude = - doc-source - tests - tests.* diff --git a/setup.py b/setup.py deleted file mode 100644 index 5bed656d..00000000 --- a/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -# This file is managed by 'repo_helper'. Don't edit it directly. - -# stdlib -import pathlib -import shutil -import sys - -# 3rd party -from setuptools import setup - -sys.path.append('.') - -# this package -from __pkginfo__ import * # pylint: disable=wildcard-import - -repo_root = pathlib.Path(__file__).parent -install_requires = (repo_root / "requirements.txt").read_text(encoding="UTF-8").split('\n') - -setup( - description="Helpful functions for Python 🐍 🛠️", - extras_require=extras_require, - install_requires=install_requires, - name="domdf-python-tools", - py_modules=[], - ) - -shutil.rmtree("domdf_python_tools.egg-info", ignore_errors=True)