From 1f1622c5dbea3e32a2f54dfeb5375a64dadd0501 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 18 Oct 2023 18:17:01 +0100 Subject: [PATCH] ext: Use hatch for packaging and version bumping --- lib/esbonio-extensions/.bumpversion.cfg | 14 ------- .../esbonio/ext/__init__.py | 1 + lib/esbonio-extensions/hatch.toml | 9 +++++ lib/esbonio-extensions/pyproject.toml | 38 ++++++++----------- lib/esbonio-extensions/setup.py | 3 -- 5 files changed, 26 insertions(+), 39 deletions(-) delete mode 100644 lib/esbonio-extensions/.bumpversion.cfg create mode 100644 lib/esbonio-extensions/hatch.toml delete mode 100644 lib/esbonio-extensions/setup.py diff --git a/lib/esbonio-extensions/.bumpversion.cfg b/lib/esbonio-extensions/.bumpversion.cfg deleted file mode 100644 index ae95c4b8..00000000 --- a/lib/esbonio-extensions/.bumpversion.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[bumpversion] -current_version = 0.2.2 -commit = False -tag = False -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(.dev(?P\d+))? -serialize = - {major}.{minor}.{patch}.dev{dev} - {major}.{minor}.{patch} - -[bumpversion:file:pyproject.toml] - -[bumpversion:file:esbonio/tutorial.py] - -[bumpversion:file:esbonio/relevant_to/__init__.py] diff --git a/lib/esbonio-extensions/esbonio/ext/__init__.py b/lib/esbonio-extensions/esbonio/ext/__init__.py index e69de29b..b5fdc753 100644 --- a/lib/esbonio-extensions/esbonio/ext/__init__.py +++ b/lib/esbonio-extensions/esbonio/ext/__init__.py @@ -0,0 +1 @@ +__version__ = "0.2.2" diff --git a/lib/esbonio-extensions/hatch.toml b/lib/esbonio-extensions/hatch.toml new file mode 100644 index 00000000..98c041cc --- /dev/null +++ b/lib/esbonio-extensions/hatch.toml @@ -0,0 +1,9 @@ +[version] +path = "esbonio/ext/__init__.py" +validate-bump = false + +[build.targets.sdist] +include = ["esbonio", "tests", "CHANGES.rst"] + +[build.targets.wheel] +packages = ["esbonio"] diff --git a/lib/esbonio-extensions/pyproject.toml b/lib/esbonio-extensions/pyproject.toml index 9d7539b0..ed4e9037 100644 --- a/lib/esbonio-extensions/pyproject.toml +++ b/lib/esbonio-extensions/pyproject.toml @@ -1,39 +1,33 @@ [build-system] -requires = ["setuptools >= 61.0.0"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.17.1"] +build-backend = "hatchling.build" [project] name = "esbonio-extensions" -version = "0.2.2" +dynamic = ["version"] description = "A collection of extensions for Sphinx and the Esbonio language server" readme = "README.md" requires-python = ">=3.8" license = { text = "MIT" } authors = [{ name = "Alex Carney", email = "alcarneyme@gmail.com" }] classifiers = [ - "Development Status :: 3 - Alpha", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "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", - "Topic :: Documentation", - "Topic :: Documentation :: Sphinx", + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "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", + "Topic :: Documentation", + "Topic :: Documentation :: Sphinx", ] dependencies = ["esbonio", "platformdirs", "sphinx"] [project.optional-dependencies] -dev = [ - "black", - "flake8", - "pytest", - "pytest-cov", - "mock", -] +dev = ["black", "flake8", "pytest", "pytest-cov", "mock"] spelling = ["pyspellchecker"] tutorial = ["nbformat"] diff --git a/lib/esbonio-extensions/setup.py b/lib/esbonio-extensions/setup.py deleted file mode 100644 index b908cbe5..00000000 --- a/lib/esbonio-extensions/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup()