diff --git a/.github/actions/build-py/action.yml b/.github/actions/build-py/action.yml index 4900f92333..1f29bd3f85 100644 --- a/.github/actions/build-py/action.yml +++ b/.github/actions/build-py/action.yml @@ -16,29 +16,22 @@ runs: - name: Make artifact dir shell: bash run: | - if [ "${{ inputs.package }}" != "simulation" ]; then - cd pycode/memilio-${{ inputs.package }}/ - # else stay in root directory - fi + cd pycode/memilio-${{ inputs.package }}/ mkdir wheelhouse - name: Build Python Wheels shell: bash run: | - if [ "${{ inputs.package }}" != "simulation" ]; then - cd pycode/memilio-${{ inputs.package }}/ - # else stay in root directory - fi - /opt/python/cp39-cp39/bin/python -m pip install --upgrade pip setuptools wheel - /opt/python/cp313-cp313/bin/python -m pip install --upgrade pip setuptools wheel - /opt/python/cp39-cp39/bin/python -m pip install scikit-build scikit-build-core - /opt/python/cp313-cp313/bin/python -m pip install scikit-build scikit-build-core - # Install setuptools-scm only for memilio-simulation - if [ "${{ inputs.package }}" == "simulation" ]; then - /opt/python/cp39-cp39/bin/python -m pip install setuptools-scm - /opt/python/cp313-cp313/bin/python -m pip install setuptools-scm - fi - /opt/python/cp39-cp39/bin/python -m build --no-isolation --wheel - /opt/python/cp313-cp313/bin/python -m build --no-isolation --wheel + cd pycode/memilio-${{ inputs.package }}/ + # install dependencies and build wheels with specified python versions + for python_cmd in /opt/python/cp39-cp39/bin/python /opt/python/cp313-cp313/bin/python + do + $python_cmd -m pip install --upgrade pip setuptools wheel + $python_cmd -m pip install scikit-build scikit-build-core + if [ "${{ inputs.package }}" == "simulation" ] + then $python_cmd -m pip install setuptools-scm + fi + $python_cmd -m build --no-isolation --wheel + done # Exclude memilio-generation, because its a pure python package, cmake is only used in the build process to retrieve data from cpp if [[ -f "CMakeLists.txt" ]] && [ "${{ inputs.package }}" != "generation" ]; then # includes native dependencies in the wheel @@ -47,11 +40,7 @@ runs: # no auditwheel necessary for pure python packages, so only copy the wheels to the same output directory cp dist/*.whl wheelhouse fi - if [ "${{ inputs.package }}" != "simulation" ]; then - cp -r wheelhouse .. - else - cp -r wheelhouse pycode - fi + cp -r wheelhouse .. - name: Upload Python Wheels uses: actions/upload-artifact@v7 with: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 7056e46bbb..0aa33ff212 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,44 +1,58 @@ name: PyPI -on: - release: - types: +on: + release: + types: - published + ### Uncomment the "push:" together with the "repository-url:" field of action pypa/gh-action-pypi-publish + ### to make a test release. Building this is rather expensive so do not merge this uncommented! + push: + ### @Reviewer: MAKE SURE THE LINE ABOVE IS COMMENTED OUT BEFORE MERGE! ### jobs: build_wheels: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-2025-vs2026] + os: [ubuntu-latest, windows-2025-vs2026, macos-26] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - name: "Checkout" + uses: actions/checkout@v6 with: fetch-depth: 0 - - uses: pypa/cibuildwheel@v3.4.1 + - name: "Build Wheels" + uses: pypa/cibuildwheel@v3.4.1 + with: + package-dir: pycode/memilio-simulation - - uses: actions/upload-artifact@v7 + - name: "Upload Artifacts" + uses: actions/upload-artifact@v7 with: name: cibw-wheels-${{ matrix.os }} - path: ./wheelhouse/*.whl + path: wheelhouse/*.whl - build_sdist: + build_sdist: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - name: "Checkout" + uses: actions/checkout@v6 with: fetch-depth: 0 - - run: pipx run build --sdist + - name: "Build Source Distribution" + run: | + cd pycode/memilio-simulation + pipx run build --sdist - - uses: actions/upload-artifact@v7 + - name: "Upload Artifacts" + uses: actions/upload-artifact@v7 with: name: cibw-sdist - path: dist/*.tar.gz + path: pycode/memilio-simulation/dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] @@ -46,7 +60,7 @@ jobs: environment: pypi permissions: id-token: write - + steps: - uses: actions/download-artifact@v7 with: @@ -58,5 +72,5 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true - # To test uploads to TestPyPI, uncomment the following: - # repository-url: https://test.pypi.org/legacy/ + ### To test uploads to TestPyPI in a PR, uncomment the following, as well as the "push:" line at the top: + repository-url: https://test.pypi.org/legacy/ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 0a29cfcdba..0000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(memilio-simulation) - -set(CMAKE_CXX_STANDARD "20") -set(CMAKE_CXX_STANDARD_REQUIRED "20") - -# add in C++ library -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL) - -add_subdirectory(pycode/memilio-simulation) \ No newline at end of file diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c30dc59eaa..d3245ac103 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -156,7 +156,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") "-Wno-unknown-warning-option;-Wno-deprecated;-Wno-gnu-zero-variadic-macro-arguments;") endif() -# woyrkarounds for compiler bugs or overzealous optimization/analysis +# workarounds for compiler bugs or overzealous optimization/analysis if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RELEASE") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") string(APPEND MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS diff --git a/cpp/README.md b/cpp/README.md index 1c7877076e..5783dbc9e1 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -52,7 +52,6 @@ Options can be specified with `cmake .. -D