Skip to content

Commit f7596fa

Browse files
authored
enh: significant file simplify for workshop (#63)
* enh: file updates for workshop * enh: dev docs and release updates * enh: Update package with simpler interface fix: linting docstrings enh: templates enh no more codespell Older precommit fix fix fix: deps Fix: cleanup actions oops feat: docs build Fix: docs Fix: tests fix: dep
1 parent f59549a commit f7596fa

27 files changed

+2241
-196
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Editor Configuration (http://editorconfig.org)
2+
# This file is used to maintain consistent coding styles between different editors and IDEs
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
max_line_length = 88
13+
14+
[*.{json,yml,yaml}]
15+
indent_size = 2
16+
17+
[*.{md,rst}]
18+
trim_trailing_whitespace = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [ ] fix #(issue number)
2+
- [ ] description of feature/fix
3+
- [ ] tests added/passed
4+
- [ ] add an entry to the [changelog](../CHANGELOG.md)

.github/SUPPORT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Support
2+
3+
* Start a [discussion topic](https://github.com/pyopensci/pyospackage/discussions)
4+
* Email the authors or maintainers

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: monthly
8+
labels:
9+
- security
10+
- dependency-update
11+
commit-message:
12+
prefix: "chore: bump GitHub Actions"
13+
include: "scope"
14+
open-pull-requests-limit: 5
15+
rebase-strategy: auto

.github/workflows/docs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build Documentation
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
15+
16+
- name: Set up Python 3.11
17+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
18+
with:
19+
python-version: '3.11'
20+
- name: Install hatch
21+
run: |
22+
pipx install hatch
23+
24+
- name: Check docstrings
25+
run: hatch run style:docstrings

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run linters
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
15+
16+
- name: Set up Python 3.11
17+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
18+
with:
19+
python-version: '3.11'
20+
- name: Install hatch
21+
run: |
22+
pipx install hatch
23+
24+
- name: Check code style
25+
run: hatch run style:code
26+
27+
- name: Check docstrings
28+
run: hatch run style:docstrings

.github/workflows/publish-pypi.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to PyPI
1+
name: Build & Publish to PyPI
22
on:
33
release:
44
types: [published]
@@ -18,7 +18,7 @@ jobs:
1818
environment: build
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
2222
with:
2323
# This fetch element is only important if you are use SCM based
2424
# versioning (that looks at git tags to gather the version)
@@ -29,9 +29,9 @@ jobs:
2929
run: git fetch origin 'refs/tags/*:refs/tags/*'
3030

3131
- name: Setup Python
32-
uses: actions/setup-python@v5
32+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
3333
with:
34-
python-version: "3.10"
34+
python-version: "3.11"
3535
- name: Install Hatch
3636
run: |
3737
pipx install hatch
@@ -45,7 +45,7 @@ jobs:
4545
ls -lh dist/
4646
# Store an artifact of the build to use in the publish step below
4747
- name: Store the distribution packages
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4949
with:
5050
name: python-package-distributions
5151
path: dist/
@@ -66,11 +66,11 @@ jobs:
6666
steps:
6767
# Version 4 doesn't support GitHub enterprise yet
6868
- name: Download all the dists
69-
uses: actions/download-artifact@v4
69+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
7070
with:
7171
name: python-package-distributions
7272
path: dist/
7373
- name: Publish package to PyPI
7474
# Only publish to real PyPI on release
7575
if: github.event_name == 'release'
76-
uses: pypa/gh-action-pypi-publish@release/v1
76+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
prerequisites:
9+
uses: ./.github/workflows/test.yml
10+
# Setup build separate from publish for added security
11+
# See https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093
12+
build:
13+
needs: [prerequisites]
14+
runs-on: ubuntu-latest
15+
# Environment is encouraged for increased security
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
# This fetch element is only important if you are use SCM based
21+
# versioning (that looks at git tags to gather the version).
22+
# setuptools-scm needs tags to form a valid version number
23+
fetch-tags: true
24+
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
# You can modify what version of Python you want to use for your release
29+
python-version: "3.11"
30+
31+
# Whenever possible, pin your project development dependencies to a specific version
32+
- name: Install Hatch
33+
run: |
34+
pip install hatch==1.15.1
35+
36+
- name: Build package using Hatch
37+
run: |
38+
hatch build
39+
echo ""
40+
echo "Generated files:"
41+
ls -lh dist/
42+
43+
# Store an artifact of the build to use in the publish step below
44+
- name: Store the distribution packages
45+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
if-no-files-found: error
50+
publish:
51+
name: >-
52+
Publish Python 🐍 distribution 📦 to PyPI
53+
# Modify the repo name below to be your project's repo name.
54+
if: github.repository_owner == "pyopensci"
55+
needs:
56+
- build
57+
runs-on: ubuntu-latest
58+
# Environment required here for trusted publisher
59+
# You can set permissions for this environment so it can only be used by
60+
# certain people
61+
environment:
62+
name: pypi
63+
# Modify the url to be the name of your package
64+
url: https://pypi.org/p/pyospackage
65+
permissions:
66+
id-token: write # this permission is mandatory for PyPI publishing
67+
steps:
68+
- name: Download dists
69+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
merge-multiple: true
74+
- name: Publish package to PyPI
75+
# Only publish to real PyPI on release
76+
if: github.event_name == 'release' && github.event.action == 'published'
77+
uses: pypa/gh-action-pypi-publish@release/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Run Test Suite
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
# run tests at 00:00 UTC on day 1 of every month
10+
- cron: '0 0 1 * *'
11+
12+
jobs:
13+
lint:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest]
19+
python-version: ["3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Hatch
29+
run: |
30+
pip install hatch==1.15.1
31+
32+
- name: Build documentation
33+
run: hatch run docs:build
34+
test:
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os: [ubuntu-latest, macos-latest, windows-latest]
40+
python-version: ["3.11", "3.13"]
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
- name: Install hatch
50+
uses: pypa/hatch@install
51+
52+
- name: Check dependencies
53+
run: hatch run audit:check
54+
55+
- name: Test suite
56+
run: hatch run +py=${{ matrix.python-version }} test:run
57+
58+
- name: Report coverage
59+
shell: bash
60+
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)