Skip to content
Merged
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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to pygraphics

pygraphics is two implementations of one API: C under `src/` and pure Python
under `lib/pygraphics/`. A change to one needs the same change in the other,
under [`lib/pygraphics/`](lib/pygraphics/). A change to one needs the same change in the other,
and the tests run against both. A focused test, or a docs example that shows
an existing call, is a good first contribution.

Expand All @@ -15,7 +15,7 @@ an existing call, is a good first contribution.
| `setup.py`, `pyproject.toml` | the CPython wheel |
| `tests/` | one suite for both implementations; [tests/README.md](tests/README.md) explains the switch |
| `tools/` | comparison tools and `benchmark.py` |
| `scripts/sync_fonts.py` | writes the C font headers from the Python font files |
| [`scripts/sync_fonts.py`](scripts/sync_fonts.py) | writes the C font headers from the Python font files |
| `docs/` | the documentation site |

## Run the tests
Expand All @@ -37,7 +37,7 @@ PYGRAPHICS_TEST_NATIVE=1 .venv/bin/python -m unittest discover -s tests
These are the two runs CI makes on every change. `PYTHONPATH=lib` alone does
not select the pure package once you've built in place, because the
repository root comes before `PYTHONPATH` on `sys.path` and the compiled
module there wins. `tests/_env.py` handles that for the suite; from a shell,
module there wins. [`tests/_env.py`](tests/_env.py) handles that for the suite; from a shell,
run from another directory.

## Compare the two implementations
Expand Down Expand Up @@ -140,7 +140,7 @@ python3 -m venv .venv-docs

The API reference under `docs/reference/` is generated during the build and
isn't tracked. Sphinx reads Python docstrings, so it can't see the C module;
`tools/sourcey-api/` generates a reference for the C bindings on demand, and
[`tools/sourcey-api/`](tools/sourcey-api/) generates a reference for the C bindings on demand, and
its README says how.

## Releases
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mip.install("pygraphics", index="https://PyDevices.github.io/mip")

## On a CircuitPython-compatible board

Copy the `lib/pygraphics/` folder from this repository to the board's
Copy the [`lib/pygraphics/`](https://github.com/PyDevices/pygraphics/tree/main/lib/pygraphics) folder from this repository to the board's
`CIRCUITPY/lib/` folder.

## In the browser (Pyodide)
Expand Down
2 changes: 1 addition & 1 deletion docs/how-it-works/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The pure package fills `RGB565` rectangles with numpy when it can import it

## Run it yourself

`tools/benchmark.py` is the script behind the table. It prints which package
[`tools/benchmark.py`](../../tools/benchmark.py) is the script behind the table. It prints which package
it imported, then one line per call.

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/how-it-works/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The compiled package is C. It's what the `pydevices-pygraphics` wheels
contain, and it can be built into MicroPython or CircuitPython firmware.
`pygraphics.implementation()` returns `native_cmod`.

The pure-Python package is the `lib/pygraphics/` folder, the one mip
The pure-Python package is the [`lib/pygraphics/`](https://github.com/PyDevices/pygraphics/tree/main/lib/pygraphics) folder, the one mip
installs. It runs on any Python with no compiler, and returns
`pygraphics_python`. It carries `pygraphics.framebuf`, a Python copy of
MicroPython's `framebuf`, so it runs the same on CPython and CircuitPython,
Expand All @@ -43,7 +43,7 @@ that only the pure package has are listed under

A `pygraphics.FrameBuffer` takes the same arguments as `framebuf.FrameBuffer`,
uses the same format numbers, and draws the same pixels for the same calls.
A tool in the repository, `tools/compare_framebuf_mp.py`, checks this against
A tool in the repository, [`tools/compare_framebuf_mp.py`](../../tools/compare_framebuf_mp.py), checks this against
MicroPython's own `framebuf`. Two things differ on purpose: drawing methods
return an `Area` instead of `None`, and [text](../guides/draw-text.md#framebufs-text-looks-different)
uses the romfont faces.
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ print("Drawn with", pygraphics.implementation())
[Install it](get-started/install.md), then draw
[your first picture](get-started/first-program.md). The
[guides](guides/draw-shapes.md) take one task each, the
[reference](reference/index) lists every name, and
[reference](https://pygraphics.readthedocs.io/en/latest/reference/index.html)
lists every name, and
[How it works](how-it-works/index.md) explains the design.

```{toctree}
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Pyodide, CPython 3.13 and 3.14 | compiled wheel (`pyemscripten_2025_0` and `pyemscripten_2026_0`) | the wheel builds; micropip picks the one for your Pyodide |
| MicroPython, any port | pure-Python, from mip | the compiled module's tests and the comparison against `framebuf` run on the unix port on every change |
| CircuitPython | pure-Python, copied to `CIRCUITPY/lib/` | not tested automatically |
| macOS, Linux on ARM | pure-Python | no compiled wheel: copy `lib/pygraphics/` onto your path |
| macOS, Linux on ARM | pure-Python | no compiled wheel: copy [`lib/pygraphics/`](https://github.com/PyDevices/pygraphics/tree/main/lib/pygraphics) onto your path |

The compiled module can also be built into MicroPython or CircuitPython
firmware; [CONTRIBUTING.md](https://github.com/PyDevices/pygraphics/blob/main/CONTRIBUTING.md#build-it-into-micropython)
Expand Down
Loading