Skip to content

Commit a4f13b9

Browse files
authored
Merge pull request #1 from jeffbli/main
Finalized Development of svMorph with Real-time Interactive Virtual Stenting and Synthetic Stenosis/Aneurysm Generation
2 parents 10f561d + 385bb5b commit a4f13b9

35 files changed

+4981
-0
lines changed

.github/workflows/release.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*" # e.g. v0.1.0, v0.1.1-rc1
7+
8+
permissions:
9+
contents: write # needed to create the GitHub Release
10+
id-token: write # needed for PyPI trusted publishing (OIDC)
11+
12+
jobs:
13+
# ------------------------------------------------------------------ #
14+
# 1. Run the test suite on the tagged commit before publishing #
15+
# ------------------------------------------------------------------ #
16+
test:
17+
name: Run tests before release
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
cache: pip
27+
28+
- name: Install and test
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install ".[dev]"
32+
pytest tests/ -v
33+
34+
# ------------------------------------------------------------------ #
35+
# 2. Build the source distribution and wheel #
36+
# ------------------------------------------------------------------ #
37+
build:
38+
name: Build distributions
39+
runs-on: ubuntu-latest
40+
needs: test
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.12"
48+
cache: pip
49+
50+
- name: Install build tooling
51+
run: pip install build
52+
53+
- name: Build sdist and wheel
54+
run: python -m build
55+
56+
- name: Upload dist artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: dist
60+
path: dist/
61+
62+
# ------------------------------------------------------------------ #
63+
# 3. Publish to PyPI using OIDC trusted publishing #
64+
# Configure on PyPI: https://pypi.org/manage/account/publishing/ #
65+
# ------------------------------------------------------------------ #
66+
publish-pypi:
67+
name: Publish to PyPI
68+
runs-on: ubuntu-latest
69+
needs: build
70+
environment:
71+
name: pypi
72+
url: https://pypi.org/p/svmorph
73+
steps:
74+
- name: Download dist artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: dist
78+
path: dist/
79+
80+
- name: Publish to PyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+
83+
# ------------------------------------------------------------------ #
84+
# 4. Create a GitHub Release with the built artifacts attached #
85+
# ------------------------------------------------------------------ #
86+
github-release:
87+
name: Create GitHub Release
88+
runs-on: ubuntu-latest
89+
needs: publish-pypi
90+
steps:
91+
- uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0 # needed for tag message
94+
95+
- name: Download dist artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
name: dist
99+
path: dist/
100+
101+
- name: Create GitHub Release
102+
uses: softprops/action-gh-release@v2
103+
with:
104+
files: dist/*
105+
generate_release_notes: true

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
17+
os: [ubuntu-latest]
18+
include:
19+
# Spot-check Windows and macOS on the latest Python only
20+
- os: windows-latest
21+
python-version: "3.12"
22+
- os: macos-latest
23+
python-version: "3.12"
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
cache: pip
33+
34+
- name: Install core dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install ".[dev]"
38+
39+
- name: Run tests with coverage
40+
run: |
41+
pytest tests/ -v --cov=svmorph --cov-report=term-missing --cov-report=xml
42+
43+
- name: Upload coverage report
44+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: coverage-report
48+
path: coverage.xml

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# IDE
2+
.vscode/
3+
4+
# Python cache files
5+
__pycache__/
6+
*.pyc
7+
8+
# Build / packaging artifacts
9+
dist/
10+
build/
11+
*.egg-info/
12+
13+
# Geometry and mesh files
14+
*.vtp
15+
16+
# Data directories
17+
input/
18+
obtained/
19+
20+
# Legacy code (superseded by svmorph/)
21+
kelvinlet_core/
22+
23+
# Test input data and results (not source files)
24+
tests/input/
25+
tests/data/
26+
tests/results/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 svMorph contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)