From 28f58d8a0daecb9c1e13d486899788dfd3b15e8c Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:27:38 -0700
Subject: [PATCH 01/34] Add initial version of publish workflow
---
.github/workflows/publish.yml | 72 +++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
create mode 100644 .github/workflows/publish.yml
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..551dc3d
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,72 @@
+name: Build & publish to PyPI
+
+on:
+ workflow_dispatch:
+ pull_request:
+ push:
+ tags:
+ - "v[0-9]+.[0-9]+.[0-9]+*"
+
+concurrency:
+ group: "${{ github.workflow }}-${{ github.ref }}"
+ cancel-in-progress: true
+
+jobs:
+ pypi-publish:
+ if: github.ref_type == 'tag'
+ name: Publish release to PyPI
+ runs-on: ubuntu-latest
+ environment:
+ name: PyPI
+ url: https://pypi.org/p/nsidc-metgenc
+ permissions:
+ id-token: write
+ attestations: write
+ contents: read
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.12
+
+ - name: cache poetry install
+ uses: actions/cache@v4
+ with:
+ path: ~/.local
+ key: poetry-1.8.3-0
+
+ - uses: snok/install-poetry@v1
+ with:
+ version: 1.8.3
+ virtualenvs-create: true
+ virtualenvs-in-project: true
+
+ - name: cache deps
+ id: cache-deps
+ uses: actions/cache@v4
+ with:
+ path: .venv
+ key: pydeps-${{ hashFiles('**/poetry.lock') }}
+
+ - run: poetry install --no-interaction --no-root
+ if: steps.cache-deps.outputs.cache-hit != 'true'
+
+ - run: poetry install --no-interaction
+
+ - run: poetry build
+
+ - run: poetry publish
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: Packages
+ path: dist
+
+ - name: Generate artifact attestation for sdist and wheel
+ uses: actions/attest-build-provenance@v1.4.3
+ with:
+ subject-path: "dist/*"
+
+ - name: Publish package distributions to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
From 64232b1180e4c8968897c33ce1a6dcb9865cfbbc Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:35:43 -0700
Subject: [PATCH 02/34] Fix publish GHA workflow
---
.github/workflows/publish.yml | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 551dc3d..1074d86 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -7,22 +7,10 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
-concurrency:
- group: "${{ github.workflow }}-${{ github.ref }}"
- cancel-in-progress: true
-
jobs:
- pypi-publish:
- if: github.ref_type == 'tag'
- name: Publish release to PyPI
+ build:
+ name: Build package
runs-on: ubuntu-latest
- environment:
- name: PyPI
- url: https://pypi.org/p/nsidc-metgenc
- permissions:
- id-token: write
- attestations: write
- contents: read
steps:
- uses: actions/checkout@v4
@@ -56,8 +44,19 @@ jobs:
- run: poetry build
- - run: poetry publish
-
+ publish:
+ if: github.ref_type == 'tag'
+ name: Publish to PyPI
+ needs: [dist]
+ environment:
+ name: PyPI
+ url: https://pypi.org/p/nsidc-metgenc
+ permissions:
+ id-token: write
+ attestations: write
+ contents: read
+ runs-on: ubuntu-latest
+ steps:
- uses: actions/download-artifact@v4
with:
name: Packages
@@ -68,5 +67,5 @@ jobs:
with:
subject-path: "dist/*"
- - name: Publish package distributions to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
+ - name: Publish package distributions to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
From 81e688885593312b561c491fa5d5ad6761262bdd Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:39:17 -0700
Subject: [PATCH 03/34] Fix publish workflow ref to build job
---
.github/workflows/publish.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 1074d86..20d3739 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -47,7 +47,7 @@ jobs:
publish:
if: github.ref_type == 'tag'
name: Publish to PyPI
- needs: [dist]
+ needs: [build]
environment:
name: PyPI
url: https://pypi.org/p/nsidc-metgenc
From 5286de7c9b40e2bf8b8df15ae064e5be88e32fa3 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:43:51 -0700
Subject: [PATCH 04/34] Add a step to upload the artifact
---
.github/workflows/publish.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 20d3739..05e16a8 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -44,6 +44,9 @@ jobs:
- run: poetry build
+ - uses: actions/upload-artifact@v4
+ path: dist
+
publish:
if: github.ref_type == 'tag'
name: Publish to PyPI
From fbf95d8ee9211db2da612b1cfc71cec46a0109c1 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:45:56 -0700
Subject: [PATCH 05/34] Fix upload artifact step
---
.github/workflows/publish.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 05e16a8..ee6fa97 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -45,7 +45,8 @@ jobs:
- run: poetry build
- uses: actions/upload-artifact@v4
- path: dist
+ with:
+ path: dist
publish:
if: github.ref_type == 'tag'
From 0c6697c4a4608b8054294b106c69f941bc7241e3 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 16:49:55 -0700
Subject: [PATCH 06/34] Remove build artifact name
---
.github/workflows/publish.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ee6fa97..a1f260a 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -63,7 +63,6 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
- name: Packages
path: dist
- name: Generate artifact attestation for sdist and wheel
From f5f422e8ee3dcd1abe3482a0ac6a1bec1b5632ad Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 17:26:59 -0700
Subject: [PATCH 07/34] Rename workflow for the pypi project
---
.github/workflows/{publish.yml => workflow.yml} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename .github/workflows/{publish.yml => workflow.yml} (100%)
diff --git a/.github/workflows/publish.yml b/.github/workflows/workflow.yml
similarity index 100%
rename from .github/workflows/publish.yml
rename to .github/workflows/workflow.yml
From 07cbab6873ceef36dc112cecdd2d5f3a0fd90617 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 17:45:18 -0700
Subject: [PATCH 08/34] Tweak download-artifact step config
---
.github/workflows/workflow.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index a1f260a..f686e35 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -64,6 +64,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: dist
+ merge-multiple: true
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v1.4.3
From b74e43f68a21f0cd8460ae5288cd48442d307e8b Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 19 Nov 2024 17:52:28 -0700
Subject: [PATCH 09/34] Fix the project name in pyproject
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index feaf465..bd40d0b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,5 @@
[tool.poetry]
-name = "nsidc-metgen"
+name = "nsidc-metgenc"
version = "0.1.0"
description = "The nsidc-metgen package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
authors = ["National Snow and Ice Data Center (NSIDC) "]
From f36dbc9a3c2119c8eac535fdfea7d6308bd36480 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Fri, 22 Nov 2024 14:39:57 -0700
Subject: [PATCH 10/34] Load schema & templates using importlib.resources
---
src/nsidc/metgen/constants.py | 18 +++++++++---------
src/nsidc/metgen/metgen.py | 9 +++++----
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/nsidc/metgen/constants.py b/src/nsidc/metgen/constants.py
index fcfa51b..0aa0fb9 100644
--- a/src/nsidc/metgen/constants.py
+++ b/src/nsidc/metgen/constants.py
@@ -8,7 +8,7 @@
DEFAULT_NUMBER = 1000000
# JSON schema locations and versions
-CNM_JSON_SCHEMA = 'src/nsidc/metgen/json-schema/cumulus_sns_schema.json'
+CNM_JSON_SCHEMA = ('nsidc.metgen.json-schema', 'cumulus_sns_schema.json')
CNM_JSON_SCHEMA_VERSION = '1.6.1'
# Configuration sections
@@ -21,11 +21,11 @@
DEFAULT_SPATIAL_AXIS_SIZE = 6
# Templates
-CNM_BODY_TEMPLATE = 'src/nsidc/metgen/templates/cnm_body_template.json'
-CNM_FILES_TEMPLATE = 'src/nsidc/metgen/templates/cnm_files_template.json'
-UMMG_BODY_TEMPLATE = 'src/nsidc/metgen/templates/ummg_body_template.json'
-UMMG_TEMPORAL_SINGLE_TEMPLATE = 'src/nsidc/metgen/templates/ummg_temporal_single_template.json'
-UMMG_TEMPORAL_RANGE_TEMPLATE = 'src/nsidc/metgen/templates/ummg_temporal_range_template.json'
-UMMG_SPATIAL_GPOLYGON_TEMPLATE = 'src/nsidc/metgen/templates/ummg_horizontal_gpolygon_template.json'
-UMMG_SPATIAL_POINT_TEMPLATE = 'src/nsidc/metgen/templates/ummg_horizontal_point_template.json'
-UMMG_SPATIAL_RECTANGLE_TEMPLATE = 'src/nsidc/metgen/templates/ummg_horizontal_rectangle_template.json'
+CNM_BODY_TEMPLATE = ('nsidc.metgen.templates', 'cnm_body_template.json')
+CNM_FILES_TEMPLATE = ('nsidc.metgen.templates', 'cnm_files_template.json')
+UMMG_BODY_TEMPLATE = ('nsidc.metgen.templates', 'ummg_body_template.json')
+UMMG_TEMPORAL_SINGLE_TEMPLATE = ('nsidc.metgen.templates', 'ummg_temporal_single_template.json')
+UMMG_TEMPORAL_RANGE_TEMPLATE = ('nsidc.metgen.templates', 'ummg_temporal_range_template.json')
+UMMG_SPATIAL_GPOLYGON_TEMPLATE = ('nsidc.metgen.templates', 'ummg_horizontal_gpolygon_template.json')
+UMMG_SPATIAL_POINT_TEMPLATE = ('nsidc.metgen.templates', 'ummg_horizontal_point_template.json')
+UMMG_SPATIAL_RECTANGLE_TEMPLATE = ('nsidc.metgen.templates', 'ummg_horizontal_rectangle_template.json')
diff --git a/src/nsidc/metgen/metgen.py b/src/nsidc/metgen/metgen.py
index ea1c34f..88d3a36 100644
--- a/src/nsidc/metgen/metgen.py
+++ b/src/nsidc/metgen/metgen.py
@@ -2,6 +2,7 @@
import dataclasses
import datetime as dt
import hashlib
+from importlib.resources import open_text
import json
import jsonschema
import logging
@@ -562,8 +563,8 @@ def cnms_body_template():
def cnms_files_template():
return initialize_template(constants.CNM_FILES_TEMPLATE)
-def initialize_template(file):
- with open(file) as template_file:
+def initialize_template(resource_location):
+ with open_text(*resource_location) as template_file:
template_str = template_file.read()
return Template(template_str)
@@ -573,12 +574,12 @@ def validate(configuration, content_type):
Validate local JSON files
"""
output_file_path = file_type_path(configuration, content_type)
- schema_file = schema_file_path(content_type)
+ schema_resource_location = schema_file_path(content_type)
logger = logging.getLogger('metgenc')
logger.info('')
logger.info(f"Validating files in {output_file_path}...")
- with open(schema_file) as sf:
+ with open_text(*schema_resource_location) as sf:
schema = json.load(sf)
# loop through all files and validate each one
From c627262b2fa1f971d145833eaf6acebfaf40dad7 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 17:44:33 -0700
Subject: [PATCH 11/34] Add a project CHANGELOG
---
CHANGELOG.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..9f70877
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,20 @@
+MetGenC Changelog
+
+## v1.0.0
+
+This is the Minimum Viable Product (MVP) release of MetGenC. The
+features include:
+
+ * Provides a prompt-driven means of configuring MetGenC to ingest
+ a new collection.
+ * Processing is driven by a configuration file for control of various
+ aspects of the ingest.
+ * Generates a UUID and submission time for each granule.
+ * Creates UMM-G compliant metadata for each source granule.
+ * The UMM-G includes required attributes, including temporal and
+ spatial bounds.
+ * Generates a Cumulus Notification Message (CNM) for each granule.
+ * Stages the science data files and their UMM-G metadata in
+ a configurable S3 bucket location.
+ * Submits the CNM message to a configurable Kinesis stream in
+ order to trigger a Cumulus workflow.
From ebecb7733582a1d99a2fc08775d712df3d81fa9b Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 19:13:27 -0700
Subject: [PATCH 12/34] Add bump-my-version
---
poetry.lock | 159 ++++++++++++++++++++++++++++++++++++++++++++++++-
pyproject.toml | 22 +++++++
2 files changed, 179 insertions(+), 2 deletions(-)
diff --git a/poetry.lock b/poetry.lock
index 96e4a10..60f1b00 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "annotated-types"
@@ -114,6 +114,43 @@ urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >
[package.extras]
crt = ["awscrt (==0.22.0)"]
+[[package]]
+name = "bracex"
+version = "2.5.post1"
+description = "Bash style brace expander."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "bracex-2.5.post1-py3-none-any.whl", hash = "sha256:13e5732fec27828d6af308628285ad358047cec36801598368cb28bc631dbaf6"},
+ {file = "bracex-2.5.post1.tar.gz", hash = "sha256:12c50952415bfa773d2d9ccb8e79651b8cdb1f31a42f6091b804f6ba2b4a66b6"},
+]
+
+[[package]]
+name = "bump-my-version"
+version = "0.28.1"
+description = "Version bump your Python project"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "bump_my_version-0.28.1-py3-none-any.whl", hash = "sha256:df7fdb02a1b43c122a6714df6d1fe4efc7a1220b5638ca5a0eb3018813c1b222"},
+ {file = "bump_my_version-0.28.1.tar.gz", hash = "sha256:e608def5191baf505b6cde88bd679a0a95fc4cfeace4247adb60ac0f8a7e57ee"},
+]
+
+[package.dependencies]
+click = "*"
+pydantic = ">=2.0.0"
+pydantic-settings = "*"
+questionary = "*"
+rich = "*"
+rich-click = "*"
+tomlkit = "*"
+wcmatch = ">=8.5.1"
+
+[package.extras]
+dev = ["generate-changelog (>=0.7.6)", "git-fame (>=1.12.2)", "pip-tools", "pre-commit"]
+docs = ["black", "markdown-customblocks", "mdx-truly-sane-lists", "mkdocs", "mkdocs-click", "mkdocs-drawio", "mkdocs-gen-files", "mkdocs-git-authors-plugin", "mkdocs-git-committers-plugin", "mkdocs-git-revision-date-localized-plugin (>=1.2.6)", "mkdocs-include-markdown-plugin", "mkdocs-literate-nav", "mkdocs-material", "mkdocstrings[python]", "python-frontmatter"]
+test = ["coverage", "freezegun", "pre-commit", "pytest", "pytest-cov", "pytest-mock", "pytest-sugar"]
+
[[package]]
name = "certifi"
version = "2024.8.30"
@@ -1310,6 +1347,20 @@ files = [
{file = "ply-3.11.tar.gz", hash = "sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"},
]
+[[package]]
+name = "prompt-toolkit"
+version = "3.0.36"
+description = "Library for building powerful interactive command lines in Python"
+optional = false
+python-versions = ">=3.6.2"
+files = [
+ {file = "prompt_toolkit-3.0.36-py3-none-any.whl", hash = "sha256:aa64ad242a462c5ff0363a7b9cfe696c20d55d9fc60c11fd8e632d064804d305"},
+ {file = "prompt_toolkit-3.0.36.tar.gz", hash = "sha256:3e163f254bef5a03b146397d7c1963bd3e2812f0964bb9a24e6ec761fd28db63"},
+]
+
+[package.dependencies]
+wcwidth = "*"
+
[[package]]
name = "py-partiql-parser"
version = "0.5.6"
@@ -1459,6 +1510,26 @@ files = [
[package.dependencies]
typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0"
+[[package]]
+name = "pydantic-settings"
+version = "2.6.1"
+description = "Settings management using Pydantic"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pydantic_settings-2.6.1-py3-none-any.whl", hash = "sha256:7fb0637c786a558d3103436278a7c4f1cfd29ba8973238a50c5bb9a55387da87"},
+ {file = "pydantic_settings-2.6.1.tar.gz", hash = "sha256:e0f92546d8a9923cb8941689abf85d6601a8c19a23e97a34b2964a2e3f813ca0"},
+]
+
+[package.dependencies]
+pydantic = ">=2.7.0"
+python-dotenv = ">=0.21.0"
+
+[package.extras]
+azure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0)"]
+toml = ["tomli (>=2.0.1)"]
+yaml = ["pyyaml (>=6.0.1)"]
+
[[package]]
name = "pyfiglet"
version = "1.0.2"
@@ -1583,6 +1654,20 @@ files = [
[package.dependencies]
six = ">=1.5"
+[[package]]
+name = "python-dotenv"
+version = "1.0.1"
+description = "Read key-value pairs from a .env file and set them as environment variables"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},
+ {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"},
+]
+
+[package.extras]
+cli = ["click (>=5.0)"]
+
[[package]]
name = "pytz"
version = "2024.2"
@@ -1683,6 +1768,20 @@ files = [
{file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"},
]
+[[package]]
+name = "questionary"
+version = "2.0.1"
+description = "Python library to build pretty command line user prompts ⭐️"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "questionary-2.0.1-py3-none-any.whl", hash = "sha256:8ab9a01d0b91b68444dff7f6652c1e754105533f083cbe27597c8110ecc230a2"},
+ {file = "questionary-2.0.1.tar.gz", hash = "sha256:bcce898bf3dbb446ff62830c86c5c6fb9a22a54146f0f5597d3da43b10d8fc8b"},
+]
+
+[package.dependencies]
+prompt_toolkit = ">=2.0,<=3.0.36"
+
[[package]]
name = "referencing"
version = "0.35.1"
@@ -1990,6 +2089,26 @@ pygments = ">=2.13.0,<3.0.0"
[package.extras]
jupyter = ["ipywidgets (>=7.5.1,<9)"]
+[[package]]
+name = "rich-click"
+version = "1.8.4"
+description = "Format click help output nicely with rich"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "rich_click-1.8.4-py3-none-any.whl", hash = "sha256:2d2841b3cebe610d5682baa1194beaf78ab00c4fa31931533261b5eba2ee80b7"},
+ {file = "rich_click-1.8.4.tar.gz", hash = "sha256:0f49471f04439269d0e66a6f43120f52d11d594869a2a0be600cfb12eb0616b9"},
+]
+
+[package.dependencies]
+click = ">=7"
+rich = ">=10.7"
+typing-extensions = ">=4"
+
+[package.extras]
+dev = ["mypy", "packaging", "pre-commit", "pytest", "pytest-cov", "rich-codex", "ruff", "types-setuptools"]
+docs = ["markdown-include", "mkdocs", "mkdocs-glightbox", "mkdocs-material-extensions", "mkdocs-material[imaging] (>=9.5.18,<9.6.0)", "mkdocs-rss-plugin", "mkdocstrings[python]", "rich-codex"]
+
[[package]]
name = "rpds-py"
version = "0.21.0"
@@ -2249,6 +2368,17 @@ mpmath = ">=1.1.0,<1.4"
[package.extras]
dev = ["hypothesis (>=6.70.0)", "pytest (>=7.1.0)"]
+[[package]]
+name = "tomlkit"
+version = "0.13.2"
+description = "Style preserving TOML library"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"},
+ {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"},
+]
+
[[package]]
name = "toolz"
version = "1.0.0"
@@ -2341,6 +2471,31 @@ files = [
[package.extras]
watchmedo = ["PyYAML (>=3.10)"]
+[[package]]
+name = "wcmatch"
+version = "10.0"
+description = "Wildcard/glob file name matcher."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "wcmatch-10.0-py3-none-any.whl", hash = "sha256:0dd927072d03c0a6527a20d2e6ad5ba8d0380e60870c383bc533b71744df7b7a"},
+ {file = "wcmatch-10.0.tar.gz", hash = "sha256:e72f0de09bba6a04e0de70937b0cf06e55f36f37b3deb422dfaf854b867b840a"},
+]
+
+[package.dependencies]
+bracex = ">=2.1.1"
+
+[[package]]
+name = "wcwidth"
+version = "0.2.13"
+description = "Measures the displayed width of unicode strings in a terminal"
+optional = false
+python-versions = "*"
+files = [
+ {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"},
+ {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"},
+]
+
[[package]]
name = "werkzeug"
version = "3.1.3"
@@ -2476,4 +2631,4 @@ files = [
[metadata]
lock-version = "2.0"
python-versions = "^3.12"
-content-hash = "f23f8f81f98749abc04b7adaae503168707b49f305dc487e5755b24b4caacc54"
+content-hash = "a3d1919a01b2ce7eb2072972a0d827ce6b467bf857f23a5e5045aa513304fd1e"
diff --git a/pyproject.toml b/pyproject.toml
index bd40d0b..1d072cc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,6 +30,28 @@ pytest-watcher = "^0.4.3"
[tool.poetry.group.dev.dependencies]
ruff = "^0.5.5"
mypy = "^1.11.1"
+bump-my-version = "^0.28.1"
+
+[tool.bumpversion]
+current_version = "0.1.0"
+parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)"
+serialize = ["{major}.{minor}.{patch}"]
+search = "{current_version}"
+replace = "{new_version}"
+regex = false
+ignore_missing_version = false
+ignore_missing_files = false
+tag = false
+sign_tags = false
+tag_name = "v{new_version}"
+tag_message = "Bump version: {current_version} → {new_version}"
+allow_dirty = false
+commit = false
+message = "Bump version: {current_version} → {new_version}"
+commit_args = ""
+setup_hooks = []
+pre_commit_hooks = []
+post_commit_hooks = []
[build-system]
requires = ["poetry-core"]
From 76c3f59b2f9e8582f124ad430958d121d2daea92 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 19:37:40 -0700
Subject: [PATCH 13/34] Add version attribute to the module
---
src/nsidc/metgen/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/nsidc/metgen/__init__.py b/src/nsidc/metgen/__init__.py
index e69de29..770f0db 100644
--- a/src/nsidc/metgen/__init__.py
+++ b/src/nsidc/metgen/__init__.py
@@ -0,0 +1,4 @@
+__version__ = "v0.1.0"
+
+
+__all__ = ["__version__"]
From 9c8b3361a16c7bd307497604e578f1a1c876b68d Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 19:51:36 -0700
Subject: [PATCH 14/34] Configure bump-my-version
---
pyproject.toml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyproject.toml b/pyproject.toml
index 1d072cc..bf978bd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -53,6 +53,9 @@ setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []
+[[tool.bumpversion.files]]
+filename = "src/nsidc/metgen/__init__.py"
+
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
From cef73c9932c597f9c071e9d8139e55b20478b291 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 19:53:40 -0700
Subject: [PATCH 15/34] Configure bumpversion to commit & tag
---
pyproject.toml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index bf978bd..79f37ed 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,12 +41,12 @@ replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
-tag = false
+tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
-commit = false
+commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
setup_hooks = []
From 4a618d489c91eed21dc644702d0eeef9f0b670a1 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 19:53:56 -0700
Subject: [PATCH 16/34] =?UTF-8?q?Bump=20version:=200.1.0=20=E2=86=92=200.2?=
=?UTF-8?q?.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 2 +-
src/nsidc/metgen/__init__.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 79f37ed..d4e2054 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,7 +33,7 @@ mypy = "^1.11.1"
bump-my-version = "^0.28.1"
[tool.bumpversion]
-current_version = "0.1.0"
+current_version = "0.2.0"
parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
diff --git a/src/nsidc/metgen/__init__.py b/src/nsidc/metgen/__init__.py
index 770f0db..47f0e78 100644
--- a/src/nsidc/metgen/__init__.py
+++ b/src/nsidc/metgen/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "v0.1.0"
+__version__ = "v0.2.0"
__all__ = ["__version__"]
From 1acfb3c2c071cbb07e280157ab9fac65928fb578 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 20:06:56 -0700
Subject: [PATCH 17/34] Fix bumpversion config for pyproject
---
pyproject.toml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index d4e2054..f664918 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nsidc-metgenc"
-version = "0.1.0"
+version = "0.2.0"
description = "The nsidc-metgen package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
authors = ["National Snow and Ice Data Center (NSIDC) "]
readme = "README.md"
@@ -56,6 +56,11 @@ post_commit_hooks = []
[[tool.bumpversion.files]]
filename = "src/nsidc/metgen/__init__.py"
+[[tool.bumpversion.files]]
+filename = "pyproject.toml"
+search = 'version = "{current_version}"'
+replace = 'version = "{new_version}"'
+
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
From 03c2d5f16de4cb4aa76d6f7329ff52da2491bfe0 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 20:08:07 -0700
Subject: [PATCH 18/34] =?UTF-8?q?Bump=20version:=200.2.0=20=E2=86=92=200.3?=
=?UTF-8?q?.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 4 ++--
src/nsidc/metgen/__init__.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index f664918..0b9aeb3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nsidc-metgenc"
-version = "0.2.0"
+version = "0.3.0"
description = "The nsidc-metgen package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
authors = ["National Snow and Ice Data Center (NSIDC) "]
readme = "README.md"
@@ -33,7 +33,7 @@ mypy = "^1.11.1"
bump-my-version = "^0.28.1"
[tool.bumpversion]
-current_version = "0.2.0"
+current_version = "0.3.0"
parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
diff --git a/src/nsidc/metgen/__init__.py b/src/nsidc/metgen/__init__.py
index 47f0e78..c403315 100644
--- a/src/nsidc/metgen/__init__.py
+++ b/src/nsidc/metgen/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "v0.2.0"
+__version__ = "v0.3.0"
__all__ = ["__version__"]
From 873c395e6e55d61a8f518cc701fb64e5cc1a2f17 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 25 Nov 2024 20:19:07 -0700
Subject: [PATCH 19/34] Update README with new install & releasing instructions
---
README.md | 53 ++++++++++++++++++++++++-----------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index f55e141..1a1e079 100644
--- a/README.md
+++ b/README.md
@@ -31,16 +31,7 @@ or
$ python3 --version
-Next, install [Poetry](https://python-poetry.org/) by using the [official
-installer](https://python-poetry.org/docs/#installing-with-the-official-installer)
-if you’re comfortable with the instructions, or by installing it using a package
-manager (like Homebrew) if this is more familiar to you. When successfully
-installed, you should be able to run:
-
- $ poetry --version
- Poetry (version 1.8.3)
-
-Finally, install the AWS commandline interface (CLI) by [following the appropriate
+Next, install the AWS commandline interface (CLI) by [following the appropriate
instructions for your platform](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
## Assumptions
@@ -60,26 +51,11 @@ instructions for your platform](https://docs.aws.amazon.com/cli/latest/userguide
## Installation
-Make a local directory (i.e., on your computer), and then `cd` into that
-directory. Clone the `granule-metgen` repository using ssh if you have [added
-ssh keys to your GitHub
-account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)
-or https if you have not:
-
- $ mkdir -p ~/my-projects; cd ~/my-projects
- # Install using ssh:
- $ git clone git@github.com:nsidc/granule-metgen.git
- # Install using https:
- $ git clone https://github.com/nsidc/granule-metgen.git
+MetGenC can be installed from [PyPI](https://pypi.org/)
-Enter the `granule-metgen` directory and run Poetry to have it install the `granule-metgen` dependencies. Then start a new shell in which you can run the tool:
+ $ pip install nsidc-metgenc
- $ cd granule-metgen
- $ poetry install
- $ poetry shell
-
-With the Poetry shell running, start the metgenc tool just to verify that it’s working by requesting its usage options and having them
-returned (there’s more to do—explained in the **Usage** section below—before MetGenC can be run successfully to create ummg, cnm, and stage data!)::
+That's it! Now we're ready to run MetGenC and see what it can do:
$ metgenc --help
Usage: metgenc [OPTIONS] COMMAND [ARGS]...
@@ -230,7 +206,7 @@ TBD
$ poetry install
-### Run tests:
+### Run tests
$ poetry run pytest
@@ -238,6 +214,25 @@ TBD
$ poetry run ptw . --now --clear
+### Releasing
+
+* Update the CHANGELOG to reflect the latest version and the
+ changes included in the release.
+
+* Show the current version and the possible next versions:
+
+ $ bump-my-version show-bump
+ 0.3.0 ── bump ─┬─ major ─ 1.0.0
+ ├─ minor ─ 0.4.0
+ ╰─ patch ─ 0.3.1
+
+* Bump the version to the desired number:
+
+ $ bump-my-version bump minor
+
+ You will see the latest commit & tag by looking at `git log`. You
+ can then push these to GitHub to trigger the CI/CD workflow.
+
## Credit
This content was developed by the National Snow and Ice Data Center with funding from
From ec086423c635aacf4faae0bebd85ba721231121a Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:02:59 -0700
Subject: [PATCH 20/34] Try GHA workflow badges
---
README.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/README.md b/README.md
index 1a1e079..d27abf7 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,11 @@
+# Badges
+
+![push workflow](https://github.com/github/docs/actions/workflows/push.yml/badge.svg)
+![workflow workflow](https://github.com/github/docs/actions/workflows/workflow.yml/badge.svg)
+
# MetGenC
The `MetGenC` toolkit enables Operations staff and data
From 0b18280047e144f18cb32af0125710f0587e43f3 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:04:16 -0700
Subject: [PATCH 21/34] Fix GHA workflow badges
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index d27abf7..e6e9d1d 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@
# Badges
-![push workflow](https://github.com/github/docs/actions/workflows/push.yml/badge.svg)
-![workflow workflow](https://github.com/github/docs/actions/workflows/workflow.yml/badge.svg)
+![push workflow](https://github.com/nsidc/granule-metgen/actions/workflows/push.yml/badge.svg)
+![workflow workflow](https://github.com/nsidc/granule-metgen/actions/workflows/workflow.yml/badge.svg)
# MetGenC
From 4d755a528a5caa48b6081e6d42a4150af6580908 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:06:35 -0700
Subject: [PATCH 22/34] Experiment with GHA badges
---
README.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e6e9d1d..11198d8 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,14 @@
-# Badges
+# MetGenC
+
+-----------------
![push workflow](https://github.com/nsidc/granule-metgen/actions/workflows/push.yml/badge.svg)
![workflow workflow](https://github.com/nsidc/granule-metgen/actions/workflows/workflow.yml/badge.svg)
-# MetGenC
+-----------------
The `MetGenC` toolkit enables Operations staff and data
producers to create metadata files conforming to NASA's Common Metadata Repository UMM-G
From 4a38e4c5b0fd8aa744bb2b023302974d34479e53 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:07:16 -0700
Subject: [PATCH 23/34] Experiment with GHA badges
---
README.md | 4 ----
1 file changed, 4 deletions(-)
diff --git a/README.md b/README.md
index 11198d8..af62e62 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,9 @@
# MetGenC
------------------
-
![push workflow](https://github.com/nsidc/granule-metgen/actions/workflows/push.yml/badge.svg)
![workflow workflow](https://github.com/nsidc/granule-metgen/actions/workflows/workflow.yml/badge.svg)
------------------
-
The `MetGenC` toolkit enables Operations staff and data
producers to create metadata files conforming to NASA's Common Metadata Repository UMM-G
specification and ingest data directly to NASA EOSDIS’s Cumulus archive. Cumulus is an
From 1d0f0c31f80cda6f90a9585f615c80e9951cb567 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:26:56 -0700
Subject: [PATCH 24/34] Cleanup the GHA workflows
---
.../workflows/{push.yml => build-test.yml} | 4 +--
.../workflows/{workflow.yml => publish.yml} | 27 +++++++++----------
2 files changed, 15 insertions(+), 16 deletions(-)
rename .github/workflows/{push.yml => build-test.yml} (96%)
rename .github/workflows/{workflow.yml => publish.yml} (86%)
diff --git a/.github/workflows/push.yml b/.github/workflows/build-test.yml
similarity index 96%
rename from .github/workflows/push.yml
rename to .github/workflows/build-test.yml
index 3014ff5..016c1b6 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/build-test.yml
@@ -1,10 +1,10 @@
+name: Build & test
on:
push:
- branches: [main]
pull_request:
jobs:
- test:
+ build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/workflow.yml b/.github/workflows/publish.yml
similarity index 86%
rename from .github/workflows/workflow.yml
rename to .github/workflows/publish.yml
index f686e35..d147919 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/publish.yml
@@ -1,11 +1,8 @@
-name: Build & publish to PyPI
+name: Publish release to PyPI
on:
- workflow_dispatch:
- pull_request:
- push:
- tags:
- - "v[0-9]+.[0-9]+.[0-9]+*"
+ release:
+ types: [released]
jobs:
build:
@@ -46,25 +43,25 @@ jobs:
- uses: actions/upload-artifact@v4
with:
- path: dist
+ name: release-dists
+ path: dist/
publish:
- if: github.ref_type == 'tag'
name: Publish to PyPI
+ runs-on: ubuntu-latest
needs: [build]
- environment:
- name: PyPI
- url: https://pypi.org/p/nsidc-metgenc
permissions:
id-token: write
attestations: write
contents: read
- runs-on: ubuntu-latest
+ environment:
+ name: PyPI
+ url: https://pypi.org/p/nsidc-metgenc
steps:
- uses: actions/download-artifact@v4
with:
- path: dist
- merge-multiple: true
+ name: release-dists
+ path: dist/
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v1.4.3
@@ -73,3 +70,5 @@ jobs:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ packages-dir: dist/
From ae12f672345708b4746814f7f0a600f59a537915 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:28:46 -0700
Subject: [PATCH 25/34] Remove the pull-request trigger for the build-test GHA
workflow
---
.github/workflows/build-test.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index 016c1b6..0bdd3b1 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -1,7 +1,6 @@
name: Build & test
on:
push:
- pull_request:
jobs:
build:
From e53ad4fba2d2d9c5342589a61f548e2d5aee81d4 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:31:22 -0700
Subject: [PATCH 26/34] =?UTF-8?q?Bump=20version:=200.3.0=20=E2=86=92=200.4?=
=?UTF-8?q?.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 4 ++--
src/nsidc/metgen/__init__.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 0b9aeb3..597dc81 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nsidc-metgenc"
-version = "0.3.0"
+version = "0.4.0"
description = "The nsidc-metgen package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
authors = ["National Snow and Ice Data Center (NSIDC) "]
readme = "README.md"
@@ -33,7 +33,7 @@ mypy = "^1.11.1"
bump-my-version = "^0.28.1"
[tool.bumpversion]
-current_version = "0.3.0"
+current_version = "0.4.0"
parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
diff --git a/src/nsidc/metgen/__init__.py b/src/nsidc/metgen/__init__.py
index c403315..a3d9f01 100644
--- a/src/nsidc/metgen/__init__.py
+++ b/src/nsidc/metgen/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "v0.3.0"
+__version__ = "v0.4.0"
__all__ = ["__version__"]
From 3e677092cfa890f68d0000310cf62668e4fd189a Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:44:38 -0700
Subject: [PATCH 27/34] Update the README with complete release instructions
---
README.md | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index af62e62..d17f986 100644
--- a/README.md
+++ b/README.md
@@ -229,13 +229,22 @@ TBD
├─ minor ─ 0.4.0
╰─ patch ─ 0.3.1
-* Bump the version to the desired number:
+* Bump the version to the desired number, for example:
$ bump-my-version bump minor
You will see the latest commit & tag by looking at `git log`. You
can then push these to GitHub to trigger the CI/CD workflow.
+* On the [GitHub repository](https://github.com/nsidc/granule-metgen), click
+ 'Releases' and follow the steps documented on the
+ [GitHub Released page](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)
+ by drafting a new Release using the version tag just created above. After you
+ have published the release, the MetGenC Publish GHA workflow will be started.
+ Check that the workflow succeeds on the [MetGenC Actions page], and verify
+ that the new package version is
+ [available on PyPI](https://pypi.org/project/nsidc-metgenc/).
+
## Credit
This content was developed by the National Snow and Ice Data Center with funding from
From b877b6084acb4c4fb3f147e66e064334c0d01088 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:45:15 -0700
Subject: [PATCH 28/34] Fix pyproject description
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 597dc81..bb9ada2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]
name = "nsidc-metgenc"
version = "0.4.0"
-description = "The nsidc-metgen package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
+description = "The nsidc-metgenc package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
authors = ["National Snow and Ice Data Center (NSIDC) "]
readme = "README.md"
package-mode = true
From 91e72ad10309ab93b6537190c9d49666571a77d1 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:47:13 -0700
Subject: [PATCH 29/34] Fix GHA badges in the README
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index d17f986..7599a2e 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@
# MetGenC
-![push workflow](https://github.com/nsidc/granule-metgen/actions/workflows/push.yml/badge.svg)
-![workflow workflow](https://github.com/nsidc/granule-metgen/actions/workflows/workflow.yml/badge.svg)
+![build & test workflow](https://github.com/nsidc/granule-metgen/actions/workflows/build-test.yml/badge.svg)
+![workflow workflow](https://github.com/nsidc/granule-metgen/actions/workflows/publish.yml/badge.svg)
The `MetGenC` toolkit enables Operations staff and data
producers to create metadata files conforming to NASA's Common Metadata Repository UMM-G
From bb97084e0f3a38b6f5b59173f4cfbb9d70ba0983 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 26 Nov 2024 13:51:30 -0700
Subject: [PATCH 30/34] Fix up the release instructions in the README
---
README.md | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 7599a2e..a6988a5 100644
--- a/README.md
+++ b/README.md
@@ -238,12 +238,13 @@ TBD
* On the [GitHub repository](https://github.com/nsidc/granule-metgen), click
'Releases' and follow the steps documented on the
- [GitHub Released page](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)
- by drafting a new Release using the version tag just created above. After you
- have published the release, the MetGenC Publish GHA workflow will be started.
- Check that the workflow succeeds on the [MetGenC Actions page], and verify
- that the new package version is
- [available on PyPI](https://pypi.org/project/nsidc-metgenc/).
+ [GitHub Releases page](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release).
+ Draft a new Release using the version tag created above. After you have
+ published the release, the MetGenC Publish GHA workflow will be started.
+ Check that the workflow succeeds on the
+ [MetGenC Actions page](https://github.com/nsidc/granule-metgen/actions),
+ and verify that the
+ [new MetGenC release is available on PyPI](https://pypi.org/project/nsidc-metgenc/).
## Credit
From 14f5d22df6810b42f9a92a726d45f4d07ea44c33 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 2 Dec 2024 15:12:24 -0700
Subject: [PATCH 31/34] Update README; bump version changes CHANGELOG
---
README.md | 15 +++++++++++++--
pyproject.toml | 5 +++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index a6988a5..c4764bd 100644
--- a/README.md
+++ b/README.md
@@ -199,6 +199,15 @@ TBD
* [Python](https://www.python.org/) v3.12+
* [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer)
+You can install [Poetry](https://python-poetry.org/) either by using the [official
+installer](https://python-poetry.org/docs/#installing-with-the-official-installer)
+if you’re comfortable following the instructions, or by using a package
+manager (like Homebrew) if this is more familiar to you. When successfully
+installed, you should be able to run:
+
+ $ poetry --version
+ Poetry (version 1.8.3)
+
### Installing Dependencies
* Use Poetry to create and activate a virtual environment
@@ -219,8 +228,10 @@ TBD
### Releasing
-* Update the CHANGELOG to reflect the latest version and the
- changes included in the release.
+* Update the CHANGELOG to include details of the changes included in the new
+ release. The version should be the string literal 'UNRELEASED' (without
+ single-quotes). It will be replaced with the actual version number after
+ we bump the version below.
* Show the current version and the possible next versions:
diff --git a/pyproject.toml b/pyproject.toml
index bb9ada2..a30262b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -61,6 +61,11 @@ filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
+[[tool.bumpversion.files]]
+filename = "CHANGELOG.md"
+search = 'UNRELEASED'
+replace = 'v{new_version}'
+
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
From 4da6cfd452ba8141caa7a41f1c446d51eba1f547 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 2 Dec 2024 15:14:33 -0700
Subject: [PATCH 32/34] Modify changelog to have UNRELEASED version
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f70877..6fa1c41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
MetGenC Changelog
-## v1.0.0
+## UNRELEASED
This is the Minimum Viable Product (MVP) release of MetGenC. The
features include:
From c28b9d21d58f51be2f500ff539ac139a683ae4a8 Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Mon, 2 Dec 2024 15:49:28 -0700
Subject: [PATCH 33/34] Update instructions for pushing release
---
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c4764bd..b6171b9 100644
--- a/README.md
+++ b/README.md
@@ -244,8 +244,9 @@ installed, you should be able to run:
$ bump-my-version bump minor
- You will see the latest commit & tag by looking at `git log`. You
- can then push these to GitHub to trigger the CI/CD workflow.
+ You will see the latest commit & tag by looking at `git log`. You can then
+ push these to GitHub (`git push --follow-tags`) to trigger the CI/CD
+ workflow.
* On the [GitHub repository](https://github.com/nsidc/granule-metgen), click
'Releases' and follow the steps documented on the
From 021f468922c033cdaa07529f1cafc95e474abb7c Mon Sep 17 00:00:00 2001
From: "Kevin W. Beam"
Date: Tue, 3 Dec 2024 13:53:20 -0700
Subject: [PATCH 34/34] Fix README install instructions
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c396ca4..aefcf8b 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ this can be accomplished are detailed in the **AWS Credentials** section below.
can be used to determine the padding added to x and y values.
- Date/time strings can be parsed using `datetime.fromisoformat`
-## Installation of MetGenC from GitHub
+## Installing MetGenC
MetGenC can be installed from [PyPI](https://pypi.org/):