Skip to content

Commit 7d89cbf

Browse files
Antony BaileyAntony Bailey
authored andcommitted
have at it
1 parent 6e2d010 commit 7d89cbf

38 files changed

+1427
-114
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
open-pull-requests-limit: 10
13+
assignees:
14+
- "yourusername"
15+
labels:
16+
- "dependencies"
17+
- "python"
18+
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
open-pull-requests-limit: 5
24+
labels:
25+
- "dependencies"
26+
- "github_actions"

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Pull Request
2+
3+
## Description
4+
5+
<!-- Describe your changes in detail -->
6+
7+
## Related Issue
8+
9+
<!-- Please link to the issue here if applicable -->
10+
Fixes #
11+
12+
## Type of Change
13+
14+
<!-- Please check the one that applies -->
15+
- [ ] Bug fix (non-breaking change which fixes an issue)
16+
- [ ] New feature (non-breaking change which adds functionality)
17+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
18+
- [ ] Documentation update
19+
- [ ] Test addition/improvement
20+
- [ ] Performance improvement
21+
- [ ] Code cleanup/refactoring
22+
23+
## How Has This Been Tested?
24+
25+
<!-- Please describe the tests that you ran to verify your changes -->
26+
- [ ] Unit Tests
27+
- [ ] Integration Tests
28+
- [ ] Manual Testing (please describe)
29+
30+
## Checklist
31+
32+
<!-- Please check all items that apply -->
33+
- [ ] My code follows the project's style guidelines
34+
- [ ] I have performed a self-review of my own code
35+
- [ ] I have commented my code, particularly in hard-to-understand areas
36+
- [ ] I have made corresponding changes to the documentation
37+
- [ ] My changes generate no new warnings
38+
- [ ] I have added tests that prove my fix is effective or that my feature works
39+
- [ ] New and existing unit tests pass locally with my changes
40+
- [ ] Any dependent changes have been merged and published

.github/workflows/python-package.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
32

43
name: Python package
54

@@ -11,7 +10,6 @@ on:
1110

1211
jobs:
1312
build:
14-
1513
runs-on: ubuntu-latest
1614
strategy:
1715
fail-fast: false
@@ -27,14 +25,15 @@ jobs:
2725
- name: Install dependencies
2826
run: |
2927
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
31-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32-
- name: Lint with flake8
28+
python -m pip install pytest ruff black
29+
python -m pip install -e ".[dev]"
30+
- name: Lint with ruff
31+
run: |
32+
# Use ruff for faster linting
33+
ruff check .
34+
- name: Check formatting with black
3335
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
black --check .
3837
- name: Test with pytest
3938
run: |
4039
pytest
Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# This workflow will upload a Python Package to PyPI when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
82

93
name: Upload Python Package
104

@@ -14,57 +8,32 @@ on:
148

159
permissions:
1610
contents: read
11+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1712

1813
jobs:
19-
release-build:
14+
deploy:
2015
runs-on: ubuntu-latest
21-
2216
steps:
23-
- uses: actions/checkout@v4
24-
25-
- uses: actions/setup-python@v5
26-
with:
27-
python-version: "3.x"
17+
- uses: actions/checkout@v4
2818

29-
- name: Build release distributions
30-
run: |
31-
# NOTE: put your own distribution build steps here.
32-
python -m pip install build
33-
python -m build
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
3423

35-
- name: Upload distributions
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: release-dists
39-
path: dist/
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
4028
41-
pypi-publish:
42-
runs-on: ubuntu-latest
43-
needs:
44-
- release-build
45-
permissions:
46-
# IMPORTANT: this permission is mandatory for trusted publishing
47-
id-token: write
48-
49-
# Dedicated environments with protections for publishing are strongly recommended.
50-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51-
environment:
52-
name: pypi
53-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54-
# url: https://pypi.org/p/YOURPROJECT
55-
#
56-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57-
# ALTERNATIVE: exactly, uncomment the following line instead:
58-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
29+
- name: Build package
30+
run: python -m build
5931

60-
steps:
61-
- name: Retrieve release distributions
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: release-dists
65-
path: dist/
32+
- name: Check package
33+
run: twine check dist/*
6634

67-
- name: Publish release distributions to PyPI
68-
uses: pypa/gh-action-pypi-publish@release/v1
69-
with:
70-
packages-dir: dist/
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@release/v1
37+
with:
38+
password: ${{ secrets.PYPI_API_TOKEN }}
39+
verify-metadata: true

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: debug-statements
9+
- id: check-added-large-files
10+
11+
- repo: https://github.com/psf/black
12+
rev: 24.3.0
13+
hooks:
14+
- id: black
15+
16+
- repo: https://github.com/pycqa/isort
17+
rev: 5.12.0
18+
hooks:
19+
- id: isort
20+
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: v0.1.11
23+
hooks:
24+
- id: ruff

0 commit comments

Comments
 (0)