-
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.
Initial changes to switch helics_apps PyPI build over to using cibuil…
…dwheel
- Loading branch information
Showing
14 changed files
with
189 additions
and
2,569 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,4 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
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 @@ | ||
.git_archival.txt export-subst |
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 |
---|---|---|
|
@@ -20,60 +20,62 @@ on: | |
jobs: | ||
build-helics_apps: | ||
# No container needed, since the package is version agnostic | ||
name: Build ${{ matrix.build }}${{ matrix.arch }} wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
id: [linux, macos, win32, win64] | ||
include: | ||
- id: linux | ||
os: ubuntu-latest | ||
- id: macos | ||
os: macos-latest | ||
plat_name: macosx_10_9_intel | ||
- id: win32 | ||
os: windows-latest | ||
arch: win32 | ||
plat_name: win32 | ||
- id: win64 | ||
os: windows-latest | ||
arch: win64 | ||
plat_name: win_amd64 | ||
- os: ubuntu-20.04 | ||
arch: "x86_64" | ||
build: "manylinux_" | ||
artifact_suffix: "manylinux_x86_64" | ||
use_qemu: false | ||
- os: windows-2019 | ||
arch: "AMD64" | ||
build: "" | ||
artifact_suffix: "windows_x86_64" | ||
use_qemu: false | ||
- os: windows-2019 | ||
arch: "x86" | ||
build: "" | ||
artifact_suffix: "windows_x86" | ||
use_qemu: false | ||
- os: macos-14 | ||
arch: "universal2" | ||
build: "" | ||
artifact_suffix: "macos" | ||
use_qemu: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch --prune --unshallow | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
architecture: 'x64' | ||
- name: Create wheel | ||
shell: bash | ||
run: | | ||
source ./helics_apps-pip/packaging_scripts/setup-${{ runner.os }}.sh "$(cat HELICS_VERSION)" "${{ matrix.arch }}" | ||
./helics_apps-pip/packaging_scripts/build-${{ runner.os }}.sh "${{ matrix.plat_name }}" | ||
./helics_apps-pip/packaging_scripts/repair-${{ runner.os }}.sh | ||
fetch-depth: 0 # ensure history is present for automatic versioning | ||
# - name: Set up QEMU | ||
# uses: docker/[email protected] | ||
# if: runner.os == 'Linux' && matrix.use_qemu | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS: "${{ matrix.arch }}" | ||
CIBW_ARCHS_MACOS: "universal2" | ||
CIBW_BUILD: "cp39-${{ matrix.build }}*" | ||
CIBW_BUILD_VERBOSITY: 3 | ||
TEST_ENV_VAR: "A VALUE!!!" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: apps-python-dist | ||
path: upload-wheelhouse | ||
name: apps-python-dist-${{matrix.artifact_suffix}} | ||
path: helics_apps-pip/wheelhouse/*.whl | ||
|
||
build-helics_apps-sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch --prune --unshallow | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip install wheel setuptools cffi | ||
fetch-depth: 0 # for setuptools_scm to find tags | ||
|
||
- name: Build sdist | ||
run: | | ||
cd ./helics_apps-pip | ||
python setup.py sdist | ||
pipx run build --sdist | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -92,7 +94,7 @@ jobs: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Get the built packages | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
merge-multiple: true | ||
path: dist | ||
|
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,10 @@ | ||
.DS_STORE | ||
.vscode/ | ||
|
||
venv/ | ||
|
||
helics-src/ | ||
libzmq-src/ | ||
build/ | ||
dist/ | ||
_version.py |
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
cmake_minimum_required(VERSION 3.15...3.26) | ||
project(HELICS LANGUAGES CXX) # Must be "HELICS" due to its CMake files requiring CMAKE_PROJECT_NAME == PROJECT_NAME in order to build app executables | ||
|
||
message(STATUS "--------------------") | ||
message(STATUS "SYSTEM ${CMAKE_SYSTEM}") | ||
message(STATUS "SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}") | ||
message(STATUS "SYSTEM_VERSION ${CMAKE_SYSTEM_VERSION}") | ||
message(STATUS "SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") | ||
message(STATUS "APPLE ${APPLE}") | ||
message(STATUS "LINUX ${LINUX}") | ||
message(STATUS "UNIX ${UNIX}") | ||
message(STATUS "WIN32 ${WIN32}") | ||
message(STATUS "ENV(TEST_ENV_VAR) $ENV{TEST_ENV_VAR}") | ||
|
||
return() | ||
message(STATUS ${SKBUILD_PROJECT_NAME}) | ||
message(STATUS ${SKBUILD_PROJECT_VERSION}) | ||
message(STATUS ${SKBUILD_PROJECT_VERSION_FULL}) | ||
message(STATUS ${SKBUILD_STATE}) | ||
message(STATUS ${SKBUILD_PLATLIB_DIR}) | ||
message(STATUS ${SKBUILD_DATA_DIR}) | ||
|
||
include(FetchContent) | ||
|
||
# Only fetch source code files if it is building an sdist | ||
if(NOT SKBUILD_STATE STREQUAL "sdist") | ||
set(FETCHCONTENT_FULLY_DISCONNECTED ON) | ||
endif() | ||
|
||
# NOTE: SKBUILD_PROJECT_VERSION strips some of the extra Python version components out, like postN and devM | ||
# The setuptools_scm "no-guess-dev" version_scheme works well, since that leaves it with just the HELICS version | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(HELICS_DISABLE_GIT_OPERATIONS ON) | ||
set(HELICS_ZMQ_SUBPROJECT ON) | ||
set(HELICS_ZMQ_FORCE_SUBPROJECT ON) | ||
set(HELICS_ENABLE_ZMQ_CORE OFF) | ||
set(HELICS_DISABLE_BOOST ON) # TODO: headers are just needed to compile, maybe tell users to have it when building from source | ||
set(HELICS_BUILD_APP_LIBRARY ON) | ||
set(HELICS_BUILD_APP_EXECUTABLES ON) | ||
FetchContent_Declare( | ||
helics | ||
URL https://github.com/GMLC-TDC/HELICS/releases/download/v${SKBUILD_PROJECT_VERSION}/Helics-v${SKBUILD_PROJECT_VERSION}-source.tar.gz | ||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/helics-src | ||
) | ||
|
||
# For making the sdist, only need to download the source code | ||
if(SKBUILD_STATE STREQUAL "sdist") | ||
if(NOT helics_POPULATED) | ||
FetchContent_Populate(HELICS) | ||
message(STATUS "Populated HELICS") | ||
endif() | ||
elseif(SKBUILD_STATE STREQUAL "wheel") | ||
add_library(helicsCpp98_ide INTERFACE) | ||
FetchContent_MakeAvailable(helics) | ||
endif() | ||
message(STATUS ${helics_POPULATED}) | ||
message(STATUS ${helics_SOURCE_DIR}) | ||
message(STATUS ${helics_BINARY_DIR}) | ||
|
||
|
||
# HELICS_SOURCE = os.path.join(setup_py_dir, "./_source") | ||
# HELICS_VERSION = versioneer.get_version() | ||
# HELICS_VERSION = re.findall(r"(?:(\d+\.(?:\d+\.)*\d+))", HELICS_VERSION)[0] | ||
# HELICS_INSTALL = os.path.join(setup_py_dir, "./helics_apps/data") | ||
# DOWNLOAD_URL = "https://github.com/GMLC-TDC/HELICS/releases/download/v{version}/Helics-v{version}-source.tar.gz".format(version=HELICS_VERSION) |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.