pkpdsim 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.
- pkpdsim-0.1.0/.bumpversion.toml +35 -0
- pkpdsim-0.1.0/.gitattributes +3 -0
- pkpdsim-0.1.0/.github/CODEOWNERS +1 -0
- pkpdsim-0.1.0/.github/ISSUE_TEMPLATE/01-bug-report.md +49 -0
- pkpdsim-0.1.0/.github/ISSUE_TEMPLATE/02-question.md +16 -0
- pkpdsim-0.1.0/.github/ISSUE_TEMPLATE/03-feature-request.md +36 -0
- pkpdsim-0.1.0/.github/ISSUE_TEMPLATE/config.yml +2 -0
- pkpdsim-0.1.0/.github/actions/setup/action.yml +30 -0
- pkpdsim-0.1.0/.github/dependabot.yml +33 -0
- pkpdsim-0.1.0/.github/pull_request_template.md +12 -0
- pkpdsim-0.1.0/.github/rulesets/apply.sh +43 -0
- pkpdsim-0.1.0/.github/rulesets/develop.json +61 -0
- pkpdsim-0.1.0/.github/rulesets/main.json +22 -0
- pkpdsim-0.1.0/.github/rulesets/tags.json +16 -0
- pkpdsim-0.1.0/.github/workflows/ci-cd.yml +115 -0
- pkpdsim-0.1.0/.github/workflows/docs.yml +69 -0
- pkpdsim-0.1.0/.github/workflows/ruff.yml +40 -0
- pkpdsim-0.1.0/.github/workflows/ty.yml +38 -0
- pkpdsim-0.1.0/.gitignore +28 -0
- pkpdsim-0.1.0/.pre-commit-config.yaml +65 -0
- pkpdsim-0.1.0/.python-version +1 -0
- pkpdsim-0.1.0/.ruff.toml +72 -0
- pkpdsim-0.1.0/.zenodo.json +22 -0
- pkpdsim-0.1.0/CITATION.cff +21 -0
- pkpdsim-0.1.0/CLAUDE.md +68 -0
- pkpdsim-0.1.0/LICENSE +7 -0
- pkpdsim-0.1.0/PKG-INFO +116 -0
- pkpdsim-0.1.0/README.md +77 -0
- pkpdsim-0.1.0/docs/api/annotations.md +3 -0
- pkpdsim-0.1.0/docs/api/data.md +3 -0
- pkpdsim-0.1.0/docs/api/index.md +14 -0
- pkpdsim-0.1.0/docs/api/initial_values.md +3 -0
- pkpdsim-0.1.0/docs/api/licenses.md +3 -0
- pkpdsim-0.1.0/docs/api/pkpdsim.md +3 -0
- pkpdsim-0.1.0/docs/api/templates.md +3 -0
- pkpdsim-0.1.0/docs/data.md +65 -0
- pkpdsim-0.1.0/docs/development.md +238 -0
- pkpdsim-0.1.0/docs/index.md +55 -0
- pkpdsim-0.1.0/docs/initial_values.md +56 -0
- pkpdsim-0.1.0/docs/installation.md +59 -0
- pkpdsim-0.1.0/docs/licenses.md +53 -0
- pkpdsim-0.1.0/docs/robots.txt +9 -0
- pkpdsim-0.1.0/docs/templates.md +77 -0
- pkpdsim-0.1.0/pyproject.toml +88 -0
- pkpdsim-0.1.0/release-notes/0.1.0.md +16 -0
- pkpdsim-0.1.0/scripts/__init__.py +0 -0
- pkpdsim-0.1.0/scripts/llms_txt.py +295 -0
- pkpdsim-0.1.0/src/pkpdsim/__init__.py +21 -0
- pkpdsim-0.1.0/src/pkpdsim/annotations.py +219 -0
- pkpdsim-0.1.0/src/pkpdsim/data.py +103 -0
- pkpdsim-0.1.0/src/pkpdsim/initial_values.py +116 -0
- pkpdsim-0.1.0/src/pkpdsim/licenses.py +114 -0
- pkpdsim-0.1.0/src/pkpdsim/py.typed +0 -0
- pkpdsim-0.1.0/src/pkpdsim/resources/cc-by-sa-4.0.txt +428 -0
- pkpdsim-0.1.0/src/pkpdsim/resources/mit.txt +7 -0
- pkpdsim-0.1.0/src/pkpdsim/templates.py +52 -0
- pkpdsim-0.1.0/tests/conftest.py +29 -0
- pkpdsim-0.1.0/tests/docs/__init__.py +0 -0
- pkpdsim-0.1.0/tests/docs/test_snippets.py +97 -0
- pkpdsim-0.1.0/tests/test_data.py +139 -0
- pkpdsim-0.1.0/tests/test_initial_values.py +78 -0
- pkpdsim-0.1.0/tests/test_licenses.py +112 -0
- pkpdsim-0.1.0/tests/test_package.py +26 -0
- pkpdsim-0.1.0/tests/test_templates.py +101 -0
- pkpdsim-0.1.0/tox.ini +20 -0
- pkpdsim-0.1.0/uv.lock +1807 -0
- pkpdsim-0.1.0/zensical.toml +129 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[tool.bumpversion]
|
|
2
|
+
current_version = "0.1.0"
|
|
3
|
+
commit = true
|
|
4
|
+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.dev(?P<dev>\\d+))?"
|
|
5
|
+
serialize = ["{major}.{minor}.{patch}.dev{dev}", "{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} → {new_version}"
|
|
16
|
+
allow_dirty = false
|
|
17
|
+
message = "Bump version: {current_version} → {new_version}"
|
|
18
|
+
commit_args = ""
|
|
19
|
+
|
|
20
|
+
[tool.bumpversion.parts.dev]
|
|
21
|
+
optional_value = "final"
|
|
22
|
+
values = ["0", "final"]
|
|
23
|
+
|
|
24
|
+
[[tool.bumpversion.files]]
|
|
25
|
+
filename = "./src/pkpdsim/__init__.py"
|
|
26
|
+
|
|
27
|
+
[[tool.bumpversion.files]]
|
|
28
|
+
# only the version of the software: a bare search would also replace the
|
|
29
|
+
# `cff-version` of the file format whenever the two happen to be equal
|
|
30
|
+
filename = "./CITATION.cff"
|
|
31
|
+
search = 'version: "{current_version}"'
|
|
32
|
+
replace = 'version: "{new_version}"'
|
|
33
|
+
|
|
34
|
+
[[tool.bumpversion.files]]
|
|
35
|
+
filename = "./tests/test_package.py"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @matthiaskoenig
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a bug to help improve this project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!--
|
|
7
|
+
|
|
8
|
+
Before you create a new problem report, please look through the list of existing open
|
|
9
|
+
and closed issues to see if there are similar ones.
|
|
10
|
+
|
|
11
|
+
https://github.com/matthiaskoenig/pkpdsim/issues
|
|
12
|
+
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
#### Problem description
|
|
16
|
+
|
|
17
|
+
Please explain:
|
|
18
|
+
* **what** you tried to achieve,
|
|
19
|
+
* **how** you went about it (referring to the code sample), and
|
|
20
|
+
* **why** the current behaviour is a problem and what output
|
|
21
|
+
you expected instead.
|
|
22
|
+
|
|
23
|
+
#### Code Sample
|
|
24
|
+
|
|
25
|
+
Create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
|
|
26
|
+
|
|
27
|
+
<!-- Paste your code between the ``` tickmarks below or link to a gist. -->
|
|
28
|
+
```python
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<!-- If there was a crash, please include the traceback between the ``` tickmarks below. -->
|
|
32
|
+
```
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Context
|
|
36
|
+
|
|
37
|
+
<!-- Run the following code and paste the output between the ``` tickmarks below
|
|
38
|
+
inside the details block.
|
|
39
|
+
|
|
40
|
+
python -c "import sys, pkpdsim; print(sys.version, pkpdsim.__version__)"
|
|
41
|
+
|
|
42
|
+
-->
|
|
43
|
+
|
|
44
|
+
<details>
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</details>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Question
|
|
3
|
+
about: Ask a question
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
### Checklist
|
|
7
|
+
|
|
8
|
+
<!-- To help keep this issue tracker clean and focused, please make sure that you have
|
|
9
|
+
tried *all* of the following resources before submitting your question. -->
|
|
10
|
+
|
|
11
|
+
- [ ] I searched the [documentation](https://matthiaskoenig.github.io/pkpdsim).
|
|
12
|
+
- [ ] I looked through [similar issues on GitHub](https://github.com/matthiaskoenig/pkpdsim/issues).
|
|
13
|
+
|
|
14
|
+
### Question
|
|
15
|
+
|
|
16
|
+
<!-- Please ask your question here. -->
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
### Checklist
|
|
7
|
+
|
|
8
|
+
<!-- Please make sure you check all these items before submitting your feature request. -->
|
|
9
|
+
|
|
10
|
+
- [ ] There are [no similar issues or pull requests](https://github.com/matthiaskoenig/pkpdsim/issues) for this yet.
|
|
11
|
+
|
|
12
|
+
### Is your feature related to a problem? Please describe it.
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
A clear and concise description of what you are trying to achieve.
|
|
16
|
+
"I want to be able to [...] but I can't because [...]".
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
## Describe the solution you would like.
|
|
20
|
+
|
|
21
|
+
<!--
|
|
22
|
+
A clear and concise description of what you would want to happen.
|
|
23
|
+
For API changes, try to provide a code snippet of what you would like the new API to
|
|
24
|
+
look like.
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
## Describe alternatives you considered
|
|
28
|
+
|
|
29
|
+
<!--
|
|
30
|
+
Please describe any alternative solutions or features you've considered to solve
|
|
31
|
+
your problem and why they wouldn't solve it.
|
|
32
|
+
-->
|
|
33
|
+
|
|
34
|
+
## Additional context
|
|
35
|
+
|
|
36
|
+
<!-- Provide any additional context, screenshots, tracebacks, etc. about the feature here. -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Set up uv and python
|
|
2
|
+
description: >-
|
|
3
|
+
Install uv with its cache, set the python version of the job and put the
|
|
4
|
+
libpython of the interpreter on the library search path
|
|
5
|
+
inputs:
|
|
6
|
+
python-version:
|
|
7
|
+
description: the python version, e.g. 3.14
|
|
8
|
+
required: true
|
|
9
|
+
runs:
|
|
10
|
+
using: composite
|
|
11
|
+
steps:
|
|
12
|
+
- name: Install uv and set the python version
|
|
13
|
+
# astral-sh/setup-uv publishes no floating major tag beyond v7
|
|
14
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
15
|
+
with:
|
|
16
|
+
python-version: ${{ inputs.python-version }}
|
|
17
|
+
enable-cache: true
|
|
18
|
+
- name: Put libpython on the library search path (linux only)
|
|
19
|
+
# the extension of libroadrunner links against libpython. The standalone
|
|
20
|
+
# interpreters uv installs link it statically and ship it in their `lib`,
|
|
21
|
+
# where the loader does not look; without it the import of roadrunner
|
|
22
|
+
# fails with `libpython3.14.so.1.0: cannot open shared object file`
|
|
23
|
+
if: runner.os == 'Linux'
|
|
24
|
+
shell: bash
|
|
25
|
+
env:
|
|
26
|
+
PYTHON_VERSION: ${{ inputs.python-version }}
|
|
27
|
+
run: |
|
|
28
|
+
prefix=$(uv run --no-project --python "$PYTHON_VERSION" python -c "import sys; print(sys.base_prefix)")
|
|
29
|
+
echo "LD_LIBRARY_PATH=$prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
|
|
30
|
+
echo "libpython: $(ls "$prefix"/lib/libpython*.so.1.0)"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Keep the GitHub Actions used in the workflows and the locked python dependencies 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"
|
|
17
|
+
|
|
18
|
+
# the locked python dependencies (uv.lock), bumped together
|
|
19
|
+
- package-ecosystem: "uv"
|
|
20
|
+
directory: "/"
|
|
21
|
+
# only uv.lock is updated: the default would raise the lower bounds in
|
|
22
|
+
# pyproject.toml, which are what a user of the library installs against,
|
|
23
|
+
# so they are only ever changed by hand
|
|
24
|
+
versioning-strategy: lockfile-only
|
|
25
|
+
schedule:
|
|
26
|
+
interval: "weekly"
|
|
27
|
+
groups:
|
|
28
|
+
python-dependencies:
|
|
29
|
+
patterns:
|
|
30
|
+
- "*"
|
|
31
|
+
open-pull-requests-limit: 5
|
|
32
|
+
commit-message:
|
|
33
|
+
prefix: "build"
|
|
@@ -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,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Apply the repository policies of pkpdsim: the merge settings of the
|
|
4
|
+
# repository and the rulesets in this directory. The script is idempotent, i.e.,
|
|
5
|
+
# a ruleset which already exists is updated instead of added a second time, so
|
|
6
|
+
# it can be run again after every change of the json files.
|
|
7
|
+
#
|
|
8
|
+
# The file name of a ruleset has to match the "name" in the json. A ruleset which
|
|
9
|
+
# is removed from this directory stays on the repository, delete it with
|
|
10
|
+
# `gh api -X DELETE repos/<owner>/<repo>/rulesets/<id>`.
|
|
11
|
+
#
|
|
12
|
+
# Requires the github cli (https://cli.github.com) authenticated as a user with
|
|
13
|
+
# admin permission on the repository:
|
|
14
|
+
#
|
|
15
|
+
# gh auth login
|
|
16
|
+
# .github/rulesets/apply.sh [owner/repo]
|
|
17
|
+
#
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
REPO="${1:-matthiaskoenig/pkpdsim}"
|
|
21
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
22
|
+
|
|
23
|
+
echo "repository settings of ${REPO}"
|
|
24
|
+
gh api -X PATCH "repos/${REPO}" \
|
|
25
|
+
-F allow_auto_merge=true \
|
|
26
|
+
-F delete_branch_on_merge=true \
|
|
27
|
+
-F allow_update_branch=true \
|
|
28
|
+
-F allow_squash_merge=true \
|
|
29
|
+
-F allow_rebase_merge=true \
|
|
30
|
+
-F allow_merge_commit=false \
|
|
31
|
+
--silent
|
|
32
|
+
|
|
33
|
+
for path in "${DIR}"/*.json; do
|
|
34
|
+
name="$(basename "${path}" .json)"
|
|
35
|
+
id="$(gh api "repos/${REPO}/rulesets" --jq "map(select(.name == \"${name}\")) | .[0].id // empty")"
|
|
36
|
+
if [[ -n "${id}" ]]; then
|
|
37
|
+
gh api -X PUT "repos/${REPO}/rulesets/${id}" --input "${path}" --silent
|
|
38
|
+
echo "ruleset ${name} updated (${id})"
|
|
39
|
+
else
|
|
40
|
+
id="$(gh api -X POST "repos/${REPO}/rulesets" --input "${path}" --jq .id)"
|
|
41
|
+
echo "ruleset ${name} created (${id})"
|
|
42
|
+
fi
|
|
43
|
+
done
|
|
@@ -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,115 @@
|
|
|
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", "3.14"]
|
|
30
|
+
# linux covers the full range, windows and macos only the newest version
|
|
31
|
+
exclude:
|
|
32
|
+
- os: windows-latest
|
|
33
|
+
python-version: "3.13"
|
|
34
|
+
- os: macos-latest
|
|
35
|
+
python-version: "3.13"
|
|
36
|
+
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v7
|
|
39
|
+
with:
|
|
40
|
+
persist-credentials: false
|
|
41
|
+
- name: Set up uv and python
|
|
42
|
+
uses: ./.github/actions/setup
|
|
43
|
+
with:
|
|
44
|
+
python-version: ${{ matrix.python-version }}
|
|
45
|
+
- name: Test with tox
|
|
46
|
+
run:
|
|
47
|
+
uvx --with tox-uv tox -e py${{ matrix.python-version }}
|
|
48
|
+
|
|
49
|
+
tests:
|
|
50
|
+
# the one check the branch protection requires; the names of the matrix
|
|
51
|
+
# jobs change with the matrix, this name does not, see .github/rulesets/
|
|
52
|
+
name: tests
|
|
53
|
+
needs: test
|
|
54
|
+
if: always()
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
timeout-minutes: 5
|
|
57
|
+
steps:
|
|
58
|
+
- name: Check the result of the test matrix
|
|
59
|
+
env:
|
|
60
|
+
RESULT: ${{ needs.test.result }}
|
|
61
|
+
run: |
|
|
62
|
+
echo "test matrix: $RESULT"
|
|
63
|
+
test "$RESULT" = "success"
|
|
64
|
+
|
|
65
|
+
release:
|
|
66
|
+
needs: tests
|
|
67
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
timeout-minutes: 20
|
|
70
|
+
environment:
|
|
71
|
+
name: pypi
|
|
72
|
+
url: https://pypi.org/p/pkpdsim
|
|
73
|
+
permissions:
|
|
74
|
+
id-token: write # trusted publishing to PyPI
|
|
75
|
+
contents: write # create the GitHub release
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v7
|
|
78
|
+
with:
|
|
79
|
+
persist-credentials: false
|
|
80
|
+
- name: Install uv
|
|
81
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
82
|
+
with:
|
|
83
|
+
python-version: "3.14"
|
|
84
|
+
enable-cache: true
|
|
85
|
+
- name: Build package
|
|
86
|
+
run: uvx hatch build
|
|
87
|
+
- name: Check the package
|
|
88
|
+
run: uvx twine check dist/*
|
|
89
|
+
- name: Publish to PyPI
|
|
90
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
91
|
+
with:
|
|
92
|
+
packages-dir: dist
|
|
93
|
+
- name: Create GitHub release
|
|
94
|
+
uses: softprops/action-gh-release@v3
|
|
95
|
+
with:
|
|
96
|
+
body_path: "release-notes/${{ github.ref_name }}.md"
|
|
97
|
+
draft: false
|
|
98
|
+
prerelease: false
|
|
99
|
+
|
|
100
|
+
sync-main:
|
|
101
|
+
# main tracks the latest published release, see docs/development.md
|
|
102
|
+
needs: release
|
|
103
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
timeout-minutes: 5
|
|
106
|
+
permissions:
|
|
107
|
+
contents: write # fast-forward main to the released commit
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/checkout@v7
|
|
110
|
+
with:
|
|
111
|
+
# a shallow clone cannot be pushed to another branch
|
|
112
|
+
fetch-depth: 0
|
|
113
|
+
- name: Fast-forward main to the release
|
|
114
|
+
# no --force: the push fails loudly if it would not be a fast-forward
|
|
115
|
+
run: git push origin HEAD:main
|
|
@@ -0,0 +1,69 @@
|
|
|
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: Set up uv and python
|
|
33
|
+
# libpython on the library search path, the agent files import the
|
|
34
|
+
# modules and with them libroadrunner
|
|
35
|
+
uses: ./.github/actions/setup
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.14"
|
|
38
|
+
- name: Install the locked dependencies (fails if uv.lock is out of date with pyproject.toml, run `uv lock`)
|
|
39
|
+
# `--locked` refuses to update the lock: a change of the dependencies
|
|
40
|
+
# in pyproject.toml has to come with the `uv lock` which records it
|
|
41
|
+
run: uv sync --locked --extra dev
|
|
42
|
+
- name: Build the documentation
|
|
43
|
+
# the API reference is rendered from the docstrings by mkdocstrings,
|
|
44
|
+
# so the package has to be importable
|
|
45
|
+
run: uv run zensical build --clean --strict
|
|
46
|
+
- name: Generate the agent facing files
|
|
47
|
+
# llms.txt, llms-full.txt and the markdown of every page
|
|
48
|
+
run: uv run python scripts/llms_txt.py
|
|
49
|
+
- name: Upload the site
|
|
50
|
+
uses: actions/upload-pages-artifact@v5
|
|
51
|
+
with:
|
|
52
|
+
path: site
|
|
53
|
+
|
|
54
|
+
deploy:
|
|
55
|
+
needs: docs
|
|
56
|
+
# only the default branch publishes to https://matthiaskoenig.github.io/pkpdsim
|
|
57
|
+
if: github.ref == 'refs/heads/develop'
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
timeout-minutes: 10
|
|
60
|
+
permissions:
|
|
61
|
+
pages: write # deploy to GitHub Pages
|
|
62
|
+
id-token: write # verify the deployment originates from this workflow
|
|
63
|
+
environment:
|
|
64
|
+
name: github-pages
|
|
65
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
66
|
+
steps:
|
|
67
|
+
- name: Deploy to GitHub Pages
|
|
68
|
+
id: deployment
|
|
69
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,40 @@
|
|
|
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 lock (the same file `uv run ruff` uses locally), not from the
|
|
29
|
+
# `ruff>=` bound in pyproject.toml, which would resolve to the latest release
|
|
30
|
+
- name: Lint
|
|
31
|
+
# astral-sh/ruff-action publishes no floating major tag beyond v3
|
|
32
|
+
uses: astral-sh/ruff-action@v4.1.0
|
|
33
|
+
with:
|
|
34
|
+
version-file: uv.lock
|
|
35
|
+
args: check --output-format=github
|
|
36
|
+
- name: Format
|
|
37
|
+
uses: astral-sh/ruff-action@v4.1.0
|
|
38
|
+
with:
|
|
39
|
+
version-file: uv.lock
|
|
40
|
+
args: format --check --diff
|
|
@@ -0,0 +1,38 @@
|
|
|
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 uv and set the python version
|
|
29
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.14"
|
|
32
|
+
enable-cache: true
|
|
33
|
+
- name: Type check with tox
|
|
34
|
+
env:
|
|
35
|
+
# render diagnostics as GitHub Actions workflow annotations
|
|
36
|
+
TY_OUTPUT_FORMAT: github
|
|
37
|
+
run:
|
|
38
|
+
uvx --with tox-uv tox -e ty
|
pkpdsim-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
|
|
5
|
+
# packaging artifacts (hatchling builds into dist/)
|
|
6
|
+
dist/
|
|
7
|
+
*.egg-info/
|
|
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
|
+
|
|
19
|
+
# rendered documentation, built by the `documentation` workflow
|
|
20
|
+
site/
|
|
21
|
+
|
|
22
|
+
# editors, operating system
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
|
25
|
+
*~
|
|
26
|
+
.DS_Store
|
|
27
|
+
.ipynb_checkpoints/
|
|
28
|
+
.superpowers/
|