Skip to content

Commit

Permalink
Merge pull request #149 from nasa/release/1.3.0
Browse files Browse the repository at this point in the history
Release/1.3.0
  • Loading branch information
danielfromearth authored Nov 19, 2024
2 parents 5b1ac63 + f9709b2 commit 70484a0
Show file tree
Hide file tree
Showing 14 changed files with 462 additions and 477 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/[email protected].0
uses: abatilo/[email protected].1
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Get version
Expand Down Expand Up @@ -120,8 +120,8 @@ jobs:
run: |
git config --global user.name 'batchee bot'
git config --global user.email '[email protected]'
git commit -am "/version ${{ env.software_version }}"
git push
git commit -am "/version ${{ env.software_version }}" --no-verify
git push --no-verify
# Builds and pushes the package to the Python Package Index (PyPI)
- name: Build Python Artifact
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
- name: Build and push Docker image
if: ${{ !startsWith(github.ref, 'refs/heads/main/') }}
id: docker-push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/[email protected].0
uses: abatilo/[email protected].1
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Bump minor version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up Poetry
uses: abatilo/[email protected].0
uses: abatilo/[email protected].1
with:
poetry-version: ${{ env.POETRY_VERSION }}

Expand All @@ -39,7 +39,7 @@ jobs:

- name: Lint
run: |
poetry run ruff batcher
poetry run ruff check batcher
- name: Run tests with coverage
run: |
Expand Down
Empty file modified .github/workflows/wait-for-pypi.py
100644 → 100755
Empty file.
63 changes: 37 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,53 @@ ci:
autoupdate_branch: "develop"
autofix_prs: false # Comment "pre-commit.ci autofix" on a PR to trigger

default_language_version:
python: python3.10

repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: tests(/\w*)*/functional/t/trailing_whitespaces.py|tests/pyreverse/data/.*.html|doc/data/messages/t/trailing-whitespace/bad.py
# Validate format
- id: check-yaml
- id: check-toml
- id: check-json
# Check for common mistakes
- id: check-added-large-files
- id: check-case-conflict
# - id: check-illegal-windows-names # TODO: Enable in next release
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-vcs-permalinks
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: |
(?x)^(
tests(/\w*)*/functional/m/missing/missing_final_newline.py|
tests/functional/t/trailing_newlines.py|
doc/data/messages/t/trailing-newlines/bad.py|
)$
- id: mixed-line-ending
- id: no-commit-to-branch # protects `main` by default
- id: debug-statements
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.4.10'
rev: v0.7.3
hooks:
- id: ruff
args: [ "--fix" ]

# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black-jupyter
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.13.0
hooks:
- id: mypy

# Other Linters
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d {extends: relaxed, rules: {line-length: {max: 120}}}"]
stages: [commit, push]
# TODO: Reconsider using the alexjs hook when there is a way to ignore particular warnings and/or files.
# - repo: "https://github.com/mfisher87/alexjs-pre-commit-mirror"
# rev: "v11.0.1" # Use the sha / tag you prefer
# hooks:
# - id: "alex"
65 changes: 34 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Common Changelog](https://common-changelog.org/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]
## [1.3.0] - 2024-11-19

### Added
- [issue #127](https://github.com/nasa/batchee/issues/127): Group dependabot updates into fewer PRs
- [issue #129](https://github.com/nasa/batchee/issues/129): Add autoupdate schedule for pre-commit
### Changed
- [issue #128](https://github.com/nasa/batchee/issues/128): Increase continuous integration/unit test coverage
### Deprecated
### Removed
### Fixed

## [1.1.0]
- update pre commit: to autoupdate and with gitleaks ([#147](https://github.com/nasa/batchee/pull/147))([**@danielfromearth**](https://github.com/danielfromearth))

## [1.2.0] - 2024-06-27

### Added
- [issue #114](https://github.com/nasa/batchee/issues/114): Add badges to the readme
### Changed
### Deprecated
### Removed
### Fixed

## [1.0.0]
- Increase continuous integration/unit test coverage ([#128](https://github.com/nasa/batchee/issues/128))([**@danielfromearth**](https://github.com/danielfromearth))

### Added

- Group dependabot updates into fewer PRs ([#127](https://github.com/nasa/batchee/issues/127))([**@danielfromearth**](https://github.com/danielfromearth))
- Add autoupdate schedule for pre-commit ([#129](https://github.com/nasa/batchee/issues/129))([**@danielfromearth**](https://github.com/danielfromearth))

## [1.1.0] - 2024-05-01

### Added
- [issue #6](https://github.com/danielfromearth/batchee/issues/6): Create Adapter code that processes a Harmony Message and STAC Catalog
- [issue #7](https://github.com/danielfromearth/batchee/issues/7): Create working Docker image
- [issue #13](https://github.com/danielfromearth/batchee/issues/13): Add simple command line interface for testing
- [issue #16](https://github.com/danielfromearth/batchee/issues/16): Add a logo
- [PR #75](https://github.com/danielfromearth/batchee/pull/75): Add Docker build steps to GitHub Actions workflow
- [PR #84](https://github.com/danielfromearth/batchee/pull/84): Add readme badges
- [PR #100](https://github.com/danielfromearth/batchee/pull/100): Add license
- [PR #111](https://github.com/nasa/batchee/pull/111): Add codecov to CI pipeline
- [PR #112](https://github.com/nasa/batchee/pull/111): Add SNYK and PyPI to CI pipeline

- Add badges to the readme ([#114](https://github.com/nasa/batchee/issues/114))([**@danielfromearth**](https://github.com/danielfromearth))

## [1.0.0] - 2024-04-23

### Changed
- [issue #11](https://github.com/danielfromearth/batchee/issues/11): Rename from concat_batcher to batchee
- [issue #21](https://github.com/danielfromearth/batchee/issues/21): Improve CICD workflows
- [issue #41](https://github.com/danielfromearth/batchee/issues/41): Change Adapter output from single to multiple STAC Catalogs
### Deprecated
### Removed
### Fixed

- Rename from concat_batcher to batchee ([#11](https://github.com/nasa/batchee/issues/11))([**@danielfromearth**](https://github.com/danielfromearth))
- Improve CICD workflows ([#21](https://github.com/nasa/batchee/issues/21))([**@danielfromearth**](https://github.com/danielfromearth))
- Change Adapter output from single to multiple STAC Catalogs ([#41](https://github.com/nasa/batchee/issues/41))([**@danielfromearth**](https://github.com/danielfromearth))

### Added

- Create Adapter code that processes a Harmony Message and STAC Catalog ([#6](https://github.com/nasa/batchee/issues/6))([**@danielfromearth**](https://github.com/danielfromearth))
- Create working Docker image ([#7](https://github.com/nasa/batchee/issues/7))([**@danielfromearth**](https://github.com/danielfromearth),[**@hpatel426**](https://github.com/hpatel426))
- Add simple command line interface for testing ([#13](https://github.com/nasa/batchee/issues/13))([**@danielfromearth**](https://github.com/danielfromearth))
- Add a logo ([#16](https://github.com/nasa/batchee/issues/16))([**@danielfromearth**](https://github.com/danielfromearth))
- Add Docker build steps to GitHub Actions workflow ([#75](https://github.com/nasa/batchee/pull/75))([**@danielfromearth**](https://github.com/danielfromearth))
- Add readme badges ([#84](https://github.com/nasa/batchee/pull/84))([**@danielfromearth**](https://github.com/danielfromearth))
- Add license ([#100](https://github.com/nasa/batchee/pull/100))([**@danielfromearth**](https://github.com/danielfromearth))
- Add codecov to CI pipeline ([#111](https://github.com/nasa/batchee/pull/111))([**@danielfromearth**](https://github.com/danielfromearth))
- Add SNYK and PyPI to CI pipeline ([#112](https://github.com/nasa/batchee/pull/111))([**@danielfromearth**](https://github.com/danielfromearth))
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<a href="https://www.repostatus.org/#active" target="_blank">
<img src="https://www.repostatus.org/badges/latest/active.svg" alt="Project Status: Active – The project has reached a stable, usable state and is being actively developed">
</a>
<a href="https://github.com/python/black" target="_blank">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style">
</a>
<a href="http://mypy-lang.org/" target="_blank">
<img src="http://www.mypy-lang.org/static/mypy_badge.svg" alt="Mypy checked">
</a>
Expand Down
14 changes: 8 additions & 6 deletions batcher/harmony/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
"""A Harmony CLI wrapper around the concatenate-batcher"""

from argparse import ArgumentParser

import harmony
import harmony_service_lib

from batcher.harmony.service_adapter import ConcatBatching as HarmonyAdapter


def main(config: harmony.util.Config = None) -> None:
def main(config: harmony_service_lib.util.Config = None) -> None:
"""Parse command line arguments and invoke the service to respond to them.
Parameters
Expand All @@ -45,12 +46,13 @@ def main(config: harmony.util.Config = None) -> None:
None
"""
parser = ArgumentParser(
prog="Pre-concatenate-batching", description="Run the pre-concatenate-batching service"
prog="Pre-concatenate-batching",
description="Run the pre-concatenate-batching service",
)
harmony.setup_cli(parser)
harmony_service_lib.setup_cli(parser)
args = parser.parse_args()
if harmony.is_harmony_cli(args):
harmony.run_cli(parser, args, HarmonyAdapter, cfg=config)
if harmony_service_lib.is_harmony_cli(args):
harmony_service_lib.run_cli(parser, args, HarmonyAdapter, cfg=config)
else:
parser.error("Only --harmony CLIs are supported")

Expand Down
4 changes: 2 additions & 2 deletions batcher/harmony/service_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from uuid import uuid4

import pystac
from harmony.adapter import BaseHarmonyAdapter
from harmony.util import bbox_to_geometry
from harmony_service_lib.adapter import BaseHarmonyAdapter
from harmony_service_lib.util import bbox_to_geometry
from pystac import Item
from pystac.item import Asset

Expand Down
6 changes: 5 additions & 1 deletion batcher/harmony/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
"""Misc utility functions"""

from datetime import datetime

from pystac import Asset, Item
Expand Down Expand Up @@ -104,7 +105,10 @@ def _get_output_date_range(input_items: list[Item]) -> dict[str, str]:
start_datetime = min(start_datetime, new_start_datetime)
end_datetime = max(end_datetime, new_end_datetime)

return {"start_datetime": start_datetime.isoformat(), "end_datetime": end_datetime.isoformat()}
return {
"start_datetime": start_datetime.isoformat(),
"end_datetime": end_datetime.isoformat(),
}


def _get_item_date_range(item: Item) -> tuple[datetime, datetime]:
Expand Down
4 changes: 3 additions & 1 deletion batcher/tempo_filename_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
"""Holds the logic for grouping together data files based on their filenames."""

import logging
import re
from argparse import ArgumentParser
Expand Down Expand Up @@ -79,7 +80,8 @@ def main() -> list[list[str]]:
"""Main CLI entrypoint"""

parser = ArgumentParser(
prog="batchee", description="Simple CLI wrapper around the granule batcher module."
prog="batchee",
description="Simple CLI wrapper around the granule batcher module.",
)
parser.add_argument(
"file_names",
Expand Down
Loading

0 comments on commit 70484a0

Please sign in to comment.