Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<!--
You are amazing! Thanks for contributing to our project!
Please fill the template to help maintainers processing your PR.
Thanks for contributing. Please fill in the sections below; it helps the
maintainer process your change.

Don't forget to create the PR against the correct branch:
- new product id -> new_product_ids
- anything else -> dev
Open the pull request against the master branch.
-->
## Context
<!--
Expand All @@ -21,8 +19,7 @@

## Type of change
<!--
What type of change does your PR introduce?
Please, check only 1 box!
Check one.
-->

- [ ] Dependency upgrade
Expand All @@ -41,15 +38,10 @@

- This PR fixes issue: fixes #
- This PR is related to:
- Link to documentation pull request:

## Checklist
<!--
Please do your best to check these boxes.
-->

- [ ] The code change is tested and works locally.
- [ ] The code has been formatted using Black.
- [ ] The code follows the [Zen of Python](https://www.python.org/dev/peps/pep-0020/).
- [ ] I am creating the Pull Request against the correct branch.
- [ ] Documentation added/updated.
- [ ] The code change is tested and works locally (`pytest`).
- [ ] `ruff check .` passes.
- [ ] New device support was verified on real hardware, or the PR says it was not.
- [ ] `CHANGELOG.md` has an entry under Unreleased.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint
run: ruff check .
- name: Format check
run: ruff format --check .
- name: Test
run: pytest

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Check the wheel imports
run: |
python -m venv /tmp/check
/tmp/check/bin/pip install dist/*.whl
/tmp/check/bin/python -c "import broadlink; print(broadlink.__name__)"
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
33 changes: 0 additions & 33 deletions .github/workflows/flake8.yaml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to PyPI

# Runs on a version tag (v1.0.0, v1.0.1, ...). Uses PyPI trusted publishing:
# the project on PyPI is configured to trust this repository, this workflow
# file name, and the "pypi" environment. No API token is stored anywhere.

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Check the tag matches the package version
run: |
TAG="${GITHUB_REF_NAME#v}"
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
echo "tag=$TAG version=$VERSION"
test "$TAG" = "$VERSION"
- name: Build
run: |
python -m pip install --upgrade pip build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
*.pyc
__pycache__/
*.egg-info/
build/
dist/
.venv/
.pytest_cache/
.ruff_cache/
.DS_Store

# Working notes that are not part of the published project.
docs/internal/
Loading