Skip to content
Merged

Dev #247

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
36 changes: 36 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,42 @@ jobs:
- name: Run package tests
run: bun turbo test ${{ needs.release-check.outputs.test_filters }}

- name: Validate Pyodide build tooling
if: needs.release-check.outputs.ducpy == 'true'
run: |
python -m pip install --upgrade pip
pip install "pyodide-build==0.29.3" "wheel<0.44"

# Verify pyodide CLI works (catches import errors like the wheel.cli removal)
pyodide --help > /dev/null

# Install cross-build environment
pyodide xbuildenv install 0.29.3
XBUILD_DIR="$(pwd)/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
if [ ! -d "$XBUILD_DIR/pyodide-root" ]; then
XBUILD_DIR="$HOME/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
fi
export PYODIDE_ROOT="$XBUILD_DIR/pyodide-root"
echo "PYODIDE_ROOT=$PYODIDE_ROOT"

# Check wheel platform tag — this is the tag used in the .whl filename.
# pyodide_tags() returns install-compatibility tags (emscripten first), but
# wheel_platform() returns the actual build platform tag (e.g. pyodide_2025_0_wasm32).
TAG=$(python3 -c "
import os
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
from pyodide_build.build_env import wheel_platform
print(wheel_platform())
")
echo "Pyodide wheel platform tag: $TAG"
if echo "$TAG" | grep -q "pyodide_"; then
echo "Wheel platform tag is pyodide_* — OK (compatible with Pyodide 0.29.3 runtime)"
else
echo "ERROR: Wheel platform tag is '$TAG', expected pyodide_*"
echo "This means the built wheel will NOT be compatible with the Pyodide 0.29.3 runtime."
exit 1
fi

# ──────────────────────────────────────────────────────────────────────
# Phase 3: Summary & gate check
# Acts as a single required status check for branch protection.
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/release-ducpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,38 @@ jobs:
if: steps.release.outputs.status == 'success'
run: |
python -m pip install --upgrade pip
pip install "pyodide-build==0.29.3"
echo "emscripten_version=$(pyodide config get emscripten_version)" >> $GITHUB_OUTPUT
pip install "pyodide-build==0.29.3" "wheel<0.44"
pyodide xbuildenv install 0.29.3
XBUILD_DIR="$(pwd)/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
if [ ! -d "$XBUILD_DIR/pyodide-root" ]; then
XBUILD_DIR="$HOME/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
fi
export PYODIDE_ROOT="$XBUILD_DIR/pyodide-root"

# Get Emscripten version (needed for emsdk setup)
EMSCRIPTEN_VERSION=$(python3 -c "
import os
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
from pyodide_build.build_env import get_build_environment_vars
from pathlib import Path
print(get_build_environment_vars(Path(os.environ['PYODIDE_ROOT']))['PYODIDE_EMSCRIPTEN_VERSION'])
")
echo "emscripten_version=${EMSCRIPTEN_VERSION}" >> $GITHUB_OUTPUT

# Verify wheel platform tag is pyodide_* (not pyemscripten_*)
TAG=$(python3 -c "
import os
os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
from pyodide_build.build_env import wheel_platform
print(wheel_platform())
")
echo "Pyodide wheel platform tag: $TAG"
if echo "$TAG" | grep -q "pyodide_"; then
echo "Wheel platform tag is pyodide_* — OK"
else
echo "ERROR: Wheel platform tag is '$TAG', expected pyodide_*"
exit 1
fi

- name: Setup Emscripten SDK
if: steps.release.outputs.status == 'success'
Expand Down
1 change: 1 addition & 0 deletions packages/ducpy/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
autoapi
27 changes: 27 additions & 0 deletions packages/ducpy/docs/_templates/sidebar/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
{% block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
</div>
{%- endif %}
{% if not theme_sidebar_hide_name %}
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
{%- endif %}
{% endblock brand_content %}
</a>

<div class="sidebar-badges" style="text-align: center; margin-top: 0.5rem; margin-bottom: 0.5rem; display: flex; justify-content: center; gap: 0.4rem; flex-wrap: wrap; padding: 0 10px;">
<a href="https://pypi.org/project/ducpy/" target="_blank">
<img src="https://shields.io/badge/Pip-blue?logo=Pypi&logoColor=white&style=round-square" alt="Pip" style="height: 18px;" />
</a>
<a href="https://github.com/ducflair/duc/releases" target="_blank">
<img src="https://img.shields.io/pypi/v/ducpy?style=round-square&label=latest%20stable" alt="PyPI ducpy@latest release" style="height: 18px;" />
</a>
</div>
1 change: 1 addition & 0 deletions packages/ducpy/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
html_static_path = ['_static']
html_extra_path = ['extra']
html_baseurl = "https://ducflair.github.io/duc/reference/python/"
html_logo = "https://cdn.jsdelivr.net/gh/ducflair/assets@main/src/duc/duc-extended.png"

extensions.append('autoapi.extension')
autoapi_dirs = ["../src/ducpy"]
Expand Down
17 changes: 0 additions & 17 deletions packages/ducpy/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
ducpy
===================

.. raw:: html

<p align="center">
<br/>
<a href="https://duc.ducflair.com" target="_blank">
<img width="256px" src="https://cdn.jsdelivr.net/gh/ducflair/assets@main/src/duc/duc-extended.png" />
</a>
<p align="center">2D CAD File Format</p>
<p align="center">
<a href="https://pypi.org/project/ducpy/"><img src="https://shields.io/badge/Pip-blue?logo=Pypi&logoColor=white&style=round-square" alt="Pip" /></a>
<a href="https://github.com/ducflair/duc/releases"><img src="https://img.shields.io/pypi/v/ducpy?style=round-square&label=latest%20stable" alt="PyPI ducpy@latest release" /></a>
<a href="https://pypi.org/project/ducpy/"><img src="https://img.shields.io/pypi/dm/ducpy?style=round-square&color=salmon" alt="Downloads" /></a>
</p>
</p>

Overview
--------

**Builders API (High-level)**
The easy way to build, manage ``.duc`` files.
Expand Down
2 changes: 1 addition & 1 deletion packages/ducpy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sync:schema": "uv run python scripts/sync_schema.py",
"build": "bash -c 'uv run python scripts/sync_schema.py && SETUPTOOLS_SCM_PRETEND_VERSION=${1} uv build' --",
"gen:docs": "bun clean:docs && cd docs && uv run make html",
"dev:docs": "uv run --with sphinx-autobuild sphinx-autobuild docs docs/_build/html --port 8080 --open-browser",
"dev:docs": "uv run --with sphinx-autobuild sphinx-autobuild docs docs/_build/html --port 8240 --open-browser",
"clean:docs": "cd docs && uv run make clean",
"test": "uv run -m pytest src/tests/src/test_*.py",
"test:verbose": "uv run -m pytest -v src/tests/src/test_*.py",
Expand Down
2 changes: 1 addition & 1 deletion packages/ducpy/src/ducpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Python library for the DUC 2D CAD file format.

Usage::
Usage:
``import ducpy as duc``

Builders API (High-level):
Expand Down
Loading
Loading