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
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
- 'docs/**'
- 'mkdocs.yml'
- 'scripts/mkdocs_gen_ref_pages.py'
- 'src/**'
- 'lib/**'
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'scripts/mkdocs_gen_ref_pages.py'
- 'src/**'
- 'lib/**'
workflow_dispatch:

jobs:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches: [main]
paths:
- 'src/**'
- 'lib/**'
- 'tests/**'
- 'scripts/**'
pull_request:
paths:
- 'src/**'
- 'lib/**'
- 'tests/**'
- 'scripts/**'
workflow_dispatch:
Expand All @@ -25,8 +25,8 @@ jobs:
- name: Install ruff
run: pip install ruff
- name: Ruff
run: ruff check src tests scripts
run: ruff check lib tests scripts
- name: Unit tests
env:
PYTHONPATH: src
PYTHONPATH: lib
run: python -m unittest discover -s tests
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Color palette toolkit for pydisplay (`import palettes`).

- Python venv at `.venv` — `.venv/bin/python`, `.venv/bin/ruff`
- No runtime dependencies on other pydisplay packages
- Source layout: `src/palettes/` (import name `palettes`)
- Source layout: `lib/palettes/` (import name `palettes`)

## Tests and lint

```bash
.venv/bin/python -m unittest discover -s tests
.venv/bin/ruff check src tests scripts
.venv/bin/ruff check lib tests scripts
```

## Publishing
Expand All @@ -24,9 +24,9 @@ See `PUBLISHING.md`.

The Cloud Agent update script creates the repo-root `.venv` (with `ruff`). Since
`palettes` is a source-only package (not pip-installed), the `unittest discover`
command above needs `src/` on the path — the bare command fails with
`ModuleNotFoundError: No module named 'palettes'`. Mirror CI (`env: PYTHONPATH: src`):
command above needs `lib/` on the path — the bare command fails with
`ModuleNotFoundError: No module named 'palettes'`. Mirror CI (`env: PYTHONPATH: lib`):

```bash
PYTHONPATH=src .venv/bin/python -m unittest discover -s tests
PYTHONPATH=lib .venv/bin/python -m unittest discover -s tests
```
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import mip
mip.install("palettes", index="https://PyDevices.github.io/micropython-lib/mip/PyDevices")
```

Development clone — put `src/` on `PYTHONPATH` or copy `src/palettes/` to your device.
Development clone — put `lib/` on `PYTHONPATH` or copy `lib/palettes/` to your device.

## Basic usage

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions scripts/publish_micropython_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ usage() {
cat <<'EOF'
Usage: ./scripts/publish_micropython_lib.sh [OPTION]

Copy palettes src/ into micropython-lib, optionally upload TestPyPI wheels,
Copy palettes lib/ into micropython-lib, optionally upload TestPyPI wheels,
then commit (and optionally push) on the PyDevices branch.

Options:
Expand Down Expand Up @@ -91,7 +91,7 @@ PYPI_NAME=palettes
DEST_REPO="${MICROPYTHON_LIB_DIR:-$SOURCE_REPO/../micropython-lib}"
DEST_REPO="$(cd "$DEST_REPO" 2>/dev/null && pwd || echo "$DEST_REPO")"
export MICROPYTHON_LIB_DIR="$DEST_REPO"
SOURCE_DIR=$SOURCE_REPO/src/palettes
SOURCE_DIR=$SOURCE_REPO/lib/palettes
DEST_DIR=$DEST_REPO/micropython/$BASENAME
PYPI_DIR=$SOURCE_REPO/wheels
README_FULL_PATH=$SOURCE_REPO/README.md
Expand Down Expand Up @@ -147,7 +147,7 @@ push_micropython_lib() {
echo
echo "Processing $BASENAME"
mkdir -p "$DEST_DIR/$BASENAME"
# --delete drops removed modules so the sync matches src/
# --delete drops removed modules so the sync matches lib/
rsync -a --delete "${RSYNC_EXCLUDES[@]}" "$SOURCE_DIR/" "$DEST_DIR/$BASENAME/"

cat <<EOF > "$DEST_DIR/manifest.py"
Expand Down
Loading