Repository navigation
Commit 3c06704
committed
build: allow a pure-Python wheel, and drop pkg_resources
Two changes that together let `vpython` be installed and imported under
Pyodide/wasm. Both are opt-in or invisible to existing users: an ordinary
`python -m build` still produces the same platform wheel it always did, and
`install_requires` is untouched.
1. `VPYTHON_PURE_PYTHON=1` builds with no C extension, producing a
`py3-none-any` wheel. micropip (and any other wasm installer) cannot install a
platform wheel, and merely DECLARING `ext_modules` is what makes every wheel a
platform wheel — so the key is now omitted entirely for that build rather than
set to an empty list, which would not have changed the tag. Nothing is lost but
speed: `_vector_import_helper` already falls back to the pure-Python `vector`
when `cyvector` is unavailable.
2. `vpython/__init__.py` uses `importlib.metadata` instead of `pkg_resources`.
pkg_resources is deprecated upstream and simply absent in Pyodide, so importing
vpython there failed on the package's very first line. `python_requires` moves
to >=3.8 accordingly (importlib.metadata is 3.8+; `notebook>=7` already
required 3.8+, so this narrows nothing in practice).
Verified in a real Pyodide 3.13.2 Web Worker, installing this branch's own pure
wheel with `deps=False` and no setuptools present:
OK vpython.vector
OK vpython.vpython
PACKAGE OK __version__ = 7.6.5 __gs_version__ = 3.2
`__gs_version__` resolving also confirms `gs_version.py` reads the bundled
glow.min.js fine there, and that it is on the same 3.2 line trinket serves.
Both builds were checked: with the flag, `vpython-7.6.5-py3-none-any.whl`;
without it, `vpython-7.6.5-cp314-cp314-macosx_10_15_universal2.whl` as before.
Execution now reaches the transport seam — `sphere()` stops at vpython.py:267
`from .no_notebook import _` (autobahn), which is the next piece of work, not a
packaging problem.1 parent a9a6bd4 commit 3c06704
2 files changed
Lines changed: 30 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
11 | 26 | | |
12 | 27 | | |
13 | 28 | | |
| |||
35 | 50 | | |
36 | 51 | | |
37 | 52 | | |
38 | | - | |
39 | 53 | | |
40 | | - | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
45 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
0 commit comments