Repository navigation
Modernize Boilerplate #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gadgetoid
wants to merge
13
commits into
main
Choose a base branch
from
uv-modernize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f3deaa7
CI: Set least-privilege permissions in workflows.
Gadgetoid b99c1e9
Remove defunct Stickler CI flake8 config.
Gadgetoid 321e6a0
Bump supported Python to 3.9-3.13.
Gadgetoid 3de0ff2
CI: Add Dependabot for actions and pip.
Gadgetoid 8dd1e69
Fold isort into ruff's import rules.
Gadgetoid 98ae5eb
Adopt PEP 735 dependency-groups for dev deps.
Gadgetoid ebabba2
CI: Use uv to install and run dev tooling.
Gadgetoid 9dec7aa
Add pre-commit hooks and .editorconfig.
Gadgetoid 34c90bb
Replace check.sh with pre-commit and inline release checks.
Gadgetoid bd6ad4f
Build with uv build to sidestep hatch/virtualenv skew.
Gadgetoid 1eb13e5
Trim wheel include to the package only
ninousf 8530af9
Widen ruff ruleset (UP/SIM/PIE/C4/B/RUF/PERF/FURB/PLE); pin ruff==0.1…
Gadgetoid 4d4fbcd
Adopt tag-derived versioning and PyPI trusted publishing
Gadgetoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
| charset = utf-8 | ||
|
|
||
| [Makefile] | ||
| indent_style = tab | ||
|
|
||
| [*.{py,cfg,ini,toml,yaml,yml,md,sh}] | ||
| indent_style = space | ||
| indent_size = 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| - package-ecosystem: "pip" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| - package-ecosystem: "pre-commit" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Build and publish to PyPI | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Build Packages | ||
| run: uv build | ||
|
|
||
| - name: Check version matches tag | ||
| run: | | ||
| TAG="${GITHUB_REF_NAME#v}" | ||
| BUILT="$(ls dist/*.whl | head -1 | cut -d- -f2)" | ||
| echo "tag=$TAG built=$BUILT" | ||
| if [ "$GITHUB_REF_NAME" != "$TAG" ] && [ "$TAG" != "$BUILT" ]; then | ||
| echo "::error::built $BUILT from tag $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Publish | ||
| run: uv publish --trusted-publishing always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,5 @@ library/debian/ | |
| .coverage | ||
| .pytest_cache | ||
| .tox | ||
| .venv | ||
| uv.lock | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: mixed-line-ending | ||
| args: ['--fix=lf'] | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.20 | ||
| hooks: | ||
| - id: ruff-check | ||
| args: ['--fix'] | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.3.0 | ||
| hooks: | ||
| - id: codespell | ||
| additional_dependencies: ['tomli'] | ||
| - repo: https://github.com/shellcheck-py/shellcheck-py | ||
| rev: v0.10.0.1 | ||
| hooks: | ||
| - id: shellcheck |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this 3.13? 3.11 would be the edge case with much older Pi's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just say I am not optimistic about people keeping Raspberry Pi OS up to date 😆 (though perhaps that's partly my fault...)
Though I am very tempted to drop older versions for new shinies.
Thanks for looking over this, by the way, I'm super rusty on the Python front so I'm mostly fixing the things that specifically annoy me or catch me out any time I come back to this stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an interest in this working. The Inventor HAT Mini serves as the main breakout for my Third Edition Learn Robotics Programming book, so I'm hoping that it works well for new Pi owners for a good few years. The target being that
pip install inventor-hat-miniworks for most cases.This arrived by the route from the inventor-hat-mini to the io-expander to this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your input would be helpful if you want to make sure it stays working for your cases. Certainly a much more focussed and testable use case than all-of-the-possible-permutations-of-installs.
The inventor hat mini repackage PR is here: pimoroni/inventorhatmini-python#17 and basically ready to go, testing notwithstanding.