Skip to content

Commit eaa17d7

Browse files
authored
Observable search, most of PDDL 3, and a browser research workbench (#151)
Observable search, most of PDDL 3, and a browser research workbench
2 parents 489b552 + e645ac3 commit eaa17d7

102 files changed

Lines changed: 15320 additions & 454 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.

.github/workflows/build.yml

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
name: build
22

3+
# What gets published, rather than what is in the working tree. `tests.yml`
4+
# already lints and tests the sources across the whole matrix; running the same
5+
# flake8 twice bought no extra signal, so this workflow builds the
6+
# distributions instead and proves the wheel stands on its own — no source
7+
# tree, no demos folder, no editable install.
8+
39
on: [push]
410

11+
concurrency:
12+
group: build-${{ github.ref }}
13+
cancel-in-progress: true
14+
515
jobs:
616
build:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
fail-fast: false
10-
matrix:
11-
os: [ubuntu-latest]
12-
python-version: ['3.9', '3.10', '3.11', '3.12']
13-
17+
runs-on: ubuntu-latest
1418
steps:
15-
- uses: actions/checkout@v7
16-
with:
17-
submodules: recursive
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v7
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Install package (dev extras)
23-
run: |
24-
python -m pip install --upgrade pip
25-
python -m pip install -e ".[dev]"
26-
- name: Lint with flake8
27-
run: |
28-
flake8 jupyddl tests --count --select=E9,F63,F7,F82 --show-source --statistics
29-
flake8 jupyddl tests --count --statistics
19+
- uses: actions/checkout@v7
20+
with:
21+
submodules: false
22+
23+
- uses: actions/setup-python@v7
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Build the sdist and the wheel
28+
run: |
29+
python -m pip install --upgrade pip build twine
30+
python -m build
31+
twine check dist/*
32+
33+
- name: Install the wheel into a clean environment
34+
run: |
35+
python -m venv /tmp/fresh
36+
/tmp/fresh/bin/pip install dist/*.whl
37+
38+
- name: Plan with the installed package, away from the repository
39+
working-directory: /tmp
40+
run: |
41+
/tmp/fresh/bin/python -c "import jupyddl; print(jupyddl.__version__)"
42+
/tmp/fresh/bin/jupyddl generate gripper -n 3 --seed 1 -o /tmp/smoke
43+
/tmp/fresh/bin/jupyddl solve \
44+
/tmp/smoke/gripper-03-1/domain.pddl \
45+
/tmp/smoke/gripper-03-1/problem.pddl \
46+
-s astar -H lmcut | tee /tmp/plan.txt
47+
grep -q "Valid: True" /tmp/plan.txt
48+
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: distributions
52+
path: dist/

.github/workflows/format.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
11
name: format
2+
23
on:
34
push:
45
branches: [main]
6+
7+
concurrency:
8+
group: format-main
9+
cancel-in-progress: false
10+
511
jobs:
612
format:
713
runs-on: ubuntu-latest
814
steps:
15+
# `github.head_ref` is empty on a push event, so the old `ref:` here was
16+
# a no-op that read as if it did something. This workflow only ever runs
17+
# on main; check that out and say so.
918
- uses: actions/checkout@v7
1019
with:
11-
ref: ${{ github.head_ref }}
20+
ref: main
21+
1222
- name: Set up Python
1323
uses: actions/setup-python@v7
1424
with:
1525
python-version: '3.14'
26+
1627
- name: Install formatter dependencies
1728
run: |
1829
python -m pip install --upgrade pip
1930
python -m pip install black
31+
2032
- name: Format with black
2133
run: |
22-
black jupyddl tests
34+
black jupyddl tests tools
35+
36+
# web/dist embeds the jupyddl sources verbatim, and pages.yml refuses to
37+
# deploy a bundle that has drifted from them. Reformatting the sources
38+
# and committing without rebuilding would push main into exactly that
39+
# state, so the rebuild has to ride along in the same commit.
40+
- name: Rebuild the browser bundle so it matches the formatted sources
41+
run: python tools/build_web.py
42+
2343
- name: Commit changes
2444
uses: stefanzweifel/git-auto-commit-action@v5
2545
with:

.github/workflows/pages.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: pages
2+
3+
# Publish the browser playground to GitHub Pages. The page runs the real
4+
# library under Pyodide, so "deploying" is just bundling the package sources
5+
# and the demo instances alongside the static assets.
6+
7+
on:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: true
20+
21+
jobs:
22+
# Not called `build`: .mergify.yml keys a merge rule on a check named
23+
# `build`, and that must mean the packaging workflow, not this one.
24+
bundle:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v7
28+
with:
29+
submodules: false
30+
31+
- uses: actions/setup-python@v7
32+
with:
33+
python-version: "3.12"
34+
35+
- name: Bundle jupyddl and the demos for the browser
36+
run: python tools/build_web.py
37+
38+
- name: Fail if the committed bundle is stale
39+
run: |
40+
if ! git diff --quiet -- web/dist; then
41+
echo "web/dist is out of date. Run 'python tools/build_web.py' and commit the result." >&2
42+
git diff --stat -- web/dist >&2
43+
exit 1
44+
fi
45+
46+
- uses: actions/configure-pages@v5
47+
48+
- uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: web
51+
52+
deploy:
53+
needs: bundle
54+
runs-on: ubuntu-latest
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
steps:
59+
- id: deployment
60+
uses: actions/deploy-pages@v4

.github/workflows/tests.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,32 @@ name: tests
22

33
on: [push]
44

5+
concurrency:
6+
group: tests-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
test:
711
runs-on: ${{ matrix.os }}
812
strategy:
913
fail-fast: false
1014
matrix:
1115
os: [ubuntu-latest]
12-
python-version: ['3.9', '3.10', '3.11', '3.12']
16+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
17+
# The charts are an optional extra, so most of the matrix runs without
18+
# matplotlib — that is the configuration nearly every user installs,
19+
# and it proves the core stays importable without it. One entry pulls
20+
# it in so `jupyddl/viz/` is actually executed rather than skipped.
21+
extras: [dev]
22+
include:
23+
- os: ubuntu-latest
24+
python-version: '3.12'
25+
extras: dev,viz
26+
27+
name: test (${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.extras }})
28+
29+
env:
30+
MPLBACKEND: Agg
1331

1432
steps:
1533
- uses: actions/checkout@v7
@@ -19,14 +37,14 @@ jobs:
1937
uses: actions/setup-python@v7
2038
with:
2139
python-version: ${{ matrix.python-version }}
22-
- name: Install package (dev extras)
40+
- name: Install package (${{ matrix.extras }} extras)
2341
run: |
2442
python -m pip install --upgrade pip
25-
python -m pip install -e ".[dev]"
43+
python -m pip install -e ".[${{ matrix.extras }}]"
2644
- name: Lint with flake8
2745
run: |
28-
flake8 jupyddl tests --count --select=E9,F63,F7,F82 --show-source --statistics
29-
flake8 jupyddl tests --count --statistics
46+
flake8 jupyddl tests tools --count --select=E9,F63,F7,F82 --show-source --statistics
47+
flake8 jupyddl tests tools --count --statistics
3048
- name: Test with pytest
3149
run: |
3250
pytest --cov=jupyddl --cov-report=xml

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,18 @@ data/*
138138
scripts/*
139139
*.txt
140140
!scripts/ipc.py
141+
142+
# Playground: the Pyodide runtime is vendored locally for offline development
143+
# and browser testing only -- the deployed page loads it from the CDN.
144+
web/vendor/
145+
146+
# web/dist is generated by tools/build_web.py but IS committed, so the page
147+
# works from a plain clone. Re-include it past the build-artefact 'dist/' rule
148+
# above (the directory itself must be un-ignored before its contents can be).
149+
!web/dist/
150+
!web/dist/**
151+
152+
# Generated galleries and animations
153+
gallery/
154+
*.mp4
155+
!promo/*.mp4

.mergify.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# `tests` is the *workflow* name; the checks it reports are the matrix jobs,
2+
# `test (ubuntu-latest, 3.12, dev)` and friends. A rule keyed on
3+
# `check-success=tests` therefore matched nothing and the auto-merge never
4+
# fired. Match the jobs by pattern instead, so adding a Python version to the
5+
# matrix does not silently break merging again.
16
pull_request_rules:
27
- name: Assign the main reviewers
38
conditions:
@@ -11,7 +16,7 @@ pull_request_rules:
1116
- name: Automatic merge on approval
1217
conditions:
1318
- "#approved-reviews-by>=1"
14-
- check-success=tests
19+
- check-success~=^test \(
1520
- check-success=build
1621
- check-success=CodeFactor
1722
actions:

0 commit comments

Comments
 (0)