-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate to uv, python-semantic-release, pre-commit (#42)
- Loading branch information
Showing
27 changed files
with
2,621 additions
and
1,452 deletions.
There are no files selected for viewing
This file contains 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,117 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- uses: pre-commit/[email protected] | ||
|
||
# Make sure commit messages follow the conventional commits convention: | ||
# https://www.conventionalcommits.org | ||
commitlint: | ||
name: Lint Commit Messages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/[email protected] | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
os: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
id: setup-python | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: astral-sh/setup-uv@v5 | ||
- run: uv sync --no-python-downloads | ||
shell: bash | ||
- run: uv run pytest | ||
shell: bash | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
release: | ||
needs: | ||
- test | ||
- lint | ||
- commitlint | ||
|
||
runs-on: ubuntu-latest | ||
environment: release | ||
concurrency: release | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.sha }} | ||
|
||
- name: Checkout commit for release | ||
run: | | ||
git checkout -B ${{ github.ref_name }} ${{ github.sha }} | ||
# Do a dry run of PSR | ||
- name: Test release | ||
uses: python-semantic-release/[email protected] | ||
if: github.ref_name != 'main' | ||
with: | ||
root_options: --noop | ||
github_token: noop | ||
|
||
# On main branch: actual PSR + upload to PyPI & GitHub | ||
- name: Release | ||
uses: python-semantic-release/[email protected] | ||
id: release | ||
if: github.ref_name == 'main' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Attest build provenance | ||
uses: actions/attest-build-provenance@v1 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
subject-path: "dist/*" | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
uses: python-semantic-release/[email protected] | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.release.outputs.tag }} |
This file contains 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,62 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
exclude: "CHANGELOG.md|.copier-answers.yml|.all-contributorsrc|project" | ||
default_stages: [pre-commit] | ||
|
||
ci: | ||
autofix_commit_msg: "chore(pre-commit.ci): auto fixes" | ||
autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate" | ||
|
||
repos: | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v4.1.0 | ||
hooks: | ||
- id: commitizen | ||
stages: [commit-msg] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: debug-statements | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: "v2.5.0" | ||
hooks: | ||
- id: pyproject-fmt | ||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
rev: 0.5.18 | ||
hooks: | ||
- id: uv-lock | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.19.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py39-plus] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
args: ["--tab-width", "2"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.9.1 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v1.14.1 | ||
# hooks: | ||
# - id: mypy | ||
# additional_dependencies: [] |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"python.pythonPath": "venv3.7/bin/python" | ||
} | ||
"python.pythonPath": "venv3.7/bin/python" | ||
} |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
Erik Hendrix | ||
Erik Hendrix |
This file contains 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 |
---|---|---|
|
@@ -7,17 +7,14 @@ with the Harmony HUB device. | |
|
||
The Logitech Harmony HUB connects to your home wireless network and obtains an | ||
IP address. It runs a [Web server](https://en.wikipedia.org/wiki/Web_server) server that listens on port 8088. | ||
|
||
|
||
## Authentication | ||
|
||
### Obtaining Remote ID | ||
|
||
Each Harmony HUB has a unique hub ID that has to be provided for every request. This ID can be obtained | ||
Each Harmony HUB has a unique hub ID that has to be provided for every request. This ID can be obtained | ||
through the discovery process for Harmony HUBs or by querying a specific HUB itself for it. | ||
|
||
|
||
|
||
A session token is obtained by logging into the Harmony device with username `[email protected]` and password | ||
`guest`. The login process uses the XMPP SASL PLAIN authentication standard | ||
(XEP-0034). | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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,8 @@ | ||
export default { | ||
extends: ["@commitlint/config-conventional"], | ||
rules: { | ||
"header-max-length": [0, "always", Infinity], | ||
"body-max-line-length": [0, "always", Infinity], | ||
"footer-max-line-length": [0, "always", Infinity], | ||
}, | ||
}; |
Oops, something went wrong.