-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
145 changed files
with
5,029 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<html><head><meta charset=utf-8></head><script src=/pygbag/0.7/pythons.js data-os=fs,gui data-COLS=80 data-LINES=25 data-python=cpython3.11 type=module id=__main__ async defer>#<!-- | ||
import sys, asyncio, platform, embed | ||
|
||
if len(sys.argv) and not sys.argv[0]: | ||
async def main(): | ||
platform.window.debug() | ||
shell.interactive(prompt=True) | ||
|
||
asyncio.run(main()) | ||
|
||
# you can write python code here for a custom loader | ||
|
||
# --></script></html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<html><head><meta charset=utf-8></head><script src=/pygbag/0.7/pythons.js data-os=fs,3d,gui data-COLS=80 data-LINES=25 data-python=cpython3.11 type=module id=__main__ async defer>#<!-- | ||
import sys, asyncio, platform, embed | ||
|
||
if len(sys.argv) and not sys.argv[0]: | ||
async def main(): | ||
platform.window.debug() | ||
shell.interactive(prompt=True) | ||
|
||
asyncio.run(main()) | ||
|
||
# you can write python code here for a custom loader | ||
|
||
# --></script></html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
#!/bin/env python3 | ||
import json | ||
from pathlib import Path | ||
from zipfile import ZipFile | ||
|
||
|
||
MAP = {"-CDN-": "https://pygame-web.github.io/archives/repo/"} | ||
|
||
|
||
# https://pypi.org/simple/pygbag/?format=application/vnd.pypi.simple.latest+json | ||
|
||
# top_level.txt fallback from pyodide ( for ref) | ||
# https://github.com/pyodide/pyodide/blob/90e20badd76d8a8b911f77034512137cc2e7d585/pyodide-build/pyodide_build/common.py#L123-L133 | ||
# https://github.com/pypa/setuptools/blob/d680efc8b4cd9aa388d07d3e298b870d26e9e04b/setuptools/discovery.py#L122 | ||
|
||
# top_level falback from pradyunsg ( used there ) | ||
# https://gist.github.com/pradyunsg/22ca089b48ca55d75ca843a5946b2691 | ||
|
||
from collections import deque | ||
from typing import Iterable | ||
from installer.sources import WheelFile, WheelSource | ||
from installer.utils import parse_metadata_file | ||
|
||
|
||
def _find_importable_components_from_wheel_content_listing( | ||
filepaths: Iterable[str], *, dist_info_dir: str, data_dir: str | ||
) -> Iterable[tuple[str, ...]]: | ||
purelib_str = f"{data_dir}/purelib/" | ||
platlib_str = f"{data_dir}/platlib/" | ||
for path in filepaths: | ||
if path.startswith(dist_info_dir): | ||
# Nothing in dist-info is importable. | ||
continue | ||
|
||
if path.startswith((platlib_str, purelib_str)): | ||
# Remove the prefix from purelib and platlib files. | ||
name = path[len(platlib_str) :] | ||
elif path.startswith(data_dir): | ||
# Nothing else in data is importable. | ||
continue | ||
else: | ||
# Top level files end up in an importable location. | ||
name = path | ||
|
||
if name.endswith(".py"): | ||
yield tuple(name[: -len(".py")].split("/")) | ||
|
||
|
||
def find_major_import_import_names(wheel: WheelSource) -> Iterable[str]: | ||
metadata = parse_metadata_file(wheel.read_dist_info("WHEEL")) | ||
if not (metadata["Wheel-Version"] and metadata["Wheel-Version"].startswith("1.")): | ||
raise NotImplementedError("Only supports wheel 1.x") | ||
|
||
filepaths: Iterable[str] = ( | ||
record_elements[0] for record_elements, _, _ in wheel.get_contents() | ||
) | ||
importable_components = _find_importable_components_from_wheel_content_listing( | ||
filepaths, dist_info_dir=wheel.dist_info_dir, data_dir=wheel.data_dir | ||
) | ||
|
||
return _determine_major_import_names(importable_components) | ||
|
||
|
||
def _determine_major_import_names( | ||
importable_components: Iterable[tuple[str, ...]] | ||
) -> Iterable[str]: | ||
# If you literally want the "top level", just do... | ||
# return {components[0] for components in importable_components} | ||
|
||
# Here, we're going to try to find the longest initial import name instead. | ||
# Mostly, because this was a fun problem to thing through. | ||
|
||
# Build a tree out of the components | ||
tree = {} | ||
for components in importable_components: | ||
subtree = tree | ||
for segment in components: | ||
if segment not in subtree: | ||
subtree[segment] = {} | ||
subtree = subtree[segment] | ||
|
||
# Recurse through the tree to find the names which have != 1 children. | ||
queue = deque() | ||
queue.appendleft((tree, ())) | ||
while queue: | ||
current_tree, current_name = queue.popleft() | ||
|
||
for name, subtree in current_tree.items(): | ||
subname = (*current_name, name) | ||
if len(subtree) == 1: | ||
queue.append((subtree, subname)) | ||
elif name == "__init__": | ||
yield ".".join(current_name) | ||
else: | ||
yield ".".join(subname) | ||
|
||
|
||
for whl in Path(".").glob("pkg/*.whl"): | ||
# print() | ||
# print(whl.stem) | ||
|
||
whlname = whl.as_posix() | ||
|
||
for replace in ("-cp310", "-cp311", "-cp312", "-cp313"): | ||
whlname = whlname.replace(replace, "-<abi>") | ||
|
||
found = False | ||
|
||
with ZipFile(whl) as archive: | ||
for name in archive.namelist(): | ||
if name.endswith(".dist-info/top_level.txt"): | ||
f = archive.open(name) | ||
for tln in f.read().decode().split("\n"): | ||
tln = tln.strip().replace("/", ".") | ||
if not tln: | ||
continue | ||
|
||
|
||
|
||
if tln in MAP: | ||
# print(f"pkg name toplevel {tln} collision with", MAP[tln] ) | ||
continue | ||
# print("\t",tln) | ||
MAP[tln] = whlname | ||
#============================================================================= | ||
if tln == "cwcwidth": | ||
MAP["wcwidth"] = whlname | ||
#============================================================================= | ||
archive.close() | ||
found = True | ||
break | ||
if not found: | ||
print() | ||
print("MISSING TOPLEVEL :", whl) | ||
wheel_file = WheelFile(archive) | ||
for tln in find_major_import_import_names(wheel_file): | ||
MAP[tln] = whlname | ||
|
||
|
||
for py in Path(".").glob("vendor/*.py"): | ||
tln = py.stem | ||
MAP[tln] = py.as_posix() | ||
|
||
for k, v in MAP.items(): | ||
print(k, v) | ||
|
||
with open("index.json", "w") as f: | ||
print(json.dumps(MAP, sort_keys=True, indent=4), file=f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"-CDN-": "https://pygame-web.github.io/archives/repo/", | ||
"Cython": "pkg/Cython-3.0.0a11-py2.py3-none-any.whl", | ||
"Fetch": "vendor/Fetch.py", | ||
"PIL": "pkg/PIL-9.1.1-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"_cffi_backend": "pkg/cffi-1.15.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"_distutils_hack": "pkg/setuptools-62.6.0-py3-none-any.whl", | ||
"_pyfxr": "pkg/pyfxr-0.3.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"_pyrsistent_version": "pkg/pyrsistent-0.19.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"_pytest": "pkg/pytest-7.1.2-py3-none-any.whl", | ||
"apipkg": "pkg/py-1.11.0-py2.py3-none-any.whl", | ||
"asciitree": "pkg/asciitree-0.3.3-py3-none-any.whl", | ||
"atomicwrites": "pkg/atomicwrites-1.4.0-py2.py3-none-any.whl", | ||
"attr": "pkg/attrs-21.4.0-py2.py3-none-any.whl", | ||
"attrs": "pkg/attrs-21.4.0-py2.py3-none-any.whl", | ||
"autograd": "pkg/autograd-1.4-py3-none-any.whl", | ||
"bokeh": "pkg/bokeh-2.4.3-py3-none-any.whl", | ||
"bs4": "pkg/beautifulsoup4-4.11.1-py3-none-any.whl", | ||
"bs4.builder": "pkg/beautifulsoup4-4.11.1-py3-none-any.whl", | ||
"bs4.tests": "pkg/beautifulsoup4-4.11.1-py3-none-any.whl", | ||
"certifi": "pkg/certifi-2022.6.15-py3-none-any.whl", | ||
"cffi": "pkg/cffi-1.15.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"cloudpickle": "pkg/cloudpickle-2.1.0-py3-none-any.whl", | ||
"cmyt": "pkg/cmyt-1.0.4-py3-none-any.whl", | ||
"colorspacious": "pkg/colorspacious-1.1.2-py2.py3-none-any.whl", | ||
"cssselect": "pkg/cssselect-1.1.0-py2.py3-none-any.whl", | ||
"cv2": "pkg/opencv_python-4.6.0.66-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"cwcwidth": "pkg/cwcwidth-0.1.8-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"cycler": "pkg/cycler-0.11.0-py3-none-any.whl", | ||
"cython": "pkg/Cython-3.0.0a11-py2.py3-none-any.whl", | ||
"dateutil": "pkg/python_dateutil-2.8.2-py2.py3-none-any.whl", | ||
"decorator": "pkg/decorator-5.1.1-py3-none-any.whl", | ||
"demes": "pkg/demes-0.2.2-py3-none-any.whl", | ||
"direct": "pkg/panda3d-1.11.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"distlib": "pkg/distlib-0.3.4-py2.py3-none-any.whl", | ||
"docutils": "pkg/docutils-0.18.1-py2.py3-none-any.whl", | ||
"fontTools": "pkg/fonttools-4.33.3-py3-none-any.whl", | ||
"future": "pkg/future-0.18.2-py3-none-any.whl", | ||
"graphics": "vendor/graphics.py", | ||
"harfang": "pkg/harfang-3.2.5-cp32-abi3-wasm32_mvp_emscripten.whl", | ||
"htag": "pkg/htag-0.8.8-py3-none-any.whl", | ||
"htbulma": "pkg/htbulma-0.8.1-py3-none-any.whl", | ||
"html5lib": "pkg/bleach-5.0.0-py3-none-any.whl", | ||
"igraph": "pkg/igraph-0.10.3-cp39-abi3-wasm32_mvp_emscripten.whl", | ||
"imageio": "pkg/imageio-2.19.3-py3-none-any.whl", | ||
"iniconfig": "pkg/iniconfig-1.1.1-py2.py3-none-any.whl", | ||
"isympy": "pkg/sympy-1.10.1-py3-none-any.whl", | ||
"jedi": "pkg/jedi-0.18.1-py2.py3-none-any.whl", | ||
"jinja2": "pkg/Jinja2-3.1.2-py3-none-any.whl", | ||
"joblib": "pkg/joblib-1.1.0-py2.py3-none-any.whl", | ||
"jsonschema": "pkg/jsonschema-4.6.0-py3-none-any.whl", | ||
"kiwisolver": "pkg/kiwisolver-1.4.3-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"libfuturize": "pkg/future-0.18.2-py3-none-any.whl", | ||
"libpasteurize": "pkg/future-0.18.2-py3-none-any.whl", | ||
"lightgbm": "pkg/lightgbm-3.3.2-py3-none-any.whl", | ||
"magic": "pkg/python_magic-0.4.27-py2.py3-none-any.whl", | ||
"matplotlib": "pkg/matplotlib-3.5.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"micropip": "pkg/micropip-0.1.0-py3-none-any.whl", | ||
"mne": "pkg/mne-1.0.3-py3-none-any.whl", | ||
"more_itertools": "pkg/more_itertools-8.13.0-py3-none-any.whl", | ||
"mpl_toolkits": "pkg/matplotlib-3.5.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"mpmath": "pkg/mpmath-1.2.1-py3-none-any.whl", | ||
"networkx": "pkg/networkx-2.8.4-py3-none-any.whl", | ||
"newick": "pkg/newick-1.3.2-py2.py3-none-any.whl", | ||
"nltk": "pkg/nltk-3.7-py3-none-any.whl", | ||
"nose": "pkg/nose-1.3.7-py3-none-any.whl", | ||
"numcodecs": "pkg/numcodecs-0.9.1-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"numpy": "pkg/numpy-1.22.4-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"nurses_2": "pkg/nurses_2-0.18.5-py3-none-any.whl", | ||
"optlang": "pkg/optlang-1.5.2-py2.py3-none-any.whl", | ||
"packaging": "pkg/packaging-21.3-py3-none-any.whl", | ||
"panda3d": "pkg/panda3d-1.11.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"panda3d_tools": "pkg/panda3d-1.11.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pandac": "pkg/panda3d-1.11.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"parso": "pkg/parso-0.8.3-py2.py3-none-any.whl", | ||
"particlepy": "pkg/particlepy-1.1.0-py3-none-any.whl", | ||
"past": "pkg/future-0.18.2-py3-none-any.whl", | ||
"patsy": "pkg/patsy-0.5.2-py2.py3-none-any.whl", | ||
"pgzero": "pkg/pgzero-1.3.dev0-py3-none-any.whl", | ||
"pgzrun": "pkg/pgzero-1.3.dev0-py3-none-any.whl", | ||
"pkg_resources": "pkg/setuptools-62.6.0-py3-none-any.whl", | ||
"pkgconfig": "pkg/pkgconfig-1.5.5-py3-none-any.whl", | ||
"pluggy": "pkg/pluggy-1.0.0-py2.py3-none-any.whl", | ||
"pvectorc": "pkg/pyrsistent-0.19.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pycparser": "pkg/pycparser-2.21-py2.py3-none-any.whl", | ||
"pyfxr": "pkg/pyfxr-0.3.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pyfxr_gui": "pkg/pyfxr-0.3.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pygame.base": "pkg/pygame_static-1.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pygame_texteditor": "pkg/pygame_texteditor-0.6.7-py3-none-any.whl", | ||
"pygame_widgets": "pkg/pygame_widgets-1.1.0-py3-none-any.whl", | ||
"pygments": "pkg/Pygments-2.12.0-py3-none-any.whl", | ||
"pylab": "pkg/matplotlib-3.5.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pymunk": "pkg/pymunk-6.4.0-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pyparsing": "pkg/pyparsing-3.0.9-py3-none-any.whl", | ||
"pyrr": "pkg/pyrr-0.10.3-py3-none-any.whl", | ||
"pyrsistent": "pkg/pyrsistent-0.19.2-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"pytest": "pkg/pytest-7.1.2-py3-none-any.whl", | ||
"pytest_benchmark": "pkg/pytest_benchmark-3.4.1-py2.py3-none-any.whl", | ||
"pytz": "pkg/pytz-2022.1-py2.py3-none-any.whl", | ||
"pyxel": "pkg/pyxel-1.8.8-cp37-abi3-wasm32_mvp_emscripten.whl", | ||
"pyximport": "pkg/Cython-3.0.0a11-py2.py3-none-any.whl", | ||
"raypyc": "pkg/raypyc-0.1.7-py3-none-wasm32_mvp_emscripten.whl", | ||
"retrying": "pkg/retrying-1.3.3-py3-none-any.whl", | ||
"ruamel": "pkg/ruamel.yaml-0.17.21-py3-none-any.whl", | ||
"setuptools": "pkg/setuptools-62.6.0-py3-none-any.whl", | ||
"six": "pkg/six-1.16.0-py2.py3-none-any.whl", | ||
"soupsieve": "pkg/soupsieve-2.3.2.post1-py3-none-any.whl", | ||
"src": "pkg/kiwisolver-1.4.3-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"svgwrite": "pkg/svgwrite-1.4.2-py3-none-any.whl", | ||
"svgwrite.data": "pkg/svgwrite-1.4.2-py3-none-any.whl", | ||
"svgwrite.extensions": "pkg/svgwrite-1.4.2-py3-none-any.whl", | ||
"sympy": "pkg/sympy-1.10.1-py3-none-any.whl", | ||
"telemetrix_aio": "pkg/telemetrix_aio-1.11-py3-none-any.whl", | ||
"termcolor": "pkg/termcolor-1.1.0-py3-none-any.whl", | ||
"tests": "pkg/cmyt-1.0.4-py3-none-any.whl", | ||
"texttable": "pkg/texttable-1.6.7-py2.py3-none-any.whl", | ||
"threadpoolctl": "pkg/threadpoolctl-3.1.0-py3-none-any.whl", | ||
"tlz": "pkg/toolz-0.11.2-py3-none-any.whl", | ||
"tomli": "pkg/tomli-2.0.1-py3-none-any.whl", | ||
"tomli_w": "pkg/tomli_w-1.0.0-py3-none-any.whl", | ||
"toolz": "pkg/toolz-0.11.2-py3-none-any.whl", | ||
"tqdm": "pkg/tqdm-4.64.0-py2.py3-none-any.whl", | ||
"turtle_test": "vendor/turtle_test.py", | ||
"typing_extensions": "pkg/typing_extensions-4.2.0-py3-none-any.whl", | ||
"uncertainties": "pkg/uncertainties-3.1.7-py2.py3-none-any.whl", | ||
"unyt": "pkg/unyt-2.8.0-py2.py3-none-any.whl", | ||
"wasabigeom": "pkg/wasabi_geom-2.1.1-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"wcwidth": "pkg/cwcwidth-0.1.8-<abi>-<abi>-wasm32_mvp_emscripten.whl", | ||
"webencodings": "pkg/webencodings-0.5.1-py2.py3-none-any.whl", | ||
"xarray": "pkg/xarray-2022.3.0-py3-none-any.whl", | ||
"xlrd": "pkg/xlrd-2.0.1-py2.py3-none-any.whl", | ||
"zarr": "pkg/zarr-2.11.3-py3-none-any.whl" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
whl=/data/git/archives/repo/pkg/$(basename $(pwd)).whl | ||
echo Normalizing to mvp : $whl | ||
|
||
for lib in $(find -type f |grep \\.so$) | ||
do | ||
if /opt/python-wasm-sdk/emsdk/upstream/bin/wasm-emscripten-finalize -mvp $lib -o /tmp/norm.so | ||
then | ||
mv /tmp/norm.so $lib | ||
else | ||
echo FAILED TO NORM $lib | ||
fi | ||
done | ||
[ -f $whl ] && rm $whl | ||
zip $whl -r . |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+10.4 MB
archives/pkg/opencv_python-4.6.0.66-cp311-cp311-wasm32_mvp_emscripten.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.