Skip to content

Commit

Permalink
Merge pull request #218 from ASFHyP3/develop
Browse files Browse the repository at this point in the history
Release v0.14.0
  • Loading branch information
jtherrmann authored Jan 7, 2025
2 parents 35f98c5 + c7931c4 commit 262d69e
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
- develop
jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.13.2
2 changes: 1 addition & 1 deletion .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.13.2
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.13.2
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.13.2
with:
release_prefix: Actions
secrets:
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/reusable-flake8.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/reusable-mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
workflow_call:

jobs:
check-with-mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml

- name: Check with MyPy
shell: bash -l {0}
run: |
mkdir .mypy_cache && mypy --install-types --ignore-missing-imports --non-interactive --pretty .
10 changes: 4 additions & 6 deletions .github/workflows/reusable-ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ jobs:
python -m pip install --upgrade pip
python -m pip install ruff
- name: Ruff linting check
# To automatically fix errors, run `ruff check --fix .`
run: ruff check --output-format=github .
- name: ruff check
run: ruff check --output-format=github || (echo 'Run `ruff check --fix` to automatically fix errors where possible.' && exit 1)

- name: Ruff format check
# To automatically fix errors, run `ruff format .`
run: ruff format --diff .
- name: ruff format
run: ruff format --diff || (echo 'Run `ruff format` to automatically re-format.' && exit 1)
2 changes: 1 addition & 1 deletion .github/workflows/reusable-secrets-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fetch-depth: 0

- name: Secret Scanning
uses: trufflesecurity/trufflehog@v3.85.0
uses: trufflesecurity/trufflehog@v3.86.1
with:
base: main
extra_args: --only-verified
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on: push

jobs:
call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.13.2
2 changes: 1 addition & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.13.2
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
2 changes: 1 addition & 1 deletion .github/workflows/update-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
call-git-object-name-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.13.2

upate_actions_examples:
needs: call-git-object-name-workflow
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.14.0]

### Added
- [`reusable-mypy`](.github/workflows/reusable-mypy.yml) reusable workflow for performing static type checking with [mypy](https://github.com/python/mypy).
- [`reusable-ruff`](.github/workflows/reusable-ruff.yml) now prints the suggested commands for automatically fixing errors.

### Removed
- `reusable-flake8.yml` has been removed. We recommend [`reusable-ruff`](.github/workflows/reusable-ruff.yml) instead.

## [0.13.2]

### Fixed
Expand Down
93 changes: 59 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
call-bump-version-workflow:
# For first-time setup, create a v0.0.0 tag as shown here:
# https://github.com/ASFHyP3/actions#reusable-bump-versionyml
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.13.2
with:
user: tools-bot # Optional; default shown
email: [email protected] # Optional; default shown
Expand Down Expand Up @@ -68,7 +68,7 @@ on:
jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.13.2
```

to ensure the changelog has been updated for any PR to `develop` or `main`.
Expand All @@ -86,7 +86,7 @@ on:
jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.13.2
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Expand Down Expand Up @@ -139,13 +139,13 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.13.2
with:
conda_env_name: hyp3-plugin
call-docker-ecr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ecr.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ecr.yml@v0.13.2
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
ecr_registry: 845172464411.dkr.ecr.us-west-2.amazonaws.com
Expand Down Expand Up @@ -180,13 +180,13 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.13.2
with:
conda_env_name: hyp3-plugin
call-docker-ghcr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.13.2
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
user: ${{ github.actor }}
Expand All @@ -197,25 +197,6 @@ jobs:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

### [`reusable-flake8.yml`](./.github/workflows/reusable-flake8.yml)

Runs [flake8](https://flake8.pycqa.org/en/latest/) to enforce ASFHyP3's Python style guide. Use like:

```yaml
name: Static analysis
on: push
jobs:
call-flake8-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
local_package_names: hyp3_plugin # Required; comma-seperated list of names that should be considered local to your application
excludes: hyp3_plugin/ugly.py # Optional; comma-separated list of glob patterns to exclude from checks
```

to ensure the Python code is styled correctly.

### [`reusable-ruff.yml`](./.github/workflows/reusable-ruff.yml)

Runs [Ruff](https://docs.astral.sh/ruff/) to enforce a configurable Python style guide. Use like:
Expand All @@ -227,7 +208,7 @@ on: push
jobs:
call-ruff-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.13.2
```

Make sure that `pyproject.toml` contains the appropriate Python version specifier
Expand Down Expand Up @@ -269,6 +250,50 @@ case-sensitive = true
lines-after-imports = 2
```

### [`reusable-mypy.yml`](./.github/workflows/reusable-mypy.yml)

Runs [mypy](https://mypy-lang.org/) to perform static type checking for Python code. Use like:

```yaml
name: Static analysis
on: push
jobs:
call-mypy-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
```

To use our recommended configuration options, add the following to `pyproject.toml`:

```toml
[tool.mypy]
python_version = ""
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
strict_equality = true
check_untyped_defs = true
```

Populate the
[`python_version`](https://mypy.readthedocs.io/en/stable/config_file.html#confval-python_version) field
with the appropriate Python version in the format `MAJOR.MINOR`.
This should probably be the minimum Python version supported by the project,
determined by the value of the
[`requires-python`](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#python-requires) field.
For example, if `requires-python` specifies `>=3.10`, then you may want to set `python_version` to `3.10`, like this:

```
[project]
requires-python = ">=3.10"
...
[tool.mypy]
python_version = "3.10"
```

### [`reusable-git-object-name.yml`](./.github/workflows/reusable-git-object-name.yml)

Outputs the human-readable git object name from [`git describe --dirty --tags --long --match "*[0-9]*"`](https://git-scm.com/docs/git-describe)
Expand All @@ -289,7 +314,7 @@ on:
jobs:
call-git-object-name-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.13.2
echo-git-object-name-outputs:
needs: call-git-object-name-workflow
Expand Down Expand Up @@ -319,7 +344,7 @@ on:
jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.13.2
```
to ensure a release label is included on any PR to `main`.

Expand All @@ -343,7 +368,7 @@ on:
jobs:
call-pytest-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.13.2
with:
local_package_name: hyp3_plugin # Required; package to produce a coverage report for
fail_fast: false # Optional; default shown
Expand Down Expand Up @@ -372,7 +397,7 @@ on:
jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.13.2
with:
release_prefix: HyP3-CI
release_branch: main # Optional; default shown
Expand Down Expand Up @@ -401,7 +426,7 @@ on:
jobs:
call-release-checklist-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.13.2
permissions:
pull-requests: write
with:
Expand Down Expand Up @@ -431,7 +456,7 @@ on: push
jobs:
call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.13.2
```
to scan every push for secrets.

Expand All @@ -457,7 +482,7 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.12.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.13.2
with:
python_version: '3.12' # Optional; default shown
Expand Down

0 comments on commit 262d69e

Please sign in to comment.