From b1fb5419121d6ec4a7455ff77ec9957be6e3622b Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 17 Oct 2025 16:15:06 +0500 Subject: [PATCH] pyodide setup.py - ensure we have correct `pyodide_2025_0_wasm32` suffix Adding extension, but avoiding adding sources as we're not actually building. As a result build will have a correct suffix `pyodide_2025_0_wasm32.whl` that's pyodide is currently using and this is pyodide is plan to use when it's going to release to PyPI, see https://peps.python.org/pep-0783/ --- .github/workflows/build_pyodide.yml | 4 +++- pyodide/setup.py | 28 +++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_pyodide.yml b/.github/workflows/build_pyodide.yml index 14bb047333..64fe96c32c 100644 --- a/.github/workflows/build_pyodide.yml +++ b/.github/workflows/build_pyodide.yml @@ -40,7 +40,9 @@ jobs: chmod +x script.sh sed -i s/--tty// pyodide/run_docker pyodide/run_docker ./script.sh - mv dist/ifcopenshell-$VERSION-py3-none-any.whl dist/ifcopenshell-$VERSION+${GITHUB_SHA:0:7}-cp313-cp313-emscripten_4_0_9_wasm32.whl + FILE=`echo dist/ifcopenshell-*.whl` + NEW_FILE=`echo $FILE | sed "s/$VERSION/$VERSION+${GITHUB_SHA:0:7}/"` + mv $FILE $NEW_FILE - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/pyodide/setup.py b/pyodide/setup.py index e35a5f5340..2a2ab2c577 100644 --- a/pyodide/setup.py +++ b/pyodide/setup.py @@ -1,11 +1,21 @@ -from setuptools import setup, find_packages +from setuptools import setup, Extension, find_packages -setup(name='ifcopenshell', - version='0.8.0', - description='IfcOpenShell is an open source (LGPL) software library for working with the Industry Foundation Classes (IFC) file format.', - author='Thomas Krijnen', - author_email='thomas@aecgeeks.com', - url='http://ifcopenshell.org', - packages=find_packages(), - package_data={'ifcopenshell': ['util/schema/*.json', 'util/schema/*.ifc'], '': ['*.so', '*.json', '*.ifc']}, +setup( + name="ifcopenshell", + version="0.8.0", + description=( + "IfcOpenShell is an open source (LGPL) software library " + "for working with the Industry Foundation Classes (IFC) file format." + ), + author="Thomas Krijnen", + author_email="thomas@aecgeeks.com", + url="https://ifcopenshell.org", + packages=["ifcopenshell"], + package_data={ + # "*.so" is needed to include prebuilt binary extension. Otherwise it would try to build it and fail. + "ifcopenshell": ["util/schema/*.json", "util/schema/*.ifc", "*.so"], + "": ["*.json", "*.ifc"], + }, + # Has to provide extension to get the correct wheel suffix. + ext_modules=[Extension("ifcopenshell._ifcopenshell_wrapper", sources=[])], )