From bcaaebfcec0afd37e8973e45c7d454321391dfec Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Mon, 4 Dec 2023 15:01:12 +0100 Subject: [PATCH 1/3] Fix versions --- CITATION.cff | 2 +- pyproject.toml | 2 +- src/imas2xarray/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index efed3e1..b9b7a16 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -27,4 +27,4 @@ keywords: - uncertainty-quantification - fusion-reactor license: Apache-2.0 -version: version: 0.1.0 +version: 0.1.0 diff --git a/pyproject.toml b/pyproject.toml index 8a2223f..6c07f02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ [project] name = "imas2xarray" -version = "version = "0.1.0"" +version = "0.1.0" description = "imas2xarray is a tool reading IMAS data in hdf5 format into xarray." readme = "README.md" requires-python = ">=3.9" diff --git a/src/imas2xarray/__init__.py b/src/imas2xarray/__init__.py index c541905..e6e1210 100644 --- a/src/imas2xarray/__init__.py +++ b/src/imas2xarray/__init__.py @@ -16,7 +16,7 @@ __author__ = 'Stef Smeets' __email__ = 's.smeets@esciencecenter.nl' -__version__ = '__version__ = '0.1.0'' +__version__ = '0.1.0' __all__ = [ 'H5Handle', From fe4d5e3c81e266ad9bbd0afd40bdebf5a284ac49 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Mon, 4 Dec 2023 15:01:36 +0100 Subject: [PATCH 2/3] Add zenodo doi and badge --- CONTRIBUTING.md | 2 +- README.md | 3 ++- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90462e9..16f1156 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,4 +103,4 @@ If you are adding new pages, make sure to update the listing in the [`mkdocs.yml 3. The [upload to pypi](https://pypi.org/project/imas2xarray) is triggered when a release is published and handled by [this workflow](https://github.com/duqtools/imas2xarray/actions/workflows/publish.yaml). -4. The [upload to zenodo](https://zenodo.org/record/FIXME) is triggered when a release is published. +4. The [upload to zenodo](https://zenodo.org/record/https://zenodo.org/doi/10.5281/zenodo.10256040) is triggered when a release is published. diff --git a/README.md b/README.md index b896585..ec6aa9a 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,11 @@ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/imas2xarray)](https://pypi.org/project/imas2xarray/) [![PyPI](https://img.shields.io/pypi/v/imas2xarray.svg?style=flat)](https://pypi.org/project/imas2xarray/) ![Coverage](https://gist.githubusercontent.com/stefsmeets/f635ee4ac999ce969fa1d23a57e006ae/raw/covbadge.svg) - +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10256040.svg)](https://doi.org/10.5281/zenodo.10256040) ![imas2xarray banner](https://raw.githubusercontent.com/duqtools/imas2xarray/main/src/imas2xarray/data/logo.png) + # imas2xarray **Imas2xarray** is a library that makes it as simple and intuitive as possible to load an IMAS dataset in HDF5 format into Python. There is no need to manually define the paths or fiddle with the different dimensions and long keys. diff --git a/pyproject.toml b/pyproject.toml index 6c07f02..ecefd88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "imas2xarray" version = "0.1.0" -description = "imas2xarray is a tool reading IMAS data in hdf5 format into xarray." +description = "Imas2xarray is a tool reading IMAS data in hdf5 format into xarray." readme = "README.md" requires-python = ">=3.9" authors = [ From 8c97aba3dcab2553d3b5e7efee1195f7eadeedd8 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Mon, 4 Dec 2023 15:16:17 +0100 Subject: [PATCH 3/3] Set up bump-my-version --- .bumpversion.cfg | 17 ----------------- .github/workflows/publish.yaml | 4 ++-- pyproject.toml | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index c353060..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,17 +0,0 @@ -[bumpversion] -current_version = 0.1.0 - -[comment] -comment = The contents of this file cannot be merged with that of setup.cfg until https://github.com/c4urself/bump2version/issues/185 is resolved - -[bumpversion:file:src/imas2xarray/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bumpversion:file:pyproject.toml] -search = version = "{current_version}" -replace = version = "{new_version}" - -[bumpversion:file:CITATION.cff] -search = version: {current_version} -replace = version: {new_version} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index df688af..4e002cc 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -33,8 +33,8 @@ jobs: - name: Bump version to new tag run: | - python -m pip install bumpversion - bumpversion --new-version $GITHUB_REF_NAME --commit patch + python -m pip install bump-my-version + bump-my-version bump --new-version $GITHUB_REF_NAME --commit patch - name: Push back changes to main and tag run: | diff --git a/pyproject.toml b/pyproject.toml index ecefd88..ce79b50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ changelog = "https://github.com/duqtools/imas2xarray/releases" [project.optional-dependencies] develop = [ - "bump2version", + "bump-my-version", "ruff", "pre-commit", "coverage[toml]", @@ -166,3 +166,21 @@ profile = "black" [tool.ruff.format] quote-style = "single" indent-style = "space" + +[tool.bumpversion] +current_version = "0.1.0" + +[[tool.bumpversion.files]] +filename = "src/imas2xarray/__init__.py" +search = "__version__ = '{current_version}'" +replace = "__version__ = '{new_version}'" + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = "version = \"{current_version}\"" +replace = "version = \"{new_version}\"" + +[[tool.bumpversion.files]] +filename = "CITATION.cff" +search = "version: {current_version}" +replace = "version: {new_version}"