Skip to content

Commit 1c76e71

Browse files
authored
Merge pull request #176 from fbergmann/level1-version4
Merge l1v4 changes into l1v5
2 parents 1617a73 + 7a43279 commit 1c76e71

File tree

19 files changed

+3352
-648
lines changed

19 files changed

+3352
-648
lines changed

.ci/checkout-submodules.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
git submodule update --init --remote
4+
5+
pushd submodules/libSBML-dependencies
6+
7+
# only checkout the expat submodule
8+
git submodule update --init --remote expat
9+
10+
popd

.ci/create-sdist.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# Create a source distribution
4+
cp src/bindings/python/setup.py .
5+
cp src/bindings/python/MANIFEST.in .
6+
python3 setup.py sdist

.github/workflows/cmake.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020

2121
steps:
22-
- uses: actions/checkout@v2
23-
24-
- name: Checkout submodules
25-
run: git submodule update --init --recursive
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: checkout needed submodules
27+
shell: bash
28+
run: |
29+
./.ci/checkout-submodules.sh
2630
2731
- name: add SWIG to windows
2832
# this is separate from the SWIG download itself, because it needs to be added to the path also when SWIG is cached
@@ -163,7 +167,7 @@ jobs:
163167
run: cmake -E tar cvzf ../binaries_${{ matrix.os }}.tar.gz .
164168

165169
- name: Upload
166-
uses: actions/upload-artifact@v1
170+
uses: actions/upload-artifact@v4
167171
with:
168172
path: ${{runner.workspace}}/build/binaries_${{ matrix.os }}.tar.gz
169173
name: binaries_${{ matrix.os }}.tar.gz

.github/workflows/wheels.yml

Lines changed: 69 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,76 +11,113 @@ jobs:
1111
name: Make SDist
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
with:
16-
fetch-depth: 0 # Optional, use if you use setuptools_scm
17-
submodules: recursive # Optional, use if you have submodules
16+
fetch-depth: 0
17+
18+
- name: checkout needed submodules
19+
run: |
20+
./.ci/checkout-submodules.sh
1821
1922
- name: Build SDist
2023
run: |
2124
cp src/bindings/python/setup.py .
2225
cp src/bindings/python/MANIFEST.in .
2326
pipx run build --sdist
2427
25-
- uses: actions/upload-artifact@v2
28+
- uses: actions/upload-artifact@v4
2629
with:
2730
path: dist/*.tar.gz
2831
name: libSEDML-sdist
2932

3033
build_wheels:
3134
name: Wheel on ${{ matrix.os }} for ${{ matrix.python_version }}
3235
runs-on: ${{ matrix.os }}
36+
needs: [make_sdist]
3337
strategy:
3438
fail-fast: false
3539
matrix:
36-
os: [ubuntu-20.04, windows-2019, macos-11]
37-
python_version: ['cp37-*', 'cp38-*', 'cp39-*', 'cp310-*', 'cp311-*']
40+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
41+
python_version: ['cp39-*', 'cp310-*', 'cp311-*', 'cp312-*', 'cp313-*']
3842

3943
steps:
40-
- uses: actions/checkout@v1
44+
- uses: seanmiddleditch/gha-setup-ninja@master
45+
46+
- name: Add msbuild to PATH (Windows)
47+
if: matrix.os == 'windows-latest'
48+
uses: ilammy/msvc-dev-cmd@v1
49+
50+
- name: Install cibuildwheel
51+
run: |
52+
python -m pip install cibuildwheel==2.23.2 swig==4.2.1 cmake==3.31.6
53+
54+
# print versions
55+
python --version
56+
cmake --version
57+
swig -version
58+
59+
- name: Download sdist
60+
uses: actions/download-artifact@v4
4161
with:
42-
fetch-depth: 0 # Optional, use if you use setuptools_scm
43-
submodules: recursive # Optional, use if you have submodules
62+
name: libSEDML-sdist
63+
path: .
4464

45-
- name: Copy setup.py
65+
- name: Unpack sdist
66+
shell: bash
4667
run: |
47-
cp src/bindings/python/setup.py .
68+
ls -la
69+
tar zxf python_libsedml-*.tar.gz
70+
mv python_libsedml-*/* .
71+
rm -rf python_libsedml-*
72+
ls -la
73+
4874
49-
- uses: pypa/[email protected]
75+
- name: Build wheels
5076
env:
51-
CIBW_BUILD: ${{ matrix.python_version }}
52-
CIBW_ARCHS_MACOS: x86_64 arm64
77+
CIBW_BUILD: ${{ matrix.python_version }}
78+
CIBW_SKIP: "*-musllinux* cp36-* cp37-* cp38-* *-win32"
79+
run: |
80+
python -m cibuildwheel --output-dir wheelhouse
5381
5482
- name: Upload wheels
55-
uses: actions/upload-artifact@v2
83+
uses: actions/upload-artifact@v4
5684
with:
5785
path: wheelhouse/*.whl
58-
name: libSEDML-${{ matrix.os }}
59-
60-
upload_all:
61-
needs: [build_wheels, make_sdist]
86+
name: libSEDML-${{ matrix.os }}-${{ strategy.job-index }}
87+
88+
merge_wheels:
89+
needs: [build_wheels]
6290
runs-on: ubuntu-latest
63-
if: github.event_name == 'release' && github.event.action == 'published'
6491
steps:
65-
- uses: actions/download-artifact@v2
92+
- uses: actions/download-artifact@v4
6693
with:
67-
name: libSEDML-sdist
68-
path: dist
69-
- uses: actions/download-artifact@v2
70-
with:
71-
name: libSEDML-ubuntu-20.04
94+
pattern: libSEDML-*
7295
path: dist
73-
- uses: actions/download-artifact@v2
96+
97+
- name: Move wheels from dist subfolder to dist folder
98+
run: |
99+
find dist -name "*.whl" -exec mv {} dist/ \;
100+
find dist -name "*.tar.gz" -exec mv {} dist/ \;
101+
find dist -type d -empty -delete
102+
103+
- uses: actions/upload-artifact@v4
74104
with:
75-
name: libSEDML-macos-10.15
105+
name: libSEDML-combined
76106
path: dist
77-
- uses: actions/download-artifact@v2
107+
108+
109+
upload_all:
110+
needs: [merge_wheels]
111+
runs-on: ubuntu-latest
112+
if: github.event_name == 'release' && github.event.action == 'published'
113+
steps:
114+
- uses: actions/download-artifact@v4
78115
with:
79-
name: libSEDML-windows-2019
116+
name: libSEDML-combined
80117
path: dist
81118

82-
- uses: pypa/gh-action-pypi-publish@v1.4.2
119+
- uses: pypa/gh-action-pypi-publish@release/v1
83120
with:
84121
user: __token__
85122
password: ${{ secrets.PYPI_API_TOKEN }}
86-
skip_existing: true
123+

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,8 @@ libsedml/_*
173173
examples/python/*.xml
174174
dev/temp_deviser_file.xml
175175
setup.py
176+
MANIFEST.in
177+
178+
# documentation
179+
/doc/html/
180+
Doxyfile

CMakeModules/FindEXPAT.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ find_path(EXPAT_INCLUDE_DIR expat.h
4848
/opt/csw/include # Blastwave
4949
/opt/include
5050
/usr/freeware/include
51-
NO_DEFAULT_PATH)
51+
NO_DEFAULT_PATH
52+
CMAKE_FIND_ROOT_PATH_BOTH)
5253
endif ()
5354

5455
if (NOT EXPAT_INCLUDE_DIR)
55-
find_path(EXPAT_INCLUDE_DIR expat.h)
56+
find_path(EXPAT_INCLUDE_DIR expat.h
57+
CMAKE_FIND_ROOT_PATH_BOTH)
5658
endif ()
5759

5860
find_library(EXPAT_LIBRARY
@@ -81,11 +83,13 @@ find_library(EXPAT_LIBRARY
8183
/opt/csw/lib # Blastwave
8284
/opt/lib
8385
/usr/freeware/lib64
84-
NO_DEFAULT_PATH)
86+
NO_DEFAULT_PATH
87+
CMAKE_FIND_ROOT_PATH_BOTH)
8588
endif()
8689

8790
if (NOT EXPAT_LIBRARY)
88-
find_library(EXPAT_LIBRARY NAMES libexpat expat)
91+
find_library(EXPAT_LIBRARY NAMES libexpat expat
92+
CMAKE_FIND_ROOT_PATH_BOTH )
8993
endif ()
9094

9195
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)

CMakeModules/FindLIBNUML.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (NOT ${LIBNUML_LIBRARY_NAME}_FOUND)
3434
${CONAN_LIB_DIRS_LIBNUML}/cmake
3535
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
3636
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
37+
CMAKE_FIND_ROOT_PATH_BOTH
3738
)
3839
endif()
3940

@@ -90,7 +91,8 @@ find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h
9091
/opt/csw/include # Blastwave
9192
/opt/include
9293
/usr/freeware/include
93-
NO_DEFAULT_PATH)
94+
NO_DEFAULT_PATH
95+
CMAKE_FIND_ROOT_PATH_BOTH)
9496

9597
if (NOT LIBNUML_INCLUDE_DIR)
9698
find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h)
@@ -117,7 +119,8 @@ find_library(LIBNUML_LIBRARY
117119
/opt/csw/lib # Blastwave
118120
/opt/lib
119121
/usr/freeware/lib64
120-
NO_DEFAULT_PATH)
122+
NO_DEFAULT_PATH
123+
CMAKE_FIND_ROOT_PATH_BOTH)
121124

122125
if (NOT LIBNUML_LIBRARY)
123126
find_library(LIBNUML_LIBRARY

CMakeModules/FindLIBSBML.cmake

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the
1+
# Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the
22
# University of Virginia, University of Heidelberg, and University
33
# of Connecticut School of Medicine.
44
# All rights reserved.
@@ -33,11 +33,21 @@ endif()
3333

3434
message (VERBOSE "Looking for ${LIBSBML_LIBRARY_NAME}")
3535

36-
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
3736

3837
string(TOUPPER ${PROJECT_NAME} _UPPER_PROJECT_NAME)
3938
set(_PROJECT_DEPENDENCY_DIR ${_UPPER_PROJECT_NAME}_DEPENDENCY_DIR)
4039

40+
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
41+
PATHS ${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
42+
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
43+
${CONAN_LIB_DIRS_LIBSBML}/cmake
44+
CMAKE_FIND_ROOT_PATH_BOTH
45+
NO_DEFAULT_PATH)
46+
47+
if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
48+
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
49+
endif()
50+
4151
if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
4252
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
4353
PATHS /usr/lib/cmake
@@ -48,6 +58,7 @@ if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
4858
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
4959
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
5060
${CONAN_LIB_DIRS_LIBSBML}/cmake
61+
CMAKE_FIND_ROOT_PATH_BOTH
5162
)
5263
endif()
5364

@@ -111,6 +122,7 @@ find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h
111122
/opt/csw/include # Blastwave
112123
/opt/include
113124
/usr/freeware/include
125+
CMAKE_FIND_ROOT_PATH_BOTH
114126
NO_DEFAULT_PATH)
115127

116128
if (NOT LIBSBML_INCLUDE_DIR)
@@ -140,6 +152,7 @@ find_library(LIBSBML_LIBRARY
140152
/opt/csw/lib # Blastwave
141153
/opt/lib
142154
/usr/freeware/lib64
155+
CMAKE_FIND_ROOT_PATH_BOTH
143156
NO_DEFAULT_PATH)
144157

145158
if (NOT LIBSBML_LIBRARY)

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,23 @@ note the semicolon denoting the listing of several libraries. Of course you coul
3939

4040
for linking against `expat` and indicating, that libSBML was compiled without compression.
4141

42+
## Documentation
43+
API documentation is something to be added and pull requests are happily accepted to improve them. For now a basic doxygen file
44+
is provided and documentation can be generated after checkout like so:
45+
46+
```bash
47+
PROJECT_NUMBER=2.0.32 doxygen -x libSEDML.doxyfile > Doxyfile && doxygen
48+
```
49+
50+
This expands the version number in the doxygen file, creates a temporary `Doxyfile` and runs doxygen with it. After that the
51+
generated documentation is available in the `./doc/html` folder.
52+
4253
## License
4354

4455
This project is open source and freely available under the [Simplified BSD](http://opensource.org/licenses/BSD-2-Clause) license. Should that license not meet your needs, please contact me.
4556

4657

47-
Copyright (c) 2013-2021, Frank T. Bergmann
58+
Copyright (c) 2013-2023, Frank T. Bergmann
4859
All rights reserved.
4960

5061
Redistribution and use in source and binary forms, with or without

dev/create-source-package.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# this script creates the python source package
4+
cp ./src/bindings/python/setup.py .
5+
cp ./src/bindings/python/MANIFEST.in .
6+
7+
# remove old source packages
8+
rm ./dist/*.tar.gz
9+
10+
# create the source package
11+
python3 setup.py sdist

0 commit comments

Comments
 (0)