From 594c8f0f6b753d322a3b9b914adc8d3555ca228b Mon Sep 17 00:00:00 2001 From: alsmith151 Date: Wed, 27 May 2026 13:27:44 +0100 Subject: [PATCH] chore: add release-please workflow and remove setuptools_scm - Add release-please workflow (python strategy, bumps pyproject.toml) - Add release-please-config.json and manifest seeded at v0.3.0 - Remove setuptools_scm from build deps and pyproject.toml config - Static version = "0.3.0" in pyproject.toml - Switch __version__ to importlib.metadata --- .github/workflows/release-please.yml | 23 +++++++++++++++++++++++ .release-please-manifest.json | 3 +++ plotnado/__init__.py | 5 +++-- pyproject.toml | 9 +++------ release-please-config.json | 12 ++++++++++++ 5 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..b07ff4d --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,23 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..0ee8c01 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.3.0" +} diff --git a/plotnado/__init__.py b/plotnado/__init__.py index cf56edc..fb9b3da 100644 --- a/plotnado/__init__.py +++ b/plotnado/__init__.py @@ -75,8 +75,9 @@ ) try: - from ._version import version as __version__ -except ImportError: + from importlib.metadata import version as _version + __version__ = _version("plotnado") +except Exception: __version__ = "unknown" __all__ = [ diff --git a/pyproject.toml b/pyproject.toml index 1abf425..f0da0c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 61.0", "wheel", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools >= 61.0", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -9,7 +9,8 @@ description = "A simple plotting library for making genomic tracks" readme = "README.md" requires-python = ">=3.12" license = { text = "GPL-3.0-or-later" } -dynamic = ["version", "dependencies"] +version = "0.3.0" +dynamic = ["dependencies"] keywords = ["genomics", "bioinformatics", "plotting", "genome-browser", "tracks"] classifiers = [ "Development Status :: 3 - Alpha", @@ -67,10 +68,6 @@ plotnado = ["data/gene_bed_files/*", "py.typed"] -[tool.setuptools_scm] -local_scheme = "no-local-version" -write_to = "plotnado/_version.py" - [project.urls] Homepage = "https://github.com/alsmith151/plotnado" Repository = "https://github.com/alsmith151/plotnado" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..ce6c140 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "python", + "packages": { + ".": { + "package-name": "plotnado", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true + } + } +}