Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
24f1e7c
building source distribution works
annawendler Feb 23, 2026
4677483
try building wheels with ci
annawendler Feb 23, 2026
fe6706c
[ci skip] try only ubuntu
annawendler Feb 23, 2026
6b35ba7
test
annawendler Feb 23, 2026
369342f
require higher pybind version
annawendler Feb 25, 2026
c13105f
add comma
annawendler Feb 25, 2026
e25c218
skip some pypy versions
annawendler Feb 25, 2026
69a5b96
skip all pypy versions
annawendler Feb 25, 2026
73a7fbc
skip musllinux
annawendler Feb 25, 2026
6ca71df
fix
annawendler Feb 25, 2026
265a58c
test windows
annawendler Feb 25, 2026
22c73cb
skip win32
annawendler Feb 25, 2026
02edbf2
test macos
annawendler Feb 27, 2026
a1d4085
skip macosx_arm64
annawendler Feb 27, 2026
59e454a
test
annawendler Feb 27, 2026
b4febe3
test
annawendler Feb 27, 2026
6f2ac0a
build sdist in ci
annawendler Feb 27, 2026
4b9ce8d
add names for artifacts
annawendler Feb 27, 2026
9747c8c
also include other python packages
annawendler Feb 27, 2026
77bab93
update
annawendler Mar 2, 2026
d5b9b27
only windows
annawendler Mar 5, 2026
6951691
fix typo
annawendler Mar 6, 2026
c8253b1
test upload
annawendler Mar 11, 2026
682490b
typo
annawendler Mar 11, 2026
47cd7d3
use token
annawendler Mar 11, 2026
2dd392f
adapt names, no token
annawendler Mar 11, 2026
55911ce
try only downloading artifacts
annawendler Mar 11, 2026
0700ae8
try again
annawendler Mar 11, 2026
881d5e6
try with new version
annawendler Mar 11, 2026
f7e54c8
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Mar 16, 2026
58979cd
update after merge of main
annawendler Mar 16, 2026
5376644
only ubuntu
annawendler Mar 16, 2026
8c03007
more cpp versions
annawendler Mar 16, 2026
b1d43b1
update path
annawendler Mar 31, 2026
9f2e52b
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Mar 31, 2026
80b08ce
update version
annawendler Mar 31, 2026
ed25c02
include windows
annawendler Mar 31, 2026
c3af9ce
update actions for newer node.js version
annawendler Mar 31, 2026
21f9983
again
annawendler Mar 31, 2026
eacb371
try dynamic versioning
annawendler Apr 1, 2026
c2df595
try again
annawendler Apr 1, 2026
bd64248
no local version
annawendler Apr 1, 2026
2a982eb
general clean up
annawendler Apr 1, 2026
a3e2557
update main ci, fix version for now
annawendler Apr 1, 2026
5b19727
fix typo in if statement
annawendler Apr 1, 2026
9f37563
update ci and link to logo
annawendler Apr 10, 2026
ed9f054
update paths
annawendler Apr 10, 2026
15ed20f
again
annawendler Apr 10, 2026
40108ff
update
annawendler Apr 10, 2026
7131d9e
again
annawendler Apr 10, 2026
701aa3d
adapt else
annawendler Apr 10, 2026
3a79e46
again
annawendler Apr 10, 2026
fd247a1
adapt path for storing wheels
annawendler Apr 10, 2026
969ec6c
try new version to test image
annawendler Apr 10, 2026
c92fbf6
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Apr 10, 2026
13a1ea2
prepare for upload to real pypi
annawendler Apr 10, 2026
b12999b
add static version for pr
annawendler Apr 10, 2026
d60e0b5
fix mpl backend
annawendler Apr 13, 2026
b0fa0b8
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Apr 13, 2026
39c7dbe
debug pip env
annawendler Apr 13, 2026
e8f51a8
remove qt bindings
annawendler Apr 13, 2026
0eb295f
update
annawendler Apr 13, 2026
4b6c310
again
annawendler Apr 13, 2026
7568f83
try again
annawendler Apr 13, 2026
b4dd576
other version
annawendler Apr 13, 2026
a37e771
reset epidata_main and action to previous state
annawendler Apr 13, 2026
1acecee
reintroduce if statements
annawendler Apr 13, 2026
a91d67c
install setuptools again
annawendler Apr 13, 2026
cf93027
install setuptools only for memilio-simulation
annawendler Apr 13, 2026
7dd3357
forgot if statement
annawendler Apr 13, 2026
27bb822
fix order
annawendler Apr 13, 2026
37b0233
review suggestions, test changes on test pypi
annawendler Apr 14, 2026
27e4ba7
update workflow according to review
annawendler Apr 14, 2026
9ab4c4f
update classifiers and readthedocs
annawendler Apr 15, 2026
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
30 changes: 24 additions & 6 deletions .github/actions/build-py/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,38 @@ inputs:
required: true
runs:
using: "composite"
steps:
steps:
- name: Configure Git safe directory
shell: bash
run: git config --global --add safe.directory /__w/memilio/memilio
- name: Install dependencies
shell: bash
run: yum install ninja-build cmake git -qy
- name: Make artifact dir
shell: bash
run: |
cd pycode/memilio-${{ inputs.package }}/
if [ "${{ inputs.package }}" != "simulation" ]; then
cd pycode/memilio-${{ inputs.package }}/
# else stay in root directory
fi
mkdir wheelhouse
- name: Build Python Wheels
shell: bash
run: |
cd pycode/memilio-${{ inputs.package }}/
if [ "${{ inputs.package }}" != "simulation" ]; then
cd pycode/memilio-${{ inputs.package }}/
# else stay in root directory
fi
/opt/python/cp38-cp38/bin/python -m pip install --upgrade pip setuptools wheel
/opt/python/cp38-cp38/bin/python -m pip install scikit-build scikit-build-core
/opt/python/cp38-cp38/bin/python -m build --no-isolation --wheel
/opt/python/cp312-cp312/bin/python -m pip install --upgrade pip setuptools wheel
/opt/python/cp38-cp38/bin/python -m pip install scikit-build scikit-build-core
/opt/python/cp312-cp312/bin/python -m pip install scikit-build scikit-build-core
# Install setuptools-scm only for memilio-simulation
if [ "${{ inputs.package }}" == "simulation" ]; then
/opt/python/cp38-cp38/bin/python -m pip install setuptools-scm
/opt/python/cp312-cp312/bin/python -m pip install setuptools-scm
fi
/opt/python/cp38-cp38/bin/python -m build --no-isolation --wheel
/opt/python/cp312-cp312/bin/python -m build --no-isolation --wheel
# 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
Expand All @@ -33,7 +47,11 @@ runs:
# no auditwheel necessary for pure python packages, so only copy the wheels to the same output directory
cp dist/*.whl wheelhouse
fi
cp -r wheelhouse ..
if [ "${{ inputs.package }}" != "simulation" ]; then
cp -r wheelhouse ..
else
cp -r wheelhouse pycode
fi
- name: Upload Python Wheels
uses: actions/upload-artifact@v4
with:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: PyPI

# on:
# release:
# types:
# - published
# remove following line before merge:
on: [pull_request, release]

jobs:

build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Comment thread
annawendler marked this conversation as resolved.

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pypa/[email protected]

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

build_sdist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- 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/
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MEmilio - a high performance Modular EpideMIcs simuLatIOn software #

![memilio_logo](docs/memilio-small.png)
![memilio_logo](https://github.com/SciCompMod/memilio/blob/main/docs/memilio-small.png?raw=true)

[![CI](https://github.com/SciCompMod/memilio/actions/workflows/main.yml/badge.svg)](https://github.com/SciCompMod/memilio/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/SciCompMod/memilio/branch/main/graph/badge.svg?token=DVQXIQJHBM)](https://codecov.io/gh/SciCompMod/memilio)
Expand Down
19 changes: 14 additions & 5 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,33 @@ Option A: Installing the Python packages (Recommended for nonexperienced users o

You can run simulations, download data, or create plots, by only installing our Python packages.

If you want to use the simulation package ``memilio-simulation``, you can install it directly via:

.. code-block::

pip install memilio-simulation

For the other packages, you can proceed as follows.

1. Navigate to the directory containing our Python code:

.. code-block:: console

cd pycode

2. To install the simulation package ``memilio-simulation``, from here you can do:
2. To install the simulation package ``memilio-epidata``, from here you can do:

.. code-block:: console

cd memilio-simulation
cd memilio-epidata
pip install -e .

3. For afterwards installing the ``memilio-epidata`` package for data downloading and handling, run:
3. For afterwards installing the ``memilio-surrogatemodel`` package for data downloading and handling, run:

.. code-block:: console

cd .. # Go back to the pycode directory
cd memilio-epidata
cd memilio-surrogatemodel
pip install -e .

.. tip:: For Contributors: Installing development packages
Expand All @@ -162,7 +170,8 @@ You can run simulations, download data, or create plots, by only installing our

pip install -e .[dev]

For regular use, the simple ``pip install -e .`` is sufficient.
For regular use, the simple ``pip install -e .`` is sufficient. For development of the ``memilio-simulation`` package,
please also use this command from the root of the MEmilio repository for installation.

To install other packages, see the items below *Python Interface* in the menu on the left hand side.

Expand Down
9 changes: 0 additions & 9 deletions pycode/memilio-simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
cmake_minimum_required(VERSION 3.14)
project(memilio-python)

set(CMAKE_CXX_STANDARD "20")
set(CMAKE_CXX_STANDARD_REQUIRED "20")

option(MEMILIO_USE_BUNDLED_PYBIND11 "Use pybind11 bundled with this library." ON)
mark_as_advanced(MEMILIO_USE_BUNDLED_PYBIND11)

Expand Down Expand Up @@ -48,9 +42,6 @@ else()
find_package(pybind11 REQUIRED)
endif()

# add in C++ library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL)

# a list of all "LINKED_LIBRARIES" that are given to add_pymio_module. will contain duplicates
# used for wheel installation
set(PYMIO_MEMILIO_LIBS_LIST)
Expand Down
6 changes: 3 additions & 3 deletions pycode/memilio-simulation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ This package contains Python bindings for the MEmilio C++ library. It enables se

This project is configured via ``pyproject.toml`` and is built with [scikit-build-core](https://scikit-build-core.readthedocs.io). CMake and Ninja must be available on the system. The package uses the [Pybind11 C++ library](https://pybind11.readthedocs.io) to create the bindings.

To install the package, use the command (from the directory containing ``pyproject.toml``)
To install the package, use the command

```bash
pip install .
pip install memilio-simulation
```

This builds the C++ library and C++ Python extension module and copies everything required to your site-packages.
Expand All @@ -30,7 +30,7 @@ Alternatively, edit the `CMakeCache.txt` in the directory created by scikit-buil

## Development

For developement of the cpp bindings use
For developement of the cpp bindings use the following command from the root of this repository (i.e. the directory containing ``pyproject.toml``)

```bash
pip install -e .[dev]
Expand Down
39 changes: 0 additions & 39 deletions pycode/memilio-simulation/pyproject.toml

This file was deleted.

64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
[project]
name = "memilio-simulation"
dynamic = ["version"]
# remove following line before merge:
# version = "2.3.0"
Comment on lines +4 to +5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm later

description = "Part of MEmilio project, Python bindings to the C++ libraries that contain the models and simulations."
readme = "README.md"
requires-python = ">=3.8"
license = "Apache-2.0"
authors = [{ name = "MEmilio Team" }]
maintainers = [
{ email = "[email protected]" }
]
dependencies = [
# smaller numpy versions cause a security issue, 1.25 does not work together with pyfakefs
"numpy>=1.22,!=1.25.*",
# smaller pandas versions contain a bug that sometimes prevents reading
"pandas>=2.0.0"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows"
]

[project.optional-dependencies]
dev = []

[project.urls]
Homepage = "https://github.com/SciCompMod/memilio"
Team = "https://memilio.readthedocs.io/en/latest/team.html"

[build-system]
requires = [
"scikit-build-core>=0.9.0",
"setuptools>=68",
"setuptools-scm>=8",
"wheel"
]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
cmake.version = ">=3.13"
cmake.args = ["-DMEMILIO_BUILD_SHARED_LIBS:BOOL=ON"]
wheel.packages = ["pycode/memilio-simulation/memilio"]
wheel.install-dir = "memilio/simulation"
build-dir = "pycode/build/memilio-simulation"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"

[tool.setuptools_scm]
local_scheme = "no-local-version"

[tool.cibuildwheel]
# Disable some wheels
skip = ["pp*", "*musllinux*", "*-win32"]

[tool.autopep8]
max-line-length = 79

Expand Down
Loading