Skip to content

Commit 17dbd04

Browse files
Release 0.2.0 (#1)
Release 0.2.0
2 parents 26fdd05 + d442930 commit 17dbd04

149 files changed

Lines changed: 36187 additions & 2222 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Bug report
2+
description: Something behaves differently from what the documentation says.
3+
labels: [bug]
4+
body:
5+
- type: textarea
6+
id: what
7+
attributes:
8+
label: What happened?
9+
description: What you did, what you expected, and what you got instead.
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: repro
14+
attributes:
15+
label: Minimal reproduction
16+
description: The smallest code that shows the problem, including the decorator and how it is called (sync, async, method).
17+
render: python
18+
validations:
19+
required: true
20+
- type: input
21+
id: version
22+
attributes:
23+
label: python-wrap version
24+
description: "Run: python -c 'import python_wrap; print(python_wrap.__version__)'"
25+
validations:
26+
required: true
27+
- type: input
28+
id: python
29+
attributes:
30+
label: Python version and operating system
31+
placeholder: "3.13.1 on Windows 11"
32+
validations:
33+
required: true
34+
- type: textarea
35+
id: traceback
36+
attributes:
37+
label: Traceback or log output
38+
render: text

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security vulnerability
4+
url: https://github.com/LitePy/PythonWrap/security/advisories/new
5+
about: Please report security issues privately, not in a public issue.
6+
- name: Documentation
7+
url: https://python-wrap.readthedocs.io
8+
about: Check the docs first; most questions are answered there.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Feature request
2+
description: Suggest a new decorator or an option on an existing one.
3+
labels: [enhancement]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: What problem are you trying to solve?
9+
description: The situation first, not the solution.
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: What would you like to write?
16+
description: A sketch of the API as you would want to call it.
17+
render: python
18+
- type: textarea
19+
id: alternatives
20+
attributes:
21+
label: Alternatives considered
22+
description: Other libraries or hand-written code you tried, and why they fall short.
23+
- type: markdown
24+
attributes:
25+
value: |
26+
python-wrap has no runtime dependencies and supports sync and async code,
27+
so proposals are weighed against both.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## What and why
2+
3+
<!-- What does this change, and what motivated it? Link the issue if there is one. -->
4+
5+
## Checklist
6+
7+
- [ ] Tests added or updated (sync and async paths; use `fake_clock` rather than real sleeps)
8+
- [ ] `uv run pytest` passes
9+
- [ ] `uv run ruff check src tests` and `uv run ruff format --check src tests` pass
10+
- [ ] `uv run mypy` passes
11+
- [ ] Public functions have Google-style docstrings
12+
- [ ] `CHANGELOG.md` updated under `Unreleased`

‎.github/dependabot.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Keeps the pinned GitHub Actions and the lockfile moving, in as few pull requests as
2+
# possible. Grouped, weekly: they are reviewed together and it keeps the queue readable.
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: weekly
10+
groups:
11+
actions:
12+
patterns: ["*"]
13+
commit-message:
14+
prefix: "ci"
15+
16+
# Refreshes uv.lock, which pins the dev and docs tooling (the package itself has no
17+
# runtime dependencies).
18+
- package-ecosystem: uv
19+
directory: /
20+
schedule:
21+
interval: weekly
22+
groups:
23+
dev-tooling:
24+
patterns: ["*"]
25+
commit-message:
26+
prefix: "deps"

‎.github/workflows/ci.yml‎

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Continuous integration.
2+
#
3+
# Four jobs: lint (seconds), the test matrix, mypy, and a packaging check.
4+
#
5+
# python-wrap is pure Python with no dependencies, so the matrix is wide rather than
6+
# deep: every interpreter the classifiers name, on all three operating systems. Time and
7+
# threading behave differently on Windows (coarser clocks) and macOS (spawn, not fork),
8+
# and a decorator library that schedules, throttles and times things is exactly where
9+
# that shows up.
10+
name: CI
11+
12+
on:
13+
push:
14+
branches: [main]
15+
pull_request:
16+
workflow_dispatch:
17+
18+
# A force-push should not leave the previous run burning minutes on a dead commit.
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
env:
27+
FORCE_COLOR: "1"
28+
29+
jobs:
30+
lint:
31+
name: ruff
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v7
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v10.3.2
38+
with:
39+
enable-cache: true
40+
cache-dependency-glob: "uv.lock"
41+
python-version: "3.13"
42+
43+
- run: uv sync --group dev --frozen
44+
45+
- name: ruff check
46+
run: uv run --no-sync ruff check src tests
47+
48+
- name: ruff format
49+
run: uv run --no-sync ruff format --check --diff src tests
50+
51+
test:
52+
name: py${{ matrix.python-version }} · ${{ matrix.os }}
53+
runs-on: ${{ matrix.os }}
54+
strategy:
55+
# One red cell should not hide the other fourteen.
56+
fail-fast: false
57+
matrix:
58+
os: [ubuntu-latest, macos-latest, windows-latest]
59+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
60+
61+
steps:
62+
- uses: actions/checkout@v7
63+
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v10.3.2
66+
with:
67+
enable-cache: true
68+
cache-dependency-glob: "uv.lock"
69+
python-version: ${{ matrix.python-version }}
70+
71+
- run: uv sync --group dev --frozen
72+
73+
- name: pytest
74+
run: uv run --no-sync pytest --cov --cov-report=term-missing --cov-report=xml
75+
76+
# One coverage report is enough; it is the same code on every cell. Keeping it as an
77+
# artifact (rather than a third-party upload) needs no token and cannot fail the
78+
# build for a reason unrelated to the code.
79+
- name: Upload the coverage report
80+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
81+
uses: actions/upload-artifact@v7
82+
with:
83+
name: coverage
84+
path: coverage.xml
85+
if-no-files-found: warn
86+
87+
typecheck:
88+
name: mypy
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v7
92+
93+
- name: Install uv
94+
uses: astral-sh/setup-uv@v10.3.2
95+
with:
96+
enable-cache: true
97+
cache-dependency-glob: "uv.lock"
98+
python-version: "3.13"
99+
100+
- run: uv sync --group dev --frozen
101+
102+
# Strict mode, configured in pyproject.toml; `files` already points at src/.
103+
- name: mypy
104+
run: uv run --no-sync mypy
105+
106+
build:
107+
name: build & wheel contents
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v7
111+
112+
- name: Install uv
113+
uses: astral-sh/setup-uv@v10.3.2
114+
with:
115+
enable-cache: true
116+
cache-dependency-glob: "uv.lock"
117+
python-version: "3.13"
118+
119+
- name: Build the sdist and wheel
120+
run: uv build
121+
122+
- name: twine check
123+
run: uvx twine check --strict dist/*
124+
125+
# The package ships `py.typed` so that type checkers use its annotations. A wheel
126+
# that drops it still imports and still passes twine, and silently turns every
127+
# downstream user's types into `Any`.
128+
- name: The wheel ships py.typed
129+
run: |
130+
python3 -m zipfile -l dist/*.whl | tee wheel-listing.txt
131+
grep -q 'python_wrap/py.typed' wheel-listing.txt
132+
133+
# Install the built wheel, not the source tree, into an empty venv and run from a
134+
# scratch directory so `src/` cannot stand in for anything the wheel left out.
135+
- name: Install the wheel into a clean environment
136+
run: |
137+
uv venv "$RUNNER_TEMP/smoke" --python 3.13
138+
uv pip install --python "$RUNNER_TEMP/smoke" dist/*.whl
139+
cd "$RUNNER_TEMP"
140+
"$RUNNER_TEMP/smoke/bin/python" -c "import python_wrap; print(python_wrap.__version__)"
141+
142+
- name: Upload the distributions
143+
uses: actions/upload-artifact@v7
144+
with:
145+
name: dist
146+
path: dist/
147+
if-no-files-found: error

‎.github/workflows/docs.yml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Build check for the documentation site.
2+
#
3+
# Read the Docs does the hosting (see .readthedocs.yaml). This workflow only catches
4+
# breakage before it gets there: `--strict` turns a broken link, a page missing from the
5+
# nav or a docstring mkdocstrings cannot render into a failed check on the pull request.
6+
name: Docs
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
21+
env:
22+
FORCE_COLOR: "1"
23+
24+
jobs:
25+
build:
26+
name: mkdocs build --strict
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v7
30+
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v10.3.2
33+
with:
34+
enable-cache: true
35+
cache-dependency-glob: "uv.lock"
36+
python-version: "3.13"
37+
38+
# The package itself is installed too, because mkdocstrings reads the docstrings
39+
# from it. The dev group is included because some examples are pytest tests.
40+
- run: uv sync --frozen --no-default-groups --group docs --group dev
41+
42+
- name: Build the site
43+
run: uv run --no-sync mkdocs build --strict
44+
env:
45+
NO_MKDOCS_2_WARNING: "1"
46+
47+
# Every ```python block in docs/ is executed, so an example that drifts from the
48+
# real API fails review instead of misleading a reader.
49+
- name: Run the documentation examples
50+
run: uv run --no-sync python scripts/check_docs_examples.py

‎.github/workflows/publish.yml‎

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)