FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge branch 'master' into workflow-ci-riscv64 · python-zeroconf/python-zeroconf@b3feba3 · GitHub

Repository navigation

Commit b3feba3

Browse files
authored
Merge branch 'master' into workflow-ci-riscv64
2 parents 8e703fa + bc8ec8d commit b3feba3

13 files changed

Lines changed: 557 additions & 50 deletions

File tree

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
name: pr-workflow
3+
description: Create pull requests for python-zeroconf/python-zeroconf. Use when creating PRs, submitting changes, or preparing contributions.
4+
allowed-tools: Read, Bash, Glob, Grep
5+
---
6+
7+
# python-zeroconf PR Workflow
8+
9+
When creating a pull request for `python-zeroconf/python-zeroconf`,
10+
follow these steps. Repo-wide conventions live in
11+
[CLAUDE.md](../../../CLAUDE.md); this skill summarises the parts
12+
that matter at PR-creation time.
13+
14+
## 1. Create branch from origin/master
15+
16+
The default branch is `master`, not `main`. `origin` already
17+
points at `python-zeroconf/python-zeroconf` — there is no fork in
18+
this workflow. Always re-fetch first so the branch is based on
19+
the latest `master`:
20+
21+
```bash
22+
git fetch origin
23+
git checkout -b <branch-name> origin/master
24+
```
25+
26+
If you accidentally branch from `main`, `gh pr create` will fail
27+
because the base branch does not exist.
28+
29+
## 2. There is no PR template
30+
31+
`python-zeroconf` does not ship a `.github/PULL_REQUEST_TEMPLATE.md`
32+
— PR bodies are free-form. Aim for a body that looks roughly like:
33+
34+
```
35+
## Summary
36+
<1–3 sentence prose description of what changed and why>
37+
38+
## Details
39+
<bullets explaining the non-obvious parts: RFC sections cited,
40+
performance characteristics measured, edge cases handled>
41+
42+
## Test plan
43+
- [ ] <how you verified the change>
44+
- [ ] <new tests added under tests/ — point at the file>
45+
```
46+
47+
Cite the relevant RFC section (RFC 6762 / RFC 6763) for any
48+
behaviour change that affects packet contents or timing —
49+
reviewers shouldn't have to reverse-engineer why a constant moved
50+
or a probe interval changed.
51+
52+
## 3. Commit message conventions
53+
54+
Commit messages are linted by `commitlint` with
55+
`@commitlint/config-conventional`, _and_ by `commitizen` in
56+
pre-commit (`stages: [commit-msg]`). Both must pass.
57+
58+
- **Conventional Commits prefix is required.** Pick from:
59+
`feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`,
60+
`ci`, `chore`, `style`, `revert`. The `feat`/`fix`/`perf`
61+
prefixes show up in the release-notes; `chore*` and `ci*` are
62+
excluded by semantic-release (`exclude_commit_patterns` in
63+
`pyproject.toml`), so use those for housekeeping.
64+
- **Imperative-mood subject.** "fix: handle empty answer", not
65+
"fix: handled empty answer".
66+
- **No header length cap.** The commitlint config sets
67+
`header-max-length: [0, "always", Infinity]`, so a slightly
68+
longer subject is fine if it earns the space; don't pad.
69+
- **No `Co-Authored-By` trailers from automated agents.**
70+
- **One logical change per commit.** Let pre-commit run (ruff
71+
lint + format, mypy, flake8, codespell, cython-lint,
72+
pyupgrade). If a hook auto-fixes something, re-stage and
73+
re-commit; the commit-msg hook re-runs on the new commit.
74+
75+
## 4. Cython / `.pxd` discipline
76+
77+
If the PR touches any module listed in `TO_CYTHONIZE`
78+
(`build_ext.py`):
79+
80+
- Update the sibling `.pxd` in the same commit if you changed a
81+
`cdef class` layout or a `cpdef`/`cdef` signature.
82+
- Do not hand-edit the in-tree `.c` files; the build regenerates
83+
them, and they're excluded from sdist (`exclude = ["**/*.c"]`
84+
in `pyproject.toml`).
85+
- Verify the extension still builds locally:
86+
`REQUIRE_CYTHON=1 poetry install` (re-installs in-place,
87+
failing loudly if Cython rejects anything).
88+
- Verify it still works without the extension:
89+
`SKIP_CYTHON=1 poetry install && poetry run pytest tests/`.
90+
91+
## 5. Push and create the PR
92+
93+
```bash
94+
git push -u origin <branch-name>
95+
gh pr create --repo python-zeroconf/python-zeroconf --base master \
96+
--title "<conventional-commit subject>" \
97+
--body-file /tmp/pr-body.md
98+
```
99+
100+
Always pass the body via `--body-file`, never `--body "..."` with
101+
shell-escaping — Markdown backticks, asterisks, and angle
102+
brackets must pass through verbatim.
103+
104+
The PR title should match the commit subject (same Conventional
105+
Commits prefix). If the PR ends up squash-merged, the title
106+
becomes the merged commit message, so it has to satisfy
107+
commitlint on its own.
108+
109+
## 6. After the PR is open
110+
111+
CI runs three jobs:
112+
113+
- `lint` — `pre-commit/action`. If pre-commit passed locally
114+
this passes too.
115+
- `commitlint` — `wagoid/commitlint-github-action`. Validates
116+
every commit on the PR; if you amended after pushing, force-
117+
push the branch so the rewritten commits get linted.
118+
- `test` — the full pytest matrix across CPython 3.9–3.14,
119+
3.14t (free-threaded), and PyPy 3.9 / 3.10, on Linux + macOS +
120+
Windows. The free-threaded entry is the canary for unguarded
121+
shared-state bugs; failures there are often genuine even when
122+
the GIL-enabled rows pass.
123+
124+
CodSpeed also runs on PRs (`CodSpeedHQ/action`) and posts a
125+
benchmark delta as a check. A regression there is signal — if
126+
the PR is a perf change, the comment is the evidence; if not, a
127+
red CodSpeed check usually means the hot path picked up an extra
128+
Python-level branch and wants a second look.

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ jobs:
6969
runs-on: ${{ matrix.os }}
7070
steps:
7171
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
72+
- name: Set up uv
73+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
74+
with:
75+
enable-cache: true
7276
- name: Install poetry
73-
run: pipx install poetry
77+
run: uv tool install poetry
7478
- name: Set up Python
7579
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v5
7680
with:
@@ -102,13 +106,18 @@ jobs:
102106
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v5
103107
with:
104108
python-version: 3.13
105-
- uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
109+
- name: Set up uv
110+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
111+
with:
112+
enable-cache: true
113+
- name: Install poetry
114+
run: uv tool install poetry
106115
- name: Install Dependencies
107116
run: |
108117
REQUIRE_CYTHON=1 poetry install --only=main,dev
109118
shell: bash
110119
- name: Run benchmarks
111-
uses: CodSpeedHQ/action@d872884a306dd4853acf0f584f4b706cf0cc72a2 # v3
120+
uses: CodSpeedHQ/action@3194d9a39c4d46684cb44bf7207fc56626aad8fd # v3
112121
with:
113122
token: ${{ secrets.CODSPEED_TOKEN }}
114123
run: poetry run pytest --no-cov -vvvvv --codspeed tests/benchmarks
@@ -135,7 +144,10 @@ jobs:
135144
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
136145
with:
137146
fetch-depth: 0
138-
ref: ${{ github.head_ref || github.ref_name }}
147+
ref: ${{ github.ref }}
148+
149+
- name: Create local branch name
150+
run: git switch -C ${{ github.head_ref || github.ref_name }}
139151

140152
# Do a dry run of PSR
141153
- name: Test release
@@ -153,7 +165,7 @@ jobs:
153165
github_token: ${{ secrets.GITHUB_TOKEN }}
154166

155167
- name: Publish package distributions to PyPI
156-
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
168+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
157169
if: steps.release.outputs.released == 'true'
158170

159171
- name: Publish package distributions to GitHub Releases
@@ -301,14 +313,14 @@ jobs:
301313
fetch-depth: 0
302314

303315
- name: Build wheels ${{ matrix.musl }} (${{ matrix.qemu }})
304-
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
316+
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
305317
# to supply options, put them in 'env', like:
306318
env:
307319
CIBW_SKIP: cp36-* cp37-* pp36-* pp37-* pp38-* cp38-* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
308320
CIBW_BEFORE_ALL_LINUX: apt install -y gcc || yum install -y gcc || apk add gcc
309321
REQUIRE_CYTHON: 1
310322

311-
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v4
323+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
312324
with:
313325
path: ./wheelhouse/*.whl
314326
name: wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.qemu }}-${{ matrix.pyver }}
@@ -330,4 +342,4 @@ jobs:
330342
merge-multiple: true
331343

332344
- uses:
333-
pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
345+
pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

‎.pre-commit-config.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/commitizen-tools/commitizen
12-
rev: v4.13.10
12+
rev: v4.15.1
1313
hooks:
1414
- id: commitizen
1515
stages: [commit-msg]
@@ -54,7 +54,7 @@ repos:
5454
hooks:
5555
- id: flake8
5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: v1.20.2
57+
rev: v2.0.0
5858
hooks:
5959
- id: mypy
6060
additional_dependencies: [ifaddr]

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL