sbml2cellml 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. sbml2cellml-0.1.0/.bumpversion.toml +24 -0
  2. sbml2cellml-0.1.0/.github/CODEOWNERS +1 -0
  3. sbml2cellml-0.1.0/.github/dependabot.yml +16 -0
  4. sbml2cellml-0.1.0/.github/pull_request_template.md +12 -0
  5. sbml2cellml-0.1.0/.github/rulesets/apply.sh +61 -0
  6. sbml2cellml-0.1.0/.github/rulesets/develop.json +61 -0
  7. sbml2cellml-0.1.0/.github/rulesets/main.json +22 -0
  8. sbml2cellml-0.1.0/.github/rulesets/tags.json +16 -0
  9. sbml2cellml-0.1.0/.github/workflows/biomodels.yml +68 -0
  10. sbml2cellml-0.1.0/.github/workflows/ci-cd.yml +131 -0
  11. sbml2cellml-0.1.0/.github/workflows/docs.yml +73 -0
  12. sbml2cellml-0.1.0/.github/workflows/ruff.yml +37 -0
  13. sbml2cellml-0.1.0/.github/workflows/ty.yml +45 -0
  14. sbml2cellml-0.1.0/.gitignore +35 -0
  15. sbml2cellml-0.1.0/.pre-commit-config.yaml +60 -0
  16. sbml2cellml-0.1.0/.python-version +1 -0
  17. sbml2cellml-0.1.0/.ruff.toml +81 -0
  18. sbml2cellml-0.1.0/.zenodo.json +22 -0
  19. sbml2cellml-0.1.0/CITATION.cff +21 -0
  20. sbml2cellml-0.1.0/CLAUDE.md +149 -0
  21. sbml2cellml-0.1.0/LICENSE +7 -0
  22. sbml2cellml-0.1.0/PKG-INFO +89 -0
  23. sbml2cellml-0.1.0/README.md +37 -0
  24. sbml2cellml-0.1.0/biomodels/models.json +1081 -0
  25. sbml2cellml-0.1.0/biomodels/results.json +39749 -0
  26. sbml2cellml-0.1.0/docs/README.md +5 -0
  27. sbml2cellml-0.1.0/docs/api/biomodels.cases.md +3 -0
  28. sbml2cellml-0.1.0/docs/api/biomodels.cli.md +3 -0
  29. sbml2cellml-0.1.0/docs/api/biomodels.models.md +3 -0
  30. sbml2cellml-0.1.0/docs/api/biomodels.runner.md +3 -0
  31. sbml2cellml-0.1.0/docs/api/cellml.md +3 -0
  32. sbml2cellml-0.1.0/docs/api/cellml2sbml.md +3 -0
  33. sbml2cellml-0.1.0/docs/api/cli.md +3 -0
  34. sbml2cellml-0.1.0/docs/api/console.md +3 -0
  35. sbml2cellml-0.1.0/docs/api/index.md +44 -0
  36. sbml2cellml-0.1.0/docs/api/log.md +3 -0
  37. sbml2cellml-0.1.0/docs/api/mathml.md +3 -0
  38. sbml2cellml-0.1.0/docs/api/sbml.md +3 -0
  39. sbml2cellml-0.1.0/docs/api/sbml2cellml.md +3 -0
  40. sbml2cellml-0.1.0/docs/api/sbmlmath.md +3 -0
  41. sbml2cellml-0.1.0/docs/api/simulate.md +3 -0
  42. sbml2cellml-0.1.0/docs/api/testsuite.cases.md +3 -0
  43. sbml2cellml-0.1.0/docs/api/testsuite.cli.md +3 -0
  44. sbml2cellml-0.1.0/docs/api/testsuite.compare.md +3 -0
  45. sbml2cellml-0.1.0/docs/api/testsuite.report.md +3 -0
  46. sbml2cellml-0.1.0/docs/api/testsuite.results.md +3 -0
  47. sbml2cellml-0.1.0/docs/api/testsuite.runner.md +3 -0
  48. sbml2cellml-0.1.0/docs/api/testsuite.simulators.md +3 -0
  49. sbml2cellml-0.1.0/docs/api/testsuite.worker.md +3 -0
  50. sbml2cellml-0.1.0/docs/api/units.md +3 -0
  51. sbml2cellml-0.1.0/docs/api/variables.md +3 -0
  52. sbml2cellml-0.1.0/docs/biomodels.md +1136 -0
  53. sbml2cellml-0.1.0/docs/conversion.md +99 -0
  54. sbml2cellml-0.1.0/docs/development.md +288 -0
  55. sbml2cellml-0.1.0/docs/index.md +68 -0
  56. sbml2cellml-0.1.0/docs/installation.md +63 -0
  57. sbml2cellml-0.1.0/docs/roadmap.md +31 -0
  58. sbml2cellml-0.1.0/docs/robots.txt +9 -0
  59. sbml2cellml-0.1.0/docs/simulation.md +17 -0
  60. sbml2cellml-0.1.0/docs/testsuite.md +1710 -0
  61. sbml2cellml-0.1.0/examples/__init__.py +0 -0
  62. sbml2cellml-0.1.0/examples/cellml2sbml_example.py +73 -0
  63. sbml2cellml-0.1.0/examples/cellml_example.py +88 -0
  64. sbml2cellml-0.1.0/examples/glimepiride_example.py +63 -0
  65. sbml2cellml-0.1.0/examples/models/glimepiride_body.xml +4516 -0
  66. sbml2cellml-0.1.0/examples/models/glimepiride_body_flat.xml +5592 -0
  67. sbml2cellml-0.1.0/examples/models/glimepiride_intestine.xml +742 -0
  68. sbml2cellml-0.1.0/examples/models/glimepiride_kidney.xml +534 -0
  69. sbml2cellml-0.1.0/examples/models/glimepiride_liver.xml +565 -0
  70. sbml2cellml-0.1.0/examples/models/test_model.cellml +31 -0
  71. sbml2cellml-0.1.0/pyproject.toml +126 -0
  72. sbml2cellml-0.1.0/references/cellml_2_0_1_normative_specification.pdf +0 -0
  73. sbml2cellml-0.1.0/references/cellml_reset_example.py +118 -0
  74. sbml2cellml-0.1.0/references/libopencor.ipynb +170 -0
  75. sbml2cellml-0.1.0/release-notes/0.1.0.md +20 -0
  76. sbml2cellml-0.1.0/scripts/__init__.py +0 -0
  77. sbml2cellml-0.1.0/scripts/llms_txt.py +295 -0
  78. sbml2cellml-0.1.0/src/sbml2cellml/__init__.py +16 -0
  79. sbml2cellml-0.1.0/src/sbml2cellml/biomodels/__init__.py +1 -0
  80. sbml2cellml-0.1.0/src/sbml2cellml/biomodels/cases.py +122 -0
  81. sbml2cellml-0.1.0/src/sbml2cellml/biomodels/cli.py +228 -0
  82. sbml2cellml-0.1.0/src/sbml2cellml/biomodels/models.py +281 -0
  83. sbml2cellml-0.1.0/src/sbml2cellml/biomodels/runner.py +92 -0
  84. sbml2cellml-0.1.0/src/sbml2cellml/cellml.py +135 -0
  85. sbml2cellml-0.1.0/src/sbml2cellml/cellml2sbml.py +382 -0
  86. sbml2cellml-0.1.0/src/sbml2cellml/cli.py +159 -0
  87. sbml2cellml-0.1.0/src/sbml2cellml/console.py +18 -0
  88. sbml2cellml-0.1.0/src/sbml2cellml/log.py +80 -0
  89. sbml2cellml-0.1.0/src/sbml2cellml/mathml.py +115 -0
  90. sbml2cellml-0.1.0/src/sbml2cellml/sbml.py +89 -0
  91. sbml2cellml-0.1.0/src/sbml2cellml/sbml2cellml.py +272 -0
  92. sbml2cellml-0.1.0/src/sbml2cellml/sbmlmath.py +296 -0
  93. sbml2cellml-0.1.0/src/sbml2cellml/simulate.py +168 -0
  94. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/__init__.py +1 -0
  95. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/cases.py +322 -0
  96. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/cli.py +130 -0
  97. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/compare.py +224 -0
  98. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/report.py +236 -0
  99. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/results.py +138 -0
  100. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/runner.py +285 -0
  101. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/simulators.py +101 -0
  102. sbml2cellml-0.1.0/src/sbml2cellml/testsuite/worker.py +187 -0
  103. sbml2cellml-0.1.0/src/sbml2cellml/units.py +192 -0
  104. sbml2cellml-0.1.0/src/sbml2cellml/variables.py +176 -0
  105. sbml2cellml-0.1.0/superpowers/plans/2026-09-16-s1-package-infrastructure.md +3017 -0
  106. sbml2cellml-0.1.0/superpowers/plans/2026-09-17-s2-cellml2sbml.md +2640 -0
  107. sbml2cellml-0.1.0/superpowers/plans/2026-09-17-s3-testsuite.md +2075 -0
  108. sbml2cellml-0.1.0/superpowers/plans/2026-09-17-s4-biomodels.md +442 -0
  109. sbml2cellml-0.1.0/superpowers/specs/2026-09-16-s1-package-infrastructure-design.md +295 -0
  110. sbml2cellml-0.1.0/superpowers/specs/2026-09-17-s2-cellml2sbml-design.md +195 -0
  111. sbml2cellml-0.1.0/superpowers/specs/2026-09-17-s3-testsuite-design.md +80 -0
  112. sbml2cellml-0.1.0/superpowers/specs/2026-09-17-s4-biomodels-design.md +51 -0
  113. sbml2cellml-0.1.0/tests/__init__.py +0 -0
  114. sbml2cellml-0.1.0/tests/biomodels_mocks.py +91 -0
  115. sbml2cellml-0.1.0/tests/cellml_models.py +203 -0
  116. sbml2cellml-0.1.0/tests/conftest.py +20 -0
  117. sbml2cellml-0.1.0/tests/data/import_child.cellml +17 -0
  118. sbml2cellml-0.1.0/tests/data/import_parent.cellml +6 -0
  119. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00001/00001-model.m +47 -0
  120. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00001/00001-results.csv +52 -0
  121. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00001/00001-sbml-l3v2.xml +52 -0
  122. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00001/00001-settings.txt +8 -0
  123. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00025/00025-model.m +54 -0
  124. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00025/00025-results.csv +52 -0
  125. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00025/00025-sbml-l3v2.xml +74 -0
  126. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00025/00025-settings.txt +8 -0
  127. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00026/00026-model.m +50 -0
  128. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00026/00026-results.csv +52 -0
  129. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00026/00026-sbml-l3v2.xml +72 -0
  130. sbml2cellml-0.1.0/tests/data/testsuite/semantic/00026/00026-settings.txt +8 -0
  131. sbml2cellml-0.1.0/tests/sbml_models.py +63 -0
  132. sbml2cellml-0.1.0/tests/simulators.py +57 -0
  133. sbml2cellml-0.1.0/tests/test_biomodels_cases.py +108 -0
  134. sbml2cellml-0.1.0/tests/test_biomodels_cli.py +202 -0
  135. sbml2cellml-0.1.0/tests/test_biomodels_models.py +233 -0
  136. sbml2cellml-0.1.0/tests/test_biomodels_results.py +19 -0
  137. sbml2cellml-0.1.0/tests/test_biomodels_runner.py +120 -0
  138. sbml2cellml-0.1.0/tests/test_cellml.py +65 -0
  139. sbml2cellml-0.1.0/tests/test_cellml2sbml.py +280 -0
  140. sbml2cellml-0.1.0/tests/test_cli.py +203 -0
  141. sbml2cellml-0.1.0/tests/test_examples.py +35 -0
  142. sbml2cellml-0.1.0/tests/test_mathml.py +58 -0
  143. sbml2cellml-0.1.0/tests/test_package.py +29 -0
  144. sbml2cellml-0.1.0/tests/test_roundtrip.py +116 -0
  145. sbml2cellml-0.1.0/tests/test_sbml.py +61 -0
  146. sbml2cellml-0.1.0/tests/test_sbml2cellml.py +161 -0
  147. sbml2cellml-0.1.0/tests/test_sbmlmath.py +167 -0
  148. sbml2cellml-0.1.0/tests/test_simulate.py +82 -0
  149. sbml2cellml-0.1.0/tests/test_testsuite_cases.py +248 -0
  150. sbml2cellml-0.1.0/tests/test_testsuite_compare.py +254 -0
  151. sbml2cellml-0.1.0/tests/test_testsuite_full.py +44 -0
  152. sbml2cellml-0.1.0/tests/test_testsuite_report.py +258 -0
  153. sbml2cellml-0.1.0/tests/test_testsuite_results.py +96 -0
  154. sbml2cellml-0.1.0/tests/test_testsuite_runner.py +226 -0
  155. sbml2cellml-0.1.0/tests/test_testsuite_worker.py +106 -0
  156. sbml2cellml-0.1.0/tests/test_units.py +182 -0
  157. sbml2cellml-0.1.0/tests/test_variables.py +95 -0
  158. sbml2cellml-0.1.0/testsuite/results.json +66582 -0
  159. sbml2cellml-0.1.0/tox.ini +35 -0
  160. sbml2cellml-0.1.0/uv.lock +1795 -0
  161. sbml2cellml-0.1.0/zensical.toml +153 -0
@@ -0,0 +1,24 @@
1
+ [tool.bumpversion]
2
+ current_version = "0.1.0"
3
+ commit = true
4
+ parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
5
+ serialize = ["{major}.{minor}.{patch}"]
6
+ search = "{current_version}"
7
+ replace = "{new_version}"
8
+ regex = false
9
+ ignore_missing_version = false
10
+ # no tag: the bump is merged into develop through a pull request, which
11
+ # rewrites the commit, so the tag is created on develop afterwards
12
+ tag = false
13
+ sign_tags = false
14
+ tag_name = "{new_version}"
15
+ tag_message = "Bump version: {current_version} to {new_version}"
16
+ allow_dirty = false
17
+ message = "Bump version: {current_version} to {new_version}"
18
+ commit_args = ""
19
+
20
+ [[tool.bumpversion.files]]
21
+ filename = "./src/sbml2cellml/__init__.py"
22
+
23
+ [[tool.bumpversion.files]]
24
+ filename = "./CITATION.cff"
@@ -0,0 +1 @@
1
+ * @matthiaskoenig
@@ -0,0 +1,16 @@
1
+ # Keep the GitHub Actions used in the workflows up to date.
2
+ # See https://docs.github.com/code-security/dependabot/dependabot-version-updates
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ # a single pull request for all action updates instead of one per action
10
+ groups:
11
+ github-actions:
12
+ patterns:
13
+ - "*"
14
+ open-pull-requests-limit: 5
15
+ commit-message:
16
+ prefix: "ci"
@@ -0,0 +1,12 @@
1
+ ## Summary
2
+
3
+ <!-- what does this change and why -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] the pull request targets `develop`
8
+ - [ ] tests were added or updated for the change
9
+ - [ ] `tox run-parallel` passes locally (tests and `ty`)
10
+ - [ ] `ruff check` and `ruff format` are clean, e.g., via `pre-commit run --all-files`
11
+ - [ ] public functions and classes have type annotations and a docstring
12
+ - [ ] user visible changes are in `release-notes/` and, if needed, in `docs/`
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Apply the repository policies of sbml2cellml: the merge settings of the
4
+ # repository, the rulesets in this directory and the branch which may deploy
5
+ # the documentation. The script is idempotent, i.e., a ruleset which already
6
+ # exists is updated instead of added a second time, so it can be run again
7
+ # after every change of the json files.
8
+ #
9
+ # The file name of a ruleset has to match the "name" in the json. A ruleset which
10
+ # is removed from this directory stays on the repository, delete it with
11
+ # `gh api -X DELETE repos/<owner>/<repo>/rulesets/<id>`.
12
+ #
13
+ # Requires the github cli (https://cli.github.com) authenticated as a user with
14
+ # admin permission on the repository:
15
+ #
16
+ # gh auth login
17
+ # .github/rulesets/apply.sh [owner/repo]
18
+ #
19
+ set -euo pipefail
20
+
21
+ REPO="${1:-matthiaskoenig/sbml2cellml}"
22
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23
+
24
+ echo "repository settings of ${REPO}"
25
+ gh api -X PATCH "repos/${REPO}" \
26
+ -F allow_auto_merge=true \
27
+ -F delete_branch_on_merge=true \
28
+ -F allow_update_branch=true \
29
+ -F allow_squash_merge=true \
30
+ -F allow_rebase_merge=true \
31
+ -F allow_merge_commit=false \
32
+ --silent
33
+
34
+ for path in "${DIR}"/*.json; do
35
+ name="$(basename "${path}" .json)"
36
+ id="$(gh api "repos/${REPO}/rulesets" --jq "map(select(.name == \"${name}\")) | .[0].id // empty")"
37
+ if [[ -n "${id}" ]]; then
38
+ gh api -X PUT "repos/${REPO}/rulesets/${id}" --input "${path}" --silent
39
+ echo "ruleset ${name} updated (${id})"
40
+ else
41
+ id="$(gh api -X POST "repos/${REPO}/rulesets" --input "${path}" --jq .id)"
42
+ echo "ruleset ${name} created (${id})"
43
+ fi
44
+ done
45
+
46
+ # The documentation workflow deploys from develop. Enabling GitHub Pages creates
47
+ # the github-pages environment with a deployment policy for the default branch
48
+ # of that moment (main here), which rejects every deployment from develop.
49
+ echo "deployment branches of the github-pages environment"
50
+ gh api -X PUT "repos/${REPO}/environments/github-pages" --silent --input - <<'JSON'
51
+ {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}}
52
+ JSON
53
+ policies="$(gh api "repos/${REPO}/environments/github-pages/deployment-branch-policies" \
54
+ --jq '.branch_policies[].name')"
55
+ if grep -qx develop <<<"${policies}"; then
56
+ echo "develop may deploy"
57
+ else
58
+ gh api -X POST "repos/${REPO}/environments/github-pages/deployment-branch-policies" \
59
+ -f name=develop -f type=branch --silent
60
+ echo "develop may deploy (added)"
61
+ fi
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "develop",
3
+ "target": "branch",
4
+ "enforcement": "active",
5
+ "bypass_actors": [],
6
+ "conditions": {
7
+ "ref_name": {
8
+ "include": [
9
+ "refs/heads/develop"
10
+ ],
11
+ "exclude": []
12
+ }
13
+ },
14
+ "rules": [
15
+ {
16
+ "type": "deletion"
17
+ },
18
+ {
19
+ "type": "non_fast_forward"
20
+ },
21
+ {
22
+ "type": "required_linear_history"
23
+ },
24
+ {
25
+ "type": "pull_request",
26
+ "parameters": {
27
+ "required_approving_review_count": 0,
28
+ "dismiss_stale_reviews_on_push": true,
29
+ "require_code_owner_review": false,
30
+ "require_last_push_approval": false,
31
+ "required_review_thread_resolution": true,
32
+ "allowed_merge_methods": [
33
+ "squash",
34
+ "rebase"
35
+ ],
36
+ "require_extra_approval_for_unattributed_changes": false
37
+ }
38
+ },
39
+ {
40
+ "type": "required_status_checks",
41
+ "parameters": {
42
+ "strict_required_status_checks_policy": false,
43
+ "do_not_enforce_on_create": false,
44
+ "required_status_checks": [
45
+ {
46
+ "context": "tests"
47
+ },
48
+ {
49
+ "context": "ruff"
50
+ },
51
+ {
52
+ "context": "ty"
53
+ },
54
+ {
55
+ "context": "docs"
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "main",
3
+ "target": "branch",
4
+ "enforcement": "active",
5
+ "bypass_actors": [],
6
+ "conditions": {
7
+ "ref_name": {
8
+ "include": [
9
+ "refs/heads/main"
10
+ ],
11
+ "exclude": []
12
+ }
13
+ },
14
+ "rules": [
15
+ {
16
+ "type": "deletion"
17
+ },
18
+ {
19
+ "type": "non_fast_forward"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "tags",
3
+ "target": "tag",
4
+ "enforcement": "active",
5
+ "bypass_actors": [],
6
+ "conditions": {
7
+ "ref_name": {
8
+ "include": ["~ALL"],
9
+ "exclude": []
10
+ }
11
+ },
12
+ "rules": [
13
+ {"type": "deletion"},
14
+ {"type": "non_fast_forward"}
15
+ ]
16
+ }
@@ -0,0 +1,68 @@
1
+ name: biomodels
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ concurrency:
7
+ group: biomodels
8
+ cancel-in-progress: false
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ biomodels:
15
+ name: biomodels
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 120
18
+ permissions:
19
+ contents: write # push the results branch
20
+ pull-requests: write # open the pull request
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ with:
24
+ persist-credentials: false
25
+ - name: Install the python dev files
26
+ # the extension of libroadrunner links against libpython, which the
27
+ # standalone interpreters do not put on the library search path
28
+ run: |
29
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
30
+ sudo apt-get update
31
+ sudo apt-get install -y python3.13-dev
32
+ - name: Install uv and set the python version
33
+ uses: astral-sh/setup-uv@v10.1.0
34
+ with:
35
+ python-version: "3.13"
36
+ enable-cache: true
37
+ - name: Cache the BioModels downloads
38
+ uses: actions/cache@v6
39
+ with:
40
+ path: ~/.cache/sbml2cellml/biomodels
41
+ key: biomodels-${{ hashFiles('biomodels/models.json') }}
42
+ restore-keys: |
43
+ biomodels-
44
+ - name: Install dependencies
45
+ run: uv sync --extra dev
46
+ - name: Run the BioModels check
47
+ shell: bash
48
+ run: uv run sbml2cellml-biomodels run | tee biomodels-run.log
49
+ - name: Build the pull request body from the run summary
50
+ run: |
51
+ {
52
+ echo "Regenerated by the biomodels workflow with sbml2cellml-biomodels run."
53
+ tail -12 biomodels-run.log
54
+ echo "Review the changes of docs/biomodels.md before merging."
55
+ } > biomodels-summary.md
56
+ - name: Open a pull request with the results
57
+ uses: peter-evans/create-pull-request@v8
58
+ with:
59
+ token: ${{ secrets.BIOMODELS_TOKEN || github.token }}
60
+ branch: biomodels-results
61
+ base: develop
62
+ title: "Update the BioModels results"
63
+ commit-message: "Update the BioModels results"
64
+ body-path: biomodels-summary.md
65
+ delete-branch: true
66
+ add-paths: |
67
+ biomodels/results.json
68
+ docs/biomodels.md
@@ -0,0 +1,131 @@
1
+ name: CI-CD
2
+
3
+ on:
4
+ push:
5
+ # feature branches are tested through their pull request, tags release
6
+ branches: [develop, main]
7
+ tags: ['*']
8
+ pull_request:
9
+ branches: [develop, main]
10
+ workflow_dispatch:
11
+
12
+ # least privilege by default, the release job raises what it needs
13
+ permissions:
14
+ contents: read
15
+
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18
+ # superseded branch runs are cancelled, release runs are never cancelled
19
+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
20
+
21
+ jobs:
22
+ test:
23
+ runs-on: ${{ matrix.os }}
24
+ timeout-minutes: 45
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ os: [ubuntu-latest, windows-latest, macos-latest]
29
+ python-version: ["3.13"]
30
+
31
+ steps:
32
+ - uses: actions/checkout@v7
33
+ with:
34
+ persist-credentials: false
35
+ - name: Install the python dev files (linux only)
36
+ # the extension of libroadrunner links against libpython, which the
37
+ # standalone interpreters do not put on the library search path
38
+ run: |
39
+ if [ "$RUNNER_OS" == "Linux" ]; then
40
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
41
+ sudo apt-get update
42
+ sudo apt-get install -y python${{ matrix.python-version }}-dev
43
+ fi
44
+ shell: bash
45
+ - name: Install uv and set the python version
46
+ # astral-sh/setup-uv publishes no floating major tag beyond v7
47
+ uses: astral-sh/setup-uv@v10.1.0
48
+ with:
49
+ python-version: ${{ matrix.python-version }}
50
+ enable-cache: true
51
+ - name: Cache the SBML test suite
52
+ # the complete SBML test suite runs on linux only
53
+ if: runner.os == 'Linux'
54
+ uses: actions/cache@v6
55
+ with:
56
+ path: ~/.cache/sbml2cellml
57
+ key: sbml-test-suite-3.5.0
58
+ - name: Test with tox
59
+ env:
60
+ # the complete SBML test suite runs on linux only
61
+ SBML2CELLML_TESTSUITE: ${{ runner.os == 'Linux' && '1' || '' }}
62
+ run:
63
+ uvx --with tox-uv tox -e py${{ matrix.python-version }}
64
+
65
+ tests:
66
+ # the one check the branch protection requires; the names of the matrix
67
+ # jobs change with the matrix, this name does not, see .github/rulesets/
68
+ name: tests
69
+ needs: test
70
+ if: always()
71
+ runs-on: ubuntu-latest
72
+ timeout-minutes: 5
73
+ steps:
74
+ - name: Check the result of the test matrix
75
+ env:
76
+ RESULT: ${{ needs.test.result }}
77
+ run: |
78
+ echo "test matrix: $RESULT"
79
+ test "$RESULT" = "success"
80
+
81
+ release:
82
+ needs: tests
83
+ if: startsWith(github.ref, 'refs/tags/')
84
+ runs-on: ubuntu-latest
85
+ timeout-minutes: 20
86
+ environment:
87
+ name: pypi
88
+ url: https://pypi.org/p/sbml2cellml
89
+ permissions:
90
+ id-token: write # trusted publishing to PyPI
91
+ contents: write # create the GitHub release
92
+ steps:
93
+ - uses: actions/checkout@v7
94
+ with:
95
+ persist-credentials: false
96
+ - name: Install uv
97
+ uses: astral-sh/setup-uv@v10.1.0
98
+ with:
99
+ python-version: "3.13"
100
+ enable-cache: true
101
+ - name: Build package
102
+ run: uvx hatch build
103
+ - name: Check the package
104
+ run: uvx twine check dist/*
105
+ - name: Publish to PyPI
106
+ uses: pypa/gh-action-pypi-publish@release/v1
107
+ with:
108
+ packages-dir: dist
109
+ - name: Create GitHub release
110
+ uses: softprops/action-gh-release@v3
111
+ with:
112
+ body_path: "release-notes/${{ github.ref_name }}.md"
113
+ draft: false
114
+ prerelease: false
115
+
116
+ sync-main:
117
+ # main tracks the latest published release, see docs/development.md
118
+ needs: release
119
+ if: startsWith(github.ref, 'refs/tags/')
120
+ runs-on: ubuntu-latest
121
+ timeout-minutes: 5
122
+ permissions:
123
+ contents: write # fast-forward main to the released commit
124
+ steps:
125
+ - uses: actions/checkout@v7
126
+ with:
127
+ # a shallow clone cannot be pushed to another branch
128
+ fetch-depth: 0
129
+ - name: Fast-forward main to the release
130
+ # no --force: the push fails loudly if it would not be a fast-forward
131
+ run: git push origin HEAD:main
@@ -0,0 +1,73 @@
1
+ name: documentation
2
+
3
+ on:
4
+ push:
5
+ # feature branches are built through their pull request
6
+ branches: [develop, main]
7
+ pull_request:
8
+ branches: [develop, main]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ # one run per branch or pull request, so that a deployment of `develop` is
16
+ # never overtaken by the next one, which would leave the site half published
17
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18
+ cancel-in-progress: false
19
+
20
+ jobs:
21
+ docs:
22
+ # the name the branch protection requires, see .github/rulesets/
23
+ name: docs
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 20
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ with:
29
+ persist-credentials: false
30
+ - name: Configure GitHub Pages
31
+ uses: actions/configure-pages@v6
32
+ - name: Install the python dev files
33
+ # the extension of libroadrunner links against libpython, which the
34
+ # standalone interpreters do not put on the library search path
35
+ run: |
36
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
37
+ sudo apt-get update
38
+ sudo apt-get install -y python3.13-dev
39
+ - name: Install uv and set the python version
40
+ uses: astral-sh/setup-uv@v10.1.0
41
+ with:
42
+ python-version: "3.13"
43
+ enable-cache: true
44
+ - name: Install dependencies
45
+ run: uv sync --extra dev
46
+ - name: Build the documentation
47
+ # the API reference is rendered from the docstrings by mkdocstrings,
48
+ # so the package has to be importable
49
+ run: uv run zensical build --clean --strict
50
+ - name: Generate the agent facing files
51
+ # llms.txt, llms-full.txt and the markdown of every page
52
+ run: uv run python scripts/llms_txt.py
53
+ - name: Upload the site
54
+ uses: actions/upload-pages-artifact@v5
55
+ with:
56
+ path: site
57
+
58
+ deploy:
59
+ needs: docs
60
+ # only the default branch publishes to https://matthiaskoenig.github.io/sbml2cellml
61
+ if: github.ref == 'refs/heads/develop'
62
+ runs-on: ubuntu-latest
63
+ timeout-minutes: 10
64
+ permissions:
65
+ pages: write # deploy to GitHub Pages
66
+ id-token: write # verify the deployment originates from this workflow
67
+ environment:
68
+ name: github-pages
69
+ url: ${{ steps.deployment.outputs.page_url }}
70
+ steps:
71
+ - name: Deploy to GitHub Pages
72
+ id: deployment
73
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,37 @@
1
+ name: ruff
2
+
3
+ on:
4
+ push:
5
+ # feature branches are checked through their pull request
6
+ branches: [develop, main]
7
+ pull_request:
8
+ branches: [develop, main]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
17
+
18
+ jobs:
19
+ ruff:
20
+ # required by the branch protection, see .github/rulesets/develop.json
21
+ name: ruff
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 10
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+ with:
27
+ persist-credentials: false
28
+ # the ruff version is read from the dev dependencies in pyproject.toml
29
+ - name: Lint
30
+ # astral-sh/ruff-action publishes no floating major tag beyond v3
31
+ uses: astral-sh/ruff-action@v4.1.0
32
+ with:
33
+ args: check --output-format=github
34
+ - name: Format
35
+ uses: astral-sh/ruff-action@v4.1.0
36
+ with:
37
+ args: format --check --diff
@@ -0,0 +1,45 @@
1
+ name: ty
2
+
3
+ on:
4
+ push:
5
+ # feature branches are checked through their pull request
6
+ branches: [develop, main]
7
+ pull_request:
8
+ branches: [develop, main]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
17
+
18
+ jobs:
19
+ ty:
20
+ # required by the branch protection, see .github/rulesets/develop.json
21
+ name: ty
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 15
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+ with:
27
+ persist-credentials: false
28
+ - name: Install the python dev files
29
+ # the extension of libroadrunner links against libpython, which the
30
+ # standalone interpreters do not put on the library search path
31
+ run: |
32
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
33
+ sudo apt-get update
34
+ sudo apt-get install -y python3.13-dev
35
+ - name: Install uv and set the python version
36
+ uses: astral-sh/setup-uv@v10.1.0
37
+ with:
38
+ python-version: "3.13"
39
+ enable-cache: true
40
+ - name: Type check with tox
41
+ env:
42
+ # render diagnostics as GitHub Actions workflow annotations
43
+ TY_OUTPUT_FORMAT: github
44
+ run:
45
+ uvx --with tox-uv tox -e ty
@@ -0,0 +1,35 @@
1
+ # python
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+
6
+ # packaging artifacts (hatchling builds into dist/)
7
+ dist/
8
+
9
+ # environments, tool caches
10
+ .venv/
11
+ .tox/
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .coverage
15
+ coverage.xml
16
+ # build cache of zensical
17
+ .cache/
18
+ # scratch of the subagent-driven development workflow
19
+ .superpowers/
20
+
21
+ # rendered documentation, built by the `documentation` workflow
22
+ site/
23
+
24
+ # generated by the examples
25
+ examples/results/
26
+ # generated by sbml2cellml-testsuite (converted files of the run)
27
+ testsuite/work/
28
+ # generated by sbml2cellml-biomodels (converted files of the run)
29
+ biomodels/work/
30
+
31
+ # editors, operating system
32
+ .idea/
33
+ .vscode/
34
+ *~
35
+ .DS_Store
@@ -0,0 +1,60 @@
1
+ # Checks run before every commit, see `docs/development.md`.
2
+ # Install once per checkout with `pre-commit install`.
3
+ #
4
+ # A commit only checks the changed files; `pre-commit run --all-files` checks
5
+ # the whole repository, which is what a newly added hook should be tried with.
6
+
7
+ repos:
8
+ - repo: https://github.com/pre-commit/pre-commit-hooks
9
+ rev: v6.0.0
10
+ hooks:
11
+ - id: check-yaml
12
+ description: Check yaml files for parseable syntax
13
+ - id: check-toml
14
+ description: Check toml files for parseable syntax
15
+ - id: check-json
16
+ description: Check json files for parseable syntax
17
+ - id: check-added-large-files
18
+ description: Prevent large files from being committed
19
+ # testsuite/results.json and docs/testsuite.md, generated by
20
+ # `sbml2cellml-testsuite run`, are larger than the 500 kB default
21
+ args: [ --maxkb=2000 ]
22
+ - id: check-merge-conflict
23
+ description: Check for files that contain merge conflict strings
24
+ - id: check-symlinks
25
+ description: Check for symlinks which do not point to anything
26
+ - id: trailing-whitespace
27
+ description: Trim trailing whitespaces
28
+ - id: end-of-file-fixer
29
+ description: Fix empty lines at ends of files
30
+ - id: detect-private-key
31
+ description: Detects the presence of private keys
32
+ - id: check-case-conflict
33
+ description: Check for names which conflict on case insensitive filesystems
34
+ - id: mixed-line-ending
35
+ description: Normalize mixed line endings
36
+ args: [ --fix=lf ]
37
+ - id: debug-statements
38
+ description: Check for forgotten breakpoints and debugger imports
39
+
40
+ - repo: https://github.com/astral-sh/ruff-pre-commit
41
+ # Ruff version.
42
+ rev: v0.16.6
43
+ hooks:
44
+ # Run the linter.
45
+ - id: ruff-check
46
+ types_or: [ python, pyi ]
47
+ args: [ --fix ]
48
+ # Run the formatter.
49
+ - id: ruff-format
50
+ types_or: [ python, pyi ]
51
+
52
+ - repo: https://github.com/astral-sh/ty-pre-commit
53
+ # ty version.
54
+ rev: v0.0.81
55
+ hooks:
56
+ # Run the type checker on the whole project (see `[tool.ty]` in pyproject.toml).
57
+ # `--extra dev` syncs the environment with the dev dependencies, so that the
58
+ # test imports (pytest) resolve.
59
+ - id: ty
60
+ args: [ --extra, dev ]
@@ -0,0 +1 @@
1
+ 3.13