fair-ca-visualization 0.4.1__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.
- fair_ca_visualization-0.4.1/.bumpversion.toml +45 -0
- fair_ca_visualization-0.4.1/.editorconfig +20 -0
- fair_ca_visualization-0.4.1/.github/CODEOWNERS +2 -0
- fair_ca_visualization-0.4.1/.github/ISSUE_TEMPLATE/01-bug-report.md +21 -0
- fair_ca_visualization-0.4.1/.github/ISSUE_TEMPLATE/02-question.md +9 -0
- fair_ca_visualization-0.4.1/.github/ISSUE_TEMPLATE/03-feature-request.md +11 -0
- fair_ca_visualization-0.4.1/.github/ISSUE_TEMPLATE/config.yml +5 -0
- fair_ca_visualization-0.4.1/.github/dependabot.yml +47 -0
- fair_ca_visualization-0.4.1/.github/pull_request_template.md +12 -0
- fair_ca_visualization-0.4.1/.github/rulesets/apply.sh +76 -0
- fair_ca_visualization-0.4.1/.github/rulesets/develop.json +42 -0
- fair_ca_visualization-0.4.1/.github/rulesets/main.json +17 -0
- fair_ca_visualization-0.4.1/.github/rulesets/tag-creation.json +17 -0
- fair_ca_visualization-0.4.1/.github/rulesets/tags.json +16 -0
- fair_ca_visualization-0.4.1/.github/workflows/ci-cd.yml +193 -0
- fair_ca_visualization-0.4.1/.github/workflows/docs.yml +72 -0
- fair_ca_visualization-0.4.1/.github/workflows/ruff.yml +39 -0
- fair_ca_visualization-0.4.1/.github/workflows/ty.yml +43 -0
- fair_ca_visualization-0.4.1/.gitignore +43 -0
- fair_ca_visualization-0.4.1/.pre-commit-config.yaml +57 -0
- fair_ca_visualization-0.4.1/.python-version +1 -0
- fair_ca_visualization-0.4.1/.ruff.toml +41 -0
- fair_ca_visualization-0.4.1/.streamlit/config.toml +5 -0
- fair_ca_visualization-0.4.1/.zenodo.json +21 -0
- fair_ca_visualization-0.4.1/AGENTS.md +46 -0
- fair_ca_visualization-0.4.1/CITATION.cff +22 -0
- fair_ca_visualization-0.4.1/CLAUDE.md +1 -0
- fair_ca_visualization-0.4.1/LICENSE +7 -0
- fair_ca_visualization-0.4.1/PKG-INFO +84 -0
- fair_ca_visualization-0.4.1/README.md +51 -0
- fair_ca_visualization-0.4.1/docs/README.md +3 -0
- fair_ca_visualization-0.4.1/docs/adding-assessments.md +14 -0
- fair_ca_visualization-0.4.1/docs/api/cli.md +3 -0
- fair_ca_visualization-0.4.1/docs/api/console.md +3 -0
- fair_ca_visualization-0.4.1/docs/api/data_io.md +3 -0
- fair_ca_visualization-0.4.1/docs/api/index.md +19 -0
- fair_ca_visualization-0.4.1/docs/api/settings.md +3 -0
- fair_ca_visualization-0.4.1/docs/api/visualization.md +3 -0
- fair_ca_visualization-0.4.1/docs/assessment.md +34 -0
- fair_ca_visualization-0.4.1/docs/development.md +132 -0
- fair_ca_visualization-0.4.1/docs/images/fair-ca-example.png +0 -0
- fair_ca_visualization-0.4.1/docs/images/fair-ca-logo.png +0 -0
- fair_ca_visualization-0.4.1/docs/images/favicon/fair-ca-100x100.png +0 -0
- fair_ca_visualization-0.4.1/docs/images/favicon/favicon.ico +0 -0
- fair_ca_visualization-0.4.1/docs/index.md +40 -0
- fair_ca_visualization-0.4.1/docs/installation.md +43 -0
- fair_ca_visualization-0.4.1/docs/robots.txt +7 -0
- fair_ca_visualization-0.4.1/docs/stylesheets/extra.css +8 -0
- fair_ca_visualization-0.4.1/docs/usage.md +27 -0
- fair_ca_visualization-0.4.1/pyproject.toml +97 -0
- fair_ca_visualization-0.4.1/release-notes/0.1.0.md +10 -0
- fair_ca_visualization-0.4.1/release-notes/0.1.1.md +11 -0
- fair_ca_visualization-0.4.1/release-notes/0.1.2.md +11 -0
- fair_ca_visualization-0.4.1/release-notes/0.2.0.md +12 -0
- fair_ca_visualization-0.4.1/release-notes/0.3.0.md +12 -0
- fair_ca_visualization-0.4.1/release-notes/0.4.0.md +26 -0
- fair_ca_visualization-0.4.1/release-notes/0.4.1.md +15 -0
- fair_ca_visualization-0.4.1/run_app.sh +1 -0
- fair_ca_visualization-0.4.1/scripts/llms_txt.py +295 -0
- fair_ca_visualization-0.4.1/scripts/smoke_test.sh +48 -0
- fair_ca_visualization-0.4.1/src/fairvis/__init__.py +4 -0
- fair_ca_visualization-0.4.1/src/fairvis/__main__.py +6 -0
- fair_ca_visualization-0.4.1/src/fairvis/app.py +208 -0
- fair_ca_visualization-0.4.1/src/fairvis/cli.py +46 -0
- fair_ca_visualization-0.4.1/src/fairvis/console.py +17 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/FAIR_assessment_template.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Alejandro2026_empagliflozin.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/BioModels_C19_curated.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/BioModels_curated.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/BioModels_non_curated.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Casabianca2026_rivaroxaban.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Elias2025_glimepiride.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Nemitz2026_dapagliflozin.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/PMR_curated.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/PMR_non_curated.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Tensil2026_losartan.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data/assessments/Tereshchuk2026_canagliflozin.xlsx +0 -0
- fair_ca_visualization-0.4.1/src/fairvis/data_io.py +163 -0
- fair_ca_visualization-0.4.1/src/fairvis/example.py +10 -0
- fair_ca_visualization-0.4.1/src/fairvis/settings.py +18 -0
- fair_ca_visualization-0.4.1/src/fairvis/visualization.py +109 -0
- fair_ca_visualization-0.4.1/tests/conftest.py +28 -0
- fair_ca_visualization-0.4.1/tests/test_app.py +29 -0
- fair_ca_visualization-0.4.1/tests/test_citation.py +30 -0
- fair_ca_visualization-0.4.1/tests/test_cli.py +66 -0
- fair_ca_visualization-0.4.1/tests/test_data_io.py +125 -0
- fair_ca_visualization-0.4.1/tests/test_package.py +26 -0
- fair_ca_visualization-0.4.1/tests/test_settings.py +18 -0
- fair_ca_visualization-0.4.1/tests/test_visualization.py +28 -0
- fair_ca_visualization-0.4.1/uv.lock +1598 -0
- fair_ca_visualization-0.4.1/zensical.toml +136 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[tool.bumpversion]
|
|
2
|
+
current_version = "0.4.1"
|
|
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 = "./pyproject.toml"
|
|
22
|
+
search = 'version = "{current_version}"'
|
|
23
|
+
replace = 'version = "{new_version}"'
|
|
24
|
+
|
|
25
|
+
[[tool.bumpversion.files]]
|
|
26
|
+
filename = "./uv.lock"
|
|
27
|
+
search = """
|
|
28
|
+
name = "fair-ca-visualization"
|
|
29
|
+
version = "{current_version}"
|
|
30
|
+
"""
|
|
31
|
+
replace = """
|
|
32
|
+
name = "fair-ca-visualization"
|
|
33
|
+
version = "{new_version}"
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
[[tool.bumpversion.files]]
|
|
37
|
+
filename = "./src/fairvis/__init__.py"
|
|
38
|
+
|
|
39
|
+
[[tool.bumpversion.files]]
|
|
40
|
+
filename = "./CITATION.cff"
|
|
41
|
+
search = 'version: "{current_version}"'
|
|
42
|
+
replace = 'version: "{new_version}"'
|
|
43
|
+
|
|
44
|
+
[[tool.bumpversion.files]]
|
|
45
|
+
filename = "./tests/test_package.py"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Editor Configuration (http://editorconfig.org)
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
max_line_length = 88
|
|
12
|
+
|
|
13
|
+
[*.{json,yml}]
|
|
14
|
+
indent_size = 2
|
|
15
|
+
|
|
16
|
+
[*.{md,rst}]
|
|
17
|
+
trim_trailing_whitespace = false
|
|
18
|
+
|
|
19
|
+
[Makefile]
|
|
20
|
+
indent_style = tab
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something in the app or the package does not work as expected
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**What happened**
|
|
8
|
+
|
|
9
|
+
<!-- what you did and what you saw, e.g., the error message -->
|
|
10
|
+
|
|
11
|
+
**What you expected**
|
|
12
|
+
|
|
13
|
+
**How to reproduce**
|
|
14
|
+
|
|
15
|
+
<!-- the steps, and the assessment file if an upload is involved -->
|
|
16
|
+
|
|
17
|
+
**Environment**
|
|
18
|
+
|
|
19
|
+
- app at faircombine.streamlit.app or local installation:
|
|
20
|
+
- version of fair-ca-visualization (`pip show fair-ca-visualization`):
|
|
21
|
+
- operating system and browser:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Keep the GitHub Actions, the locked python dependencies and the pre-commit hooks 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
|
+
target-branch: "develop"
|
|
8
|
+
schedule:
|
|
9
|
+
interval: "monthly"
|
|
10
|
+
# a single pull request for all action updates instead of one per action
|
|
11
|
+
groups:
|
|
12
|
+
github-actions:
|
|
13
|
+
patterns:
|
|
14
|
+
- "*"
|
|
15
|
+
open-pull-requests-limit: 5
|
|
16
|
+
commit-message:
|
|
17
|
+
prefix: "ci"
|
|
18
|
+
|
|
19
|
+
# the locked python dependencies (uv.lock), which Streamlit Community Cloud installs
|
|
20
|
+
- package-ecosystem: "uv"
|
|
21
|
+
directory: "/"
|
|
22
|
+
target-branch: "develop"
|
|
23
|
+
# only uv.lock is updated, the lower bounds in pyproject.toml are changed by hand
|
|
24
|
+
versioning-strategy: lockfile-only
|
|
25
|
+
schedule:
|
|
26
|
+
interval: "monthly"
|
|
27
|
+
groups:
|
|
28
|
+
python-dependencies:
|
|
29
|
+
patterns:
|
|
30
|
+
- "*"
|
|
31
|
+
open-pull-requests-limit: 5
|
|
32
|
+
commit-message:
|
|
33
|
+
prefix: "build"
|
|
34
|
+
|
|
35
|
+
# the hook revisions in .pre-commit-config.yaml (ruff and ty are also locked in uv.lock, see the ruff workflow)
|
|
36
|
+
- package-ecosystem: "pre-commit"
|
|
37
|
+
directory: "/"
|
|
38
|
+
target-branch: "develop"
|
|
39
|
+
schedule:
|
|
40
|
+
interval: "monthly"
|
|
41
|
+
groups:
|
|
42
|
+
pre-commit-hooks:
|
|
43
|
+
patterns:
|
|
44
|
+
- "*"
|
|
45
|
+
open-pull-requests-limit: 5
|
|
46
|
+
commit-message:
|
|
47
|
+
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
|
+
- [ ] `uv run pytest -n auto` and `uv run ty check` pass locally
|
|
10
|
+
- [ ] `ruff check` and `ruff format` are clean, e.g., via `uv run 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,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Apply the repository policies of fair-ca-visualization: the settings of the
|
|
4
|
+
# repository, the deployment branches of its environments and the rulesets in
|
|
5
|
+
# this directory. 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/fair-ca-visualization}"
|
|
22
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
23
|
+
|
|
24
|
+
echo "repository settings of ${REPO}"
|
|
25
|
+
gh api -X PATCH "repos/${REPO}" \
|
|
26
|
+
-f default_branch=develop \
|
|
27
|
+
-F allow_auto_merge=true \
|
|
28
|
+
-F delete_branch_on_merge=true \
|
|
29
|
+
-F allow_update_branch=true \
|
|
30
|
+
-F allow_squash_merge=true \
|
|
31
|
+
-F allow_rebase_merge=true \
|
|
32
|
+
-F allow_merge_commit=false \
|
|
33
|
+
--silent
|
|
34
|
+
|
|
35
|
+
# add a deployment branch or tag policy to an environment unless it exists
|
|
36
|
+
ensure_policy() {
|
|
37
|
+
local environment="$1" name="$2" type="$3"
|
|
38
|
+
gh api -X PUT "repos/${REPO}/environments/${environment}" --silent --input - <<'JSON'
|
|
39
|
+
{"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}}
|
|
40
|
+
JSON
|
|
41
|
+
local policies
|
|
42
|
+
policies="$(gh api "repos/${REPO}/environments/${environment}/deployment-branch-policies" \
|
|
43
|
+
--jq ".branch_policies[] | select(.type == \"${type}\") | .name")"
|
|
44
|
+
if grep -qxF "${name}" <<<"${policies}"; then
|
|
45
|
+
echo "environment ${environment}: ${type} ${name} may deploy"
|
|
46
|
+
else
|
|
47
|
+
gh api -X POST "repos/${REPO}/environments/${environment}/deployment-branch-policies" \
|
|
48
|
+
-f name="${name}" -f type="${type}" --silent
|
|
49
|
+
echo "environment ${environment}: ${type} ${name} may deploy (added)"
|
|
50
|
+
fi
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# GitHub Pages is built by the documentation workflow, not from a branch
|
|
54
|
+
if gh api "repos/${REPO}/pages" --silent 2>/dev/null; then
|
|
55
|
+
gh api -X PUT "repos/${REPO}/pages" -f build_type=workflow --silent
|
|
56
|
+
else
|
|
57
|
+
gh api -X POST "repos/${REPO}/pages" -f build_type=workflow --silent
|
|
58
|
+
fi
|
|
59
|
+
echo "GitHub Pages built by GitHub Actions"
|
|
60
|
+
|
|
61
|
+
# the documentation workflow deploys from develop
|
|
62
|
+
ensure_policy github-pages develop branch
|
|
63
|
+
# the release workflow publishes to PyPI from a tag
|
|
64
|
+
ensure_policy pypi '*' tag
|
|
65
|
+
|
|
66
|
+
for path in "${DIR}"/*.json; do
|
|
67
|
+
name="$(basename "${path}" .json)"
|
|
68
|
+
id="$(gh api "repos/${REPO}/rulesets" --jq "map(select(.name == \"${name}\")) | .[0].id // empty")"
|
|
69
|
+
if [[ -n "${id}" ]]; then
|
|
70
|
+
gh api -X PUT "repos/${REPO}/rulesets/${id}" --input "${path}" --silent
|
|
71
|
+
echo "ruleset ${name} updated (${id})"
|
|
72
|
+
else
|
|
73
|
+
id="$(gh api -X POST "repos/${REPO}/rulesets" --input "${path}" --jq .id)"
|
|
74
|
+
echo "ruleset ${name} created (${id})"
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "develop",
|
|
3
|
+
"target": "branch",
|
|
4
|
+
"enforcement": "active",
|
|
5
|
+
"bypass_actors": [],
|
|
6
|
+
"conditions": {
|
|
7
|
+
"ref_name": {
|
|
8
|
+
"include": ["refs/heads/develop"],
|
|
9
|
+
"exclude": []
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"rules": [
|
|
13
|
+
{"type": "deletion"},
|
|
14
|
+
{"type": "non_fast_forward"},
|
|
15
|
+
{"type": "required_linear_history"},
|
|
16
|
+
{
|
|
17
|
+
"type": "pull_request",
|
|
18
|
+
"parameters": {
|
|
19
|
+
"required_approving_review_count": 0,
|
|
20
|
+
"dismiss_stale_reviews_on_push": true,
|
|
21
|
+
"require_code_owner_review": false,
|
|
22
|
+
"require_last_push_approval": false,
|
|
23
|
+
"required_review_thread_resolution": true,
|
|
24
|
+
"allowed_merge_methods": ["squash", "rebase"],
|
|
25
|
+
"require_extra_approval_for_unattributed_changes": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "required_status_checks",
|
|
30
|
+
"parameters": {
|
|
31
|
+
"strict_required_status_checks_policy": false,
|
|
32
|
+
"do_not_enforce_on_create": false,
|
|
33
|
+
"required_status_checks": [
|
|
34
|
+
{"context": "tests"},
|
|
35
|
+
{"context": "ruff"},
|
|
36
|
+
{"context": "ty"},
|
|
37
|
+
{"context": "docs"}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "main",
|
|
3
|
+
"target": "branch",
|
|
4
|
+
"enforcement": "active",
|
|
5
|
+
"bypass_actors": [],
|
|
6
|
+
"conditions": {
|
|
7
|
+
"ref_name": {
|
|
8
|
+
"include": ["refs/heads/main"],
|
|
9
|
+
"exclude": []
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"rules": [
|
|
13
|
+
{"type": "deletion"},
|
|
14
|
+
{"type": "non_fast_forward"},
|
|
15
|
+
{"type": "required_linear_history"}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tag-creation",
|
|
3
|
+
"target": "tag",
|
|
4
|
+
"enforcement": "active",
|
|
5
|
+
"bypass_actors": [
|
|
6
|
+
{"actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always"}
|
|
7
|
+
],
|
|
8
|
+
"conditions": {
|
|
9
|
+
"ref_name": {
|
|
10
|
+
"include": ["~ALL"],
|
|
11
|
+
"exclude": []
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"rules": [
|
|
15
|
+
{"type": "creation"}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -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,193 @@
|
|
|
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 and sync jobs raise what they need
|
|
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
|
+
env:
|
|
22
|
+
# the tools run with uvx are pinned, dependabot does not update them
|
|
23
|
+
TWINE_VERSION: "7.0.0"
|
|
24
|
+
# the standalone interpreters uv manages, not the ones of the runner image
|
|
25
|
+
UV_PYTHON_PREFERENCE: only-managed
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
test:
|
|
29
|
+
runs-on: ${{ matrix.os }}
|
|
30
|
+
timeout-minutes: 30
|
|
31
|
+
strategy:
|
|
32
|
+
fail-fast: false
|
|
33
|
+
matrix:
|
|
34
|
+
# the app runs on the one python version of .python-version; the
|
|
35
|
+
# platforms are those of the users who install the package locally
|
|
36
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
37
|
+
python-version: ["3.14"]
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
41
|
+
with:
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
- name: Install uv and set the python version
|
|
44
|
+
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
|
|
45
|
+
with:
|
|
46
|
+
version: "0.12.21"
|
|
47
|
+
python-version: ${{ matrix.python-version }}
|
|
48
|
+
# a release run restores no cache, which zizmor cannot tell from the
|
|
49
|
+
# expression; the distributions are built without one, see `package`
|
|
50
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
51
|
+
- name: Install the locked dependencies (fails if uv.lock is out of date with pyproject.toml, run `uv lock`)
|
|
52
|
+
# the environment Streamlit Community Cloud installs, from the same uv.lock
|
|
53
|
+
run: uv sync --locked
|
|
54
|
+
- name: Test
|
|
55
|
+
# the tests run on every core, the slowest are listed so they stay visible
|
|
56
|
+
run: uv run pytest -n auto --durations=15
|
|
57
|
+
|
|
58
|
+
package:
|
|
59
|
+
# builds the distributions and runs the app from the installed wheel; on a
|
|
60
|
+
# tag the distributions are the ones published, see `publish`
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
timeout-minutes: 15
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
65
|
+
with:
|
|
66
|
+
# the history of develop, a release tag has to be on it
|
|
67
|
+
fetch-depth: 0
|
|
68
|
+
persist-credentials: false
|
|
69
|
+
- name: Install uv
|
|
70
|
+
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
|
|
71
|
+
with:
|
|
72
|
+
version: "0.12.21"
|
|
73
|
+
python-version: "3.14"
|
|
74
|
+
# a release is built from a clean state, never from a restored cache
|
|
75
|
+
enable-cache: false
|
|
76
|
+
- name: Check the release
|
|
77
|
+
# the tagged commit is on develop, otherwise `sync-main` would move main
|
|
78
|
+
# off develop; the tag, the version of the package and the citation agree,
|
|
79
|
+
# and the release notes exist; checked before anything is published
|
|
80
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
81
|
+
env:
|
|
82
|
+
TAG: ${{ github.ref_name }}
|
|
83
|
+
run: |
|
|
84
|
+
git merge-base --is-ancestor "${GITHUB_SHA}" origin/develop
|
|
85
|
+
grep -qx "__version__ = \"${TAG}\"" src/fairvis/__init__.py
|
|
86
|
+
grep -qx "version: \"${TAG}\"" CITATION.cff
|
|
87
|
+
test -f "release-notes/${TAG}.md"
|
|
88
|
+
- name: Build the package
|
|
89
|
+
# --no-sources: built the way a user builds it, without uv specific sources
|
|
90
|
+
run: uv build --no-sources
|
|
91
|
+
- name: Check the package
|
|
92
|
+
run: uvx "twine@${TWINE_VERSION}" check --strict dist/*
|
|
93
|
+
- name: Run the app from the installed wheel
|
|
94
|
+
run: scripts/smoke_test.sh dist/*.whl
|
|
95
|
+
- name: Upload the distributions
|
|
96
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
97
|
+
with:
|
|
98
|
+
name: dist
|
|
99
|
+
path: dist/
|
|
100
|
+
if-no-files-found: error
|
|
101
|
+
|
|
102
|
+
tests:
|
|
103
|
+
# the one check the branch protection requires; the names of the matrix
|
|
104
|
+
# jobs change with the matrix, this name does not
|
|
105
|
+
name: tests
|
|
106
|
+
needs: [test, package]
|
|
107
|
+
if: always()
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
timeout-minutes: 5
|
|
110
|
+
steps:
|
|
111
|
+
- name: Check the results of the tests and the package
|
|
112
|
+
env:
|
|
113
|
+
TEST: ${{ needs.test.result }}
|
|
114
|
+
PACKAGE: ${{ needs.package.result }}
|
|
115
|
+
run: |
|
|
116
|
+
echo "test matrix: $TEST, package: $PACKAGE"
|
|
117
|
+
test "$TEST" = "success"
|
|
118
|
+
test "$PACKAGE" = "success"
|
|
119
|
+
|
|
120
|
+
publish:
|
|
121
|
+
# the only job which can publish to PyPI, by trusted publishing through the
|
|
122
|
+
# `pypi` environment; nothing is checked out and nothing is built here
|
|
123
|
+
needs: tests
|
|
124
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
125
|
+
runs-on: ubuntu-latest
|
|
126
|
+
timeout-minutes: 10
|
|
127
|
+
environment:
|
|
128
|
+
name: pypi
|
|
129
|
+
url: https://pypi.org/p/fair-ca-visualization
|
|
130
|
+
permissions:
|
|
131
|
+
id-token: write # trusted publishing to PyPI
|
|
132
|
+
steps:
|
|
133
|
+
- name: Download the distributions
|
|
134
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
135
|
+
with:
|
|
136
|
+
name: dist
|
|
137
|
+
path: dist/
|
|
138
|
+
- name: Publish to PyPI
|
|
139
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
140
|
+
with:
|
|
141
|
+
packages-dir: dist/
|
|
142
|
+
# PEP 740 attestations, signed with the identity of this workflow
|
|
143
|
+
attestations: true
|
|
144
|
+
|
|
145
|
+
github-release:
|
|
146
|
+
# created once the package is on PyPI; Zenodo archives the release
|
|
147
|
+
needs: publish
|
|
148
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
149
|
+
runs-on: ubuntu-latest
|
|
150
|
+
timeout-minutes: 5
|
|
151
|
+
permissions:
|
|
152
|
+
contents: write # create the GitHub release
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
155
|
+
with:
|
|
156
|
+
persist-credentials: false
|
|
157
|
+
- name: Download the distributions
|
|
158
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
159
|
+
with:
|
|
160
|
+
name: dist
|
|
161
|
+
path: dist/
|
|
162
|
+
- name: Create GitHub release
|
|
163
|
+
# the GitHub cli of the runner, no third party action gets write access
|
|
164
|
+
env:
|
|
165
|
+
GH_TOKEN: ${{ github.token }}
|
|
166
|
+
TAG: ${{ github.ref_name }}
|
|
167
|
+
run: >-
|
|
168
|
+
gh release create "$TAG"
|
|
169
|
+
--repo "$GITHUB_REPOSITORY"
|
|
170
|
+
--verify-tag
|
|
171
|
+
--title "fair-ca-visualization $TAG"
|
|
172
|
+
--notes-file "release-notes/${TAG}.md"
|
|
173
|
+
dist/*
|
|
174
|
+
|
|
175
|
+
sync-main:
|
|
176
|
+
# main tracks the latest release, Streamlit Community Cloud deploys from it,
|
|
177
|
+
# see docs/development.md
|
|
178
|
+
needs: [publish, github-release]
|
|
179
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
180
|
+
runs-on: ubuntu-latest
|
|
181
|
+
timeout-minutes: 5
|
|
182
|
+
permissions:
|
|
183
|
+
contents: write # fast-forward main to the released commit
|
|
184
|
+
steps:
|
|
185
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
186
|
+
with:
|
|
187
|
+
# a shallow clone cannot be pushed to another branch
|
|
188
|
+
fetch-depth: 0
|
|
189
|
+
# the push below needs the credentials, nothing else runs in this job
|
|
190
|
+
persist-credentials: true
|
|
191
|
+
- name: Fast-forward main to the release
|
|
192
|
+
# no --force: the push fails loudly if it would not be a fast-forward
|
|
193
|
+
run: git push origin HEAD:main
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
16
|
+
# a superseded pull request build is cancelled; a push is never cancelled,
|
|
17
|
+
# the deployment it starts would be left half published
|
|
18
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
docs:
|
|
22
|
+
# required by the branch protection, see .github/rulesets/develop.json
|
|
23
|
+
name: docs
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 20
|
|
26
|
+
env:
|
|
27
|
+
UV_PYTHON_PREFERENCE: only-managed
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
|
+
with:
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
- name: Configure GitHub Pages
|
|
33
|
+
# a pull request builds the site but never deploys it
|
|
34
|
+
if: github.event_name != 'pull_request'
|
|
35
|
+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
|
36
|
+
- name: Install uv and set the python version
|
|
37
|
+
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
|
|
38
|
+
with:
|
|
39
|
+
version: "0.12.21"
|
|
40
|
+
python-version: "3.14"
|
|
41
|
+
enable-cache: true
|
|
42
|
+
- name: Install the locked dependencies (fails if uv.lock is out of date with pyproject.toml, run `uv lock`)
|
|
43
|
+
run: uv sync --locked
|
|
44
|
+
- name: Build the documentation
|
|
45
|
+
# the API reference is rendered from the docstrings by mkdocstrings,
|
|
46
|
+
# so the package has to be importable
|
|
47
|
+
run: uv run zensical build --clean --strict
|
|
48
|
+
- name: Generate the agent facing files
|
|
49
|
+
# llms.txt, llms-full.txt and the markdown of every page
|
|
50
|
+
run: uv run python scripts/llms_txt.py
|
|
51
|
+
- name: Upload the site
|
|
52
|
+
if: github.event_name != 'pull_request'
|
|
53
|
+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
54
|
+
with:
|
|
55
|
+
path: site
|
|
56
|
+
|
|
57
|
+
deploy:
|
|
58
|
+
needs: docs
|
|
59
|
+
# only the default branch publishes to https://matthiaskoenig.github.io/fair-ca-visualization
|
|
60
|
+
if: github.ref == 'refs/heads/develop'
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
timeout-minutes: 10
|
|
63
|
+
permissions:
|
|
64
|
+
pages: write # deploy to GitHub Pages
|
|
65
|
+
id-token: write # verify the deployment originates from this workflow
|
|
66
|
+
environment:
|
|
67
|
+
name: github-pages
|
|
68
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
69
|
+
steps:
|
|
70
|
+
- name: Deploy to GitHub Pages
|
|
71
|
+
id: deployment
|
|
72
|
+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
|
@@ -0,0 +1,39 @@
|
|
|
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: true
|
|
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
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
|
+
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
|
|
32
|
+
with:
|
|
33
|
+
version-file: uv.lock
|
|
34
|
+
args: check --output-format=github
|
|
35
|
+
- name: Format
|
|
36
|
+
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
|
|
37
|
+
with:
|
|
38
|
+
version-file: uv.lock
|
|
39
|
+
args: format --check --diff
|