Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b0a1713
Add build workflow
kostrykin Dec 12, 2023
ff5f051
Fix build workflow
kostrykin Dec 12, 2023
0e64533
Fix build script
kostrykin Dec 12, 2023
f22e036
Fix build script
kostrykin Dec 12, 2023
958ea1c
Fix build script
kostrykin Dec 12, 2023
daabb58
Add `libglu1-mesa-dev` dependency for build script
kostrykin Dec 12, 2023
e0dc3cb
Add `libglew-dev` dependency to build script
kostrykin Dec 12, 2023
d5c6bda
Add `-Dpybind11_DIR=`
kostrykin Dec 12, 2023
cc7d00d
Set `$CONDA_PREFIX` environment variable
kostrykin Dec 12, 2023
f8d0696
Fix build workflow
kostrykin Dec 12, 2023
57d3137
Remove doxygen from build script
kostrykin Dec 12, 2023
a38e51a
Fix bug in setup.py
kostrykin Dec 12, 2023
58e342b
Fix build script
kostrykin Dec 12, 2023
67ecabb
Disable tests
kostrykin Dec 12, 2023
5992710
Fix bug in setup.py
kostrykin Dec 12, 2023
730242c
Use `sudo` for `setup.py install` in build script
kostrykin Dec 12, 2023
d58f98b
Fix build script
kostrykin Dec 12, 2023
fe93ab7
Build wheel and upload artifact
kostrykin Dec 12, 2023
9c40930
Reduce artifact size
kostrykin Dec 12, 2023
a5b8b3a
Fix artifact
kostrykin Dec 12, 2023
b38bb7a
Exclude debug build from artifact
kostrykin Dec 12, 2023
015ec35
Clean up artifact
kostrykin Dec 12, 2023
bd4569d
Fix workflow
kostrykin Dec 12, 2023
3c56842
Add Docker build workflow
kostrykin Dec 13, 2023
14e006d
Add `pyyaml` as build dependency to build script
kostrykin Dec 13, 2023
5991e1f
Update build instructions
kostrykin Dec 13, 2023
2585b89
Fix build workflow
kostrykin Dec 13, 2023
8e9040e
Fix Docker workflow
kostrykin Dec 13, 2023
37828ac
Fix workflow
kostrykin Dec 13, 2023
810ff8a
Add debug code to workflow
kostrykin Dec 13, 2023
b881a34
Fix Dockerfile
kostrykin Dec 13, 2023
3c42926
Squashed commit of the following:
kostrykin Dec 13, 2023
86001f5
Add examples to Dockerfile
kostrykin Dec 13, 2023
af548b1
Update README.md
kostrykin Dec 13, 2023
703a9a2
Fix Dockerfile
kostrykin Dec 13, 2023
b3c3c73
Fix Dockerfile
kostrykin Dec 13, 2023
076af6e
Fix Dockerfile
kostrykin Dec 13, 2023
2f11195
Fix Dockerfile
kostrykin Dec 13, 2023
4a30196
Fix Dockerfile
kostrykin Dec 13, 2023
97292e5
Fix Dockerfile
kostrykin Dec 13, 2023
3f7599b
Update README.md
kostrykin Dec 13, 2023
ec5c6a5
Fix `docker run` instruction
kostrykin Dec 14, 2023
a8925d4
Refactor for 0.2.0 (#1)
kostrykin May 13, 2025
9665f53
Update README.md
kostrykin May 13, 2025
3c2b5e2
Remove MANIFEST.in
kostrykin May 13, 2025
5168e9c
Update .readthedocs.yaml
kostrykin May 13, 2025
a0df7db
Update .readthedocs.yaml
kostrykin May 13, 2025
7ebf543
Update .readthedocs.yaml
kostrykin May 13, 2025
137a10c
Update RTD integration (#2)
kostrykin May 13, 2025
22daa6a
Update README.md
kostrykin May 13, 2025
b96fed4
Update README.md
kostrykin May 13, 2025
dddb55a
Update README.md
kostrykin May 13, 2025
8a34049
Update README.md
kostrykin May 13, 2025
cd18496
Migrate build system to `python-build` (#3)
kostrykin May 13, 2025
0f95789
Rename `LIBCARNA_PYTHON_BUILD_TEST` to `LIBCARNA_PYTHON_BUILD_TESTS`
kostrykin May 13, 2025
67819fe
Update README.md
kostrykin May 13, 2025
3fde3c8
Update docs
kostrykin May 13, 2025
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
129 changes: 129 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build and Test

on:
workflow_call:
inputs:
python-version:
required: true
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: latest
auto-update-conda: true

- name: Patch required Python version
run: |
sed -i "s|python .\+|python ==${{ inputs.python-version }}|g" environment.yml
cat environment.yml

- name: Create and validate conda environment
shell: bash
run: |
conda env create -f environment.yml --prefix ./.env
eval "$(conda shell.bash hook)"
conda activate ./.env
python -V
python -c "import sys; v = sys.version_info; assert f'{v.major}.{v.minor}' == '${{ inputs.python-version }}'"

- name: Extract libcarna version
id: meta
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda activate ./.env
export libcarna_version=$(conda list --json |jq -rj '[ .[] | select( .name == "libcarna" ) ][0].version')
echo "libcarna_version=$libcarna_version" >> "$GITHUB_OUTPUT"

- name: Build wheel
shell: bash
run: ./linux_build.bash

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: dist-${{ inputs.python-version }}
path: build/dist/libcarna_python-*.whl

outputs:
libcarna_version: ${{ steps.meta.outputs.libcarna_version }}

test:
needs: build
name: Test
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist-${{ inputs.python-version }}

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: latest
auto-update-conda: true

- name: Create and validate conda environment
shell: bash
run: |
conda create --prefix ./.env -c conda-forge -c bioconda \
python==${{ inputs.python-version }} \
libcarna==${{ needs.build.outputs.libcarna_version }} \
pip
eval "$(conda shell.bash hook)"
conda activate ./.env
python -V
python -c "import sys; v = sys.version_info; assert f'{v.major}.{v.minor}' == '${{ inputs.python-version }}'"

- name: Install wheel
run: |
eval "$(conda shell.bash hook)"
conda activate ./.env
pip install libcarna_python-*.whl

- name: Test installation
run: |
eval "$(conda shell.bash hook)"
conda activate ./.env
python -c "import libcarna; assert libcarna.libcarna_version == '${{ needs.build.outputs.libcarna_version }}'"

- name: Install dependencies for tests and examples
run: |
eval "$(conda shell.bash hook)"
conda activate ./.env
pip install -r test/requirements.txt
pip install -r docs/requirements.txt

- name: Run tests
run: |
eval "$(conda shell.bash hook)"
conda activate ./.env
python -m unittest -vv
env:
LIBCARNA_PYTHON_LOGGING: true

- name: Upload failed test output
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-output-${{ inputs.python-version }}
path: |
test/test/results/actual
32 changes: 32 additions & 0 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Test

on:
workflow_dispatch:

push:
branches: [ 'master', 'develop' ]
paths-ignore:
- 'docs/**'
- '.git*'
- 'LICENSE'
- 'LICENSE-*'
- '**/*.md'
- '.readthedocs.yaml'
- '.vscode/**'
- 'install_libcarna_dev.bash'
- 'linux_build.bash'

pull_request:
branches-ignore: [ 'master' ]

jobs:
build_and_test:
name: Build and Test ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
uses: ./.github/workflows/build.yml
secrets: inherit
with:
python-version: ${{ matrix.python-version }}
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/.env
/condaenv.*
/build
/docs/build
/dist
/CarnaPy.egg-info
/misc/conda-recipe/carnapy
/LibCarna_Python.egg-info
/.libcarna-dev
/test/results/actual
.ipynb_checkpoints
*.swp
*.pyc
*.DS_Store
28 changes: 28 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

# Sphinx setup
sphinx:
fail_on_warning: true
configuration: docs/conf.py

# Install build dependencies
conda:
environment: environment.yml

# Specify the build process
build:
os: ubuntu-24.04
tools:
python: "miniconda-latest"
jobs:
install:
- bash ./linux_build.bash
- pip install build/dist/libcarna_python-*.whl
pre_build:
- pip install -r docs/requirements.txt
build:
html:
- LIBCARNA_PYTHON_NBSPHINX_EXECUTE=never sphinx-build -M html docs $READTHEDOCS_OUTPUT
114 changes: 114 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"python.analysis.extraPaths": [
"./build/make_release"
],
"search.exclude": {
"docs/examples": true,
"docs/build": true
},
"files.readonlyInclude": {
"build/**": true,
},
"[git-commit]": {
"editor.rulers": [50]
},
"editor.rulers": [
119
],
"files.associations": {
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"barrier": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"coroutine": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"expected": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"netfwd": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"source_location": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"rope": "cpp",
"slist": "cpp",
"format": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"latch": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"scoped_allocator": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"spanstream": "cpp",
"sstream": "cpp",
"stacktrace": "cpp",
"stdexcept": "cpp",
"stdfloat": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"syncstream": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"*.py.in": "python"
}
}
Loading