Skip to content

Commit ba3b3b1

Browse files
apply template
1 parent 1459190 commit ba3b3b1

37 files changed

Lines changed: 1220 additions & 482 deletions

.cruft.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"template": "https://github.com/zacharyburnett/stsci-package-template",
3+
"commit": "4503bbf380a0471fc60ea92118ca384407aa2ea0",
4+
"checkout": "modernize",
5+
"context": {
6+
"cookiecutter": {
7+
"project_name": "stpipe",
8+
"package_name": "stpipe",
9+
"repository_url": "https://github.com/spacetelescope/stpipe",
10+
"project_description": "Provides base classes and command-line tools for implementing calibration pipeline software.",
11+
"manage_changelog_with_towncrier": true,
12+
"publish_docs_to": "readthedocs.io",
13+
"task_runner": "tox",
14+
"python_version": ">=3.10",
15+
"python_c_extensions": false,
16+
"python_build_backend": "setuptools",
17+
"crds_observatory": "none",
18+
"_template": "https://github.com/zacharyburnett/stsci-package-template",
19+
"_commit": "4503bbf380a0471fc60ea92118ca384407aa2ea0"
20+
}
21+
},
22+
"directory": "python-package"
23+
}

.github/actionlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
paths:
2+
.github/workflows/**/*.{yml,yaml}:
3+
ignore:
4+
- "SC2086"
5+
- "SC2046"

.github/dependabot.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
version: 2
2-
updates:
3-
4-
# Maintain dependencies for GitHub Actions
5-
- package-ecosystem: "github-actions"
6-
directory: "/"
7-
target-branch: "main"
8-
schedule:
9-
interval: "weekly"
10-
reviewers:
11-
- "zacharyburnett"
122

13-
# Maintain dependencies for pip
3+
updates:
144
- package-ecosystem: "pip"
155
directory: "/"
6+
labels:
7+
- no-changelog-entry-needed
168
target-branch: "main"
179
schedule:
18-
interval: "weekly"
19-
reviewers:
20-
- "zacharyburnett"
10+
interval: "monthly"
11+
cooldown:
12+
default-days: 7
13+
groups:
14+
actions:
15+
patterns:
16+
- "*"

.github/labeler.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
breaking-change:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- "changes/*.breaking.rst"
5+
6+
feature:
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- "changes/*.feature.rst"
10+
11+
fix:
12+
- changed-files:
13+
- any-glob-to-any-file:
14+
- "changes/*.fix.rst"
15+
16+
documentation:
17+
- changed-files:
18+
- all-globs-to-any-file: ["*.rst", "!CHANGES.rst", "!changes/*"]
19+
- any-glob-to-any-file:
20+
- "docs/**/*"
21+
- "*.md"
22+
- ".readthedocs.yaml"
23+
- "LICENSE"
24+
- "changes/*.docs.rst"
25+
26+
packaging:
27+
- changed-files:
28+
- any-glob-to-any-file:
29+
- "pyproject.toml"
30+
31+
# --------------------------------------- testing ---------------------------------------
32+
33+
automation:
34+
- changed-files:
35+
- any-glob-to-any-file:
36+
- ".github/**"
37+
38+
testing:
39+
- changed-files:
40+
- any-glob-to-any-file:
41+
- "**/tests/**"
42+
- "**/regtest/**"
43+
- ".github/workflows/test*.yml"
44+
- "**/conftest.py"

.github/pull_request_template.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
<!-- If this PR closes a JIRA ticket, make sure the title starts with the JIRA issue number,
2-
for example JP-1234: <Fix a bug> -->
3-
Resolves [JP-nnnn](https://jira.stsci.edu/browse/JP-nnnn)
4-
Resolves [RCAL-nnnn](https://jira.stsci.edu/browse/RCAL-nnnn)
1+
<!-- If this PR addresses a JIRA ticket: -->
2+
<!-- Resolves [JP-nnnn](https://jira.stsci.edu/browse/JP-nnnn) -->
3+
<!-- Resolves [RCAL-nnnn](https://jira.stsci.edu/browse/RCAL-nnnn) -->
54

6-
<!-- If this PR closes a GitHub issue, reference it here by its number -->
7-
Closes #
5+
<!-- If this PR will close an existing GitHub issue (that is not already attached to a JIRA ticket): -->
6+
<!-- Closes # -->
87

9-
<!-- describe the changes comprising this PR here -->
10-
This PR addresses ...
8+
<!-- Describe your changes here: -->
9+
10+
## Description
11+
12+
This change ...
13+
14+
<!-- If you can't perform these tasks due to permissions, reach out to a maintainer. -->
1115

12-
<!-- if you can't perform these tasks due to permissions, please ask a maintainer to do them -->
1316
## Tasks
17+
1418
- [ ] update or add relevant tests
1519
- [ ] update relevant docstrings and / or `docs/` page
16-
- [ ] Does this PR change any API used downstream? (if not, label with `no-changelog-entry-needed`)
17-
- [ ] write news fragment(s) in `changes/`: `echo "changed something" > changes/<PR#>.<changetype>.rst` (see [changelog readme](https://github.com/spacetelescope/stpipe/blob/main/changes/README.rst) for instructions)
20+
- [ ] If this change affects user-facing code or public API, add news fragment file(s) to `changes/` (see [the changelog instructions](https://github.com/spacetelescope/stpipe/blob/main/changes/README.md)).
21+
Otherwise, add the `no-changelog-entry-needed` label.
1822
- [ ] run regression tests with this branch installed (`stpipe@git+https://github.com/<fork>/stpipe.git@<branch>`)
1923
- [ ] [`jwst` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/jwst.yml)
2024
- [ ] [`romancal` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/romancal.yml)

.github/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
changelog:
2+
categories:
3+
- title: Breaking Changes
4+
labels:
5+
- breaking-change
6+
- title: New Features
7+
labels:
8+
- feature
9+
- title: Fixes
10+
labels:
11+
- fix
12+
- title: Documentation Changes
13+
labels:
14+
- documentation
15+
- title: Other Changes
16+
labels:
17+
- "*"

.github/workflows/build.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
11
name: build
22

33
on:
4+
pull_request:
45
release:
56
types: [released]
6-
pull_request:
77
workflow_dispatch:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
11-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2
12-
with:
13-
upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }}
14-
secrets:
15-
pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
fetch-tags: true
20+
persist-credentials: false
21+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
22+
with:
23+
python-version: "3"
24+
- run: pip install build
25+
- run: python -m build --sdist --wheel
26+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
27+
with:
28+
name: dist
29+
path: ./dist/
30+
publish:
31+
if: (github.event_name == 'release') && (github.event.action == 'released')
32+
needs: [build]
33+
runs-on: ubuntu-latest
34+
permissions:
35+
id-token: write
36+
attestations: write
37+
# Requires environment protection rules in GitHub Settings:
38+
# Settings > Environments > pypi > Add required reviewers
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/stpipe
42+
steps:
43+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
44+
with:
45+
pattern: dist*
46+
path: dist/
47+
merge-multiple: true
48+
- uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
49+
with:
50+
subject-path: "dist/*"
51+
# To upload to PyPI without a token, add this workflow file as a Trusted Publisher in the project settings on the PyPI website
52+
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/changelog.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,21 @@ on:
1010
- reopened
1111

1212
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1414
cancel-in-progress: true
1515

1616
jobs:
17-
changelog-check:
17+
check:
1818
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }}
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/setup-python@v6
22-
with:
23-
python-version: 3.12
2421
- uses: actions/checkout@v6
2522
with:
26-
fetch-depth: 0
27-
- run: pip install .
28-
- run: pip install towncrier
29-
- run: towncrier check
30-
- run: towncrier build --draft | grep -P '#${{ github.event.number }}'
31-
changelog-prevent-manual-edit:
32-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'allow-manual-changelog-edit') }}
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v6
23+
persist-credentials: false
24+
- uses: actions/setup-python@v6
3625
with:
37-
fetch-depth: 0
38-
- name: prevent direct changes to `CHANGES.rst` (write a towncrier fragment in `changes/` instead; you can override this with the `allow-manual-changelog-edit` label)
39-
run: git diff HEAD ${{ github.event.pull_request.base.sha }} --no-patch --exit-code CHANGES.rst
26+
python-version: "3"
27+
- run: pip install . towncrier
28+
- run: towncrier check
29+
- name: search for news fragment matching pull request number
30+
run: towncrier build --draft | grep -P '#${{ github.event.number }}'

.github/workflows/label.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
pull_request_target:
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
jobs:
9+
label:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v6
13+
if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request'
14+
with:
15+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/tests.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
name: tests
22

33
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- ready_for_review
410
push:
511
branches:
612
- main
7-
tags:
8-
- "*"
9-
pull_request:
10-
schedule:
11-
# Weekly Monday 9AM build
12-
# * is a special character in YAML so you have to quote this string
13-
- cron: "0 9 * * 1"
1413
workflow_dispatch:
1514

15+
permissions: {}
16+
1617
concurrency:
17-
group: ${{ github.workflow }}-${{ github.ref }}
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1819
cancel-in-progress: true
1920

2021
jobs:
@@ -23,15 +24,17 @@ jobs:
2324
with:
2425
envs: |
2526
- linux: py310-oldestdeps-cov-xdist
26-
- linux: py310-xdist
27-
- linux: py311-xdist
2827
- linux: py311-downstreamdeps-cov-xdist
2928
coverage: 'codecov'
3029
- linux: py312-xdist-nolegacypath
31-
- linux: py313-xdist
3230
- linux: py314-cov-xdist
3331
coverage: 'codecov'
3432
- macos: py314-xdist
33+
fill: true
34+
fill_platforms: linux
35+
fill_factors: xdist
36+
artifact-path: |
37+
results.xml
3538
test_downstream:
3639
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
3740
with:
@@ -42,4 +45,4 @@ jobs:
4245
envs: |
4346
- linux: py313-jwst-cov
4447
- linux: py313-romancal-cov
45-
coverage: codecov
48+
coverage: github

0 commit comments

Comments
 (0)