scverse-backends 0.0.2__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.
- scverse_backends-0.0.2/.github/workflows/ci.yaml +123 -0
- scverse_backends-0.0.2/.github/workflows/python-publish.yml +70 -0
- scverse_backends-0.0.2/.gitignore +144 -0
- scverse_backends-0.0.2/.pre-commit-config.yaml +48 -0
- scverse_backends-0.0.2/.readthedocs.yaml +17 -0
- scverse_backends-0.0.2/LICENSE +21 -0
- scverse_backends-0.0.2/PKG-INFO +78 -0
- scverse_backends-0.0.2/README.md +39 -0
- scverse_backends-0.0.2/codecov.yml +21 -0
- scverse_backends-0.0.2/docs/Makefile +18 -0
- scverse_backends-0.0.2/docs/_static/.gitkeep +0 -0
- scverse_backends-0.0.2/docs/_templates/.gitkeep +0 -0
- scverse_backends-0.0.2/docs/api.md +26 -0
- scverse_backends-0.0.2/docs/conf.py +85 -0
- scverse_backends-0.0.2/docs/index.md +68 -0
- scverse_backends-0.0.2/docs/usage/backend.md +256 -0
- scverse_backends-0.0.2/docs/usage/conformance.md +100 -0
- scverse_backends-0.0.2/docs/usage/host.md +177 -0
- scverse_backends-0.0.2/hatch.toml +31 -0
- scverse_backends-0.0.2/pyproject.toml +104 -0
- scverse_backends-0.0.2/src/scverse_backends/__init__.py +8 -0
- scverse_backends-0.0.2/src/scverse_backends/_dispatch.py +729 -0
- scverse_backends-0.0.2/src/scverse_backends/_dispatcher.py +111 -0
- scverse_backends-0.0.2/src/scverse_backends/_registry.py +591 -0
- scverse_backends-0.0.2/src/scverse_backends/_settings.py +71 -0
- scverse_backends-0.0.2/src/scverse_backends/py.typed +0 -0
- scverse_backends-0.0.2/src/scverse_backends/testing/__init__.py +7 -0
- scverse_backends-0.0.2/src/scverse_backends/testing/conformance.py +91 -0
- scverse_backends-0.0.2/tests/_helpers.py +37 -0
- scverse_backends-0.0.2/tests/conftest.py +37 -0
- scverse_backends-0.0.2/tests/test_conformance.py +103 -0
- scverse_backends-0.0.2/tests/test_dispatch.py +278 -0
- scverse_backends-0.0.2/tests/test_docstring.py +145 -0
- scverse_backends-0.0.2/tests/test_settings.py +583 -0
- scverse_backends-0.0.2/tests/test_signature_merge.py +306 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
FORCE_COLOR: "1"
|
|
16
|
+
UV_COMPILE_BYTECODE: "1"
|
|
17
|
+
|
|
18
|
+
defaults:
|
|
19
|
+
run:
|
|
20
|
+
shell: bash -euo pipefail {0}
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
build:
|
|
24
|
+
name: Build
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v6
|
|
28
|
+
with:
|
|
29
|
+
filter: blob:none
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
- uses: astral-sh/setup-uv@v7
|
|
32
|
+
with:
|
|
33
|
+
cache-dependency-glob: pyproject.toml
|
|
34
|
+
- run: uv build
|
|
35
|
+
- run: uvx twine check --strict dist/*
|
|
36
|
+
|
|
37
|
+
get-test-environments:
|
|
38
|
+
name: Get Test Environments
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
outputs:
|
|
41
|
+
envs: ${{ steps.get-envs.outputs.envs }}
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v6
|
|
44
|
+
with:
|
|
45
|
+
filter: blob:none
|
|
46
|
+
fetch-depth: 0
|
|
47
|
+
- uses: astral-sh/setup-uv@v7
|
|
48
|
+
with:
|
|
49
|
+
enable-cache: false
|
|
50
|
+
- name: Read hatch test matrix
|
|
51
|
+
id: get-envs
|
|
52
|
+
run: |
|
|
53
|
+
ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries
|
|
54
|
+
| map(
|
|
55
|
+
select(.key | startswith("hatch-test"))
|
|
56
|
+
| {
|
|
57
|
+
name: .key,
|
|
58
|
+
python: .value.python,
|
|
59
|
+
coverage: (.value.python == "3.14")
|
|
60
|
+
}
|
|
61
|
+
)')
|
|
62
|
+
echo "envs=${ENVS_JSON}" | tee "$GITHUB_OUTPUT"
|
|
63
|
+
|
|
64
|
+
test:
|
|
65
|
+
name: Test (${{ matrix.env.name }})
|
|
66
|
+
needs: get-test-environments
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
permissions:
|
|
69
|
+
contents: read
|
|
70
|
+
id-token: write
|
|
71
|
+
strategy:
|
|
72
|
+
fail-fast: false
|
|
73
|
+
matrix:
|
|
74
|
+
env: ${{ fromJSON(needs.get-test-environments.outputs.envs) }}
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v6
|
|
77
|
+
with:
|
|
78
|
+
filter: blob:none
|
|
79
|
+
fetch-depth: 0
|
|
80
|
+
- uses: astral-sh/setup-uv@v7
|
|
81
|
+
with:
|
|
82
|
+
python-version: ${{ matrix.env.python }}
|
|
83
|
+
cache-dependency-glob: |
|
|
84
|
+
pyproject.toml
|
|
85
|
+
hatch.toml
|
|
86
|
+
- name: Run tests
|
|
87
|
+
run: |
|
|
88
|
+
mkdir -p test-data
|
|
89
|
+
if [[ "${{ matrix.env.coverage }}" == "true" ]]; then
|
|
90
|
+
uvx hatch run ${{ matrix.env.name }}:run-cov --junitxml=test-data/test-results.xml
|
|
91
|
+
else
|
|
92
|
+
uvx hatch run ${{ matrix.env.name }}:run --junitxml=test-data/test-results.xml
|
|
93
|
+
fi
|
|
94
|
+
- name: Upload coverage
|
|
95
|
+
if: ${{ !cancelled() && matrix.env.coverage }}
|
|
96
|
+
uses: codecov/codecov-action@v6
|
|
97
|
+
with:
|
|
98
|
+
fail_ci_if_error: true
|
|
99
|
+
files: coverage.xml
|
|
100
|
+
flags: ${{ matrix.env.name }}
|
|
101
|
+
use_oidc: true
|
|
102
|
+
- name: Upload test results
|
|
103
|
+
if: ${{ !cancelled() }}
|
|
104
|
+
uses: codecov/codecov-action@v6
|
|
105
|
+
with:
|
|
106
|
+
fail_ci_if_error: true
|
|
107
|
+
files: test-data/test-results.xml
|
|
108
|
+
flags: ${{ matrix.env.name }}
|
|
109
|
+
report_type: test_results
|
|
110
|
+
use_oidc: true
|
|
111
|
+
|
|
112
|
+
all-green:
|
|
113
|
+
name: All CI Green
|
|
114
|
+
if: always()
|
|
115
|
+
needs:
|
|
116
|
+
- build
|
|
117
|
+
- get-test-environments
|
|
118
|
+
- test
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
steps:
|
|
121
|
+
- uses: re-actors/alls-green@release/v1
|
|
122
|
+
with:
|
|
123
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Upload Python Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
release-build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.x"
|
|
28
|
+
|
|
29
|
+
- name: Build release distributions
|
|
30
|
+
run: |
|
|
31
|
+
# NOTE: put your own distribution build steps here.
|
|
32
|
+
python -m pip install build
|
|
33
|
+
python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload distributions
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: release-dists
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
pypi-publish:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
needs:
|
|
44
|
+
- release-build
|
|
45
|
+
permissions:
|
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
47
|
+
id-token: write
|
|
48
|
+
|
|
49
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
50
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
54
|
+
# url: https://pypi.org/p/YOURPROJECT
|
|
55
|
+
#
|
|
56
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
57
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
58
|
+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: Retrieve release distributions
|
|
62
|
+
uses: actions/download-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: release-dists
|
|
65
|
+
path: dist/
|
|
66
|
+
|
|
67
|
+
- name: Publish release distributions to PyPI
|
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
69
|
+
with:
|
|
70
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# --- OS noise ---
|
|
2
|
+
.DS_Store
|
|
3
|
+
._*
|
|
4
|
+
.AppleDouble
|
|
5
|
+
.LSOverride
|
|
6
|
+
.Spotlight-V100
|
|
7
|
+
.Trashes
|
|
8
|
+
Thumbs.db
|
|
9
|
+
ehthumbs.db
|
|
10
|
+
ehthumbs_vista.db
|
|
11
|
+
Desktop.ini
|
|
12
|
+
$RECYCLE.BIN/
|
|
13
|
+
*~
|
|
14
|
+
.nfs*
|
|
15
|
+
.fuse_hidden*
|
|
16
|
+
.directory
|
|
17
|
+
.Trash-*
|
|
18
|
+
|
|
19
|
+
# --- Editors / IDEs ---
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
*.iml
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
.*.sw?
|
|
26
|
+
*.sublime-project
|
|
27
|
+
*.sublime-workspace
|
|
28
|
+
.project
|
|
29
|
+
.pydevproject
|
|
30
|
+
.spyderproject
|
|
31
|
+
.spyproject
|
|
32
|
+
.ropeproject
|
|
33
|
+
.netrwhist
|
|
34
|
+
.tags
|
|
35
|
+
tags
|
|
36
|
+
TAGS
|
|
37
|
+
|
|
38
|
+
# --- Coding agents (don't commit local agent state, prompts, or memory) ---
|
|
39
|
+
CLAUDE.md
|
|
40
|
+
.claude/
|
|
41
|
+
.claude.json
|
|
42
|
+
.claudeignore
|
|
43
|
+
.cursor/
|
|
44
|
+
.cursorrules
|
|
45
|
+
.cursorignore
|
|
46
|
+
.aider*
|
|
47
|
+
.aider.tags.cache.v3/
|
|
48
|
+
.copilot-instructions.md
|
|
49
|
+
.github/copilot-instructions.md
|
|
50
|
+
.windsurf/
|
|
51
|
+
.windsurfrules
|
|
52
|
+
.codeium/
|
|
53
|
+
.continue/
|
|
54
|
+
.ai/
|
|
55
|
+
.amazonq/
|
|
56
|
+
.tabnine/
|
|
57
|
+
.cody/
|
|
58
|
+
.cline/
|
|
59
|
+
.zed/
|
|
60
|
+
.roo/
|
|
61
|
+
.bolt/
|
|
62
|
+
.devin/
|
|
63
|
+
|
|
64
|
+
# --- Python ---
|
|
65
|
+
__pycache__/
|
|
66
|
+
*.py[cod]
|
|
67
|
+
*$py.class
|
|
68
|
+
*.so
|
|
69
|
+
.Python
|
|
70
|
+
*.egg
|
|
71
|
+
*.egg-info/
|
|
72
|
+
.eggs/
|
|
73
|
+
develop-eggs/
|
|
74
|
+
downloads/
|
|
75
|
+
eggs/
|
|
76
|
+
lib/
|
|
77
|
+
lib64/
|
|
78
|
+
parts/
|
|
79
|
+
sdist/
|
|
80
|
+
var/
|
|
81
|
+
wheels/
|
|
82
|
+
share/python-wheels/
|
|
83
|
+
*.manifest
|
|
84
|
+
*.spec
|
|
85
|
+
pip-log.txt
|
|
86
|
+
pip-delete-this-directory.txt
|
|
87
|
+
MANIFEST
|
|
88
|
+
|
|
89
|
+
# --- Virtual environments ---
|
|
90
|
+
.env
|
|
91
|
+
.venv/
|
|
92
|
+
env/
|
|
93
|
+
venv/
|
|
94
|
+
ENV/
|
|
95
|
+
env.bak/
|
|
96
|
+
venv.bak/
|
|
97
|
+
.python-version
|
|
98
|
+
|
|
99
|
+
# --- Build / packaging ---
|
|
100
|
+
build/
|
|
101
|
+
dist/
|
|
102
|
+
src/scverse_backends/_version.py
|
|
103
|
+
|
|
104
|
+
# --- Testing / type-checking / linting caches ---
|
|
105
|
+
.tox/
|
|
106
|
+
.nox/
|
|
107
|
+
.coverage
|
|
108
|
+
.coverage.*
|
|
109
|
+
.cache/
|
|
110
|
+
nosetests.xml
|
|
111
|
+
coverage.xml
|
|
112
|
+
*.cover
|
|
113
|
+
*.py,cover
|
|
114
|
+
.hypothesis/
|
|
115
|
+
.pytest_cache/
|
|
116
|
+
test-data/
|
|
117
|
+
.ruff_cache/
|
|
118
|
+
.mypy_cache/
|
|
119
|
+
.dmypy.json
|
|
120
|
+
dmypy.json
|
|
121
|
+
.pyre/
|
|
122
|
+
.pytype/
|
|
123
|
+
cython_debug/
|
|
124
|
+
htmlcov/
|
|
125
|
+
cover/
|
|
126
|
+
|
|
127
|
+
# --- Jupyter ---
|
|
128
|
+
.ipynb_checkpoints/
|
|
129
|
+
profile_default/
|
|
130
|
+
ipython_config.py
|
|
131
|
+
|
|
132
|
+
# --- Docs ---
|
|
133
|
+
docs/_build/
|
|
134
|
+
docs/generated/
|
|
135
|
+
docs/jupyter_execute/
|
|
136
|
+
|
|
137
|
+
# --- direnv / asdf / mise ---
|
|
138
|
+
.envrc
|
|
139
|
+
.tool-versions
|
|
140
|
+
.mise.toml
|
|
141
|
+
|
|
142
|
+
# --- node (if anyone vendors a JS toolchain) ---
|
|
143
|
+
node_modules/
|
|
144
|
+
PanGPA.log
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autofix_commit_msg: "style: apply pre-commit fixes"
|
|
3
|
+
autoupdate_commit_msg: "chore: update pre-commit hooks"
|
|
4
|
+
autoupdate_schedule: monthly
|
|
5
|
+
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
8
|
+
rev: v0.15.12
|
|
9
|
+
hooks:
|
|
10
|
+
- id: ruff-check
|
|
11
|
+
args: ["--fix"]
|
|
12
|
+
- id: ruff-format
|
|
13
|
+
# The following can be removed once PLR0917 is out of preview
|
|
14
|
+
- name: ruff preview rules
|
|
15
|
+
id: ruff-check
|
|
16
|
+
args: ["--preview", "--select=PLR0917"]
|
|
17
|
+
- repo: local
|
|
18
|
+
hooks:
|
|
19
|
+
- id: ty-check
|
|
20
|
+
name: ty check
|
|
21
|
+
entry: ty check src
|
|
22
|
+
language: python
|
|
23
|
+
additional_dependencies:
|
|
24
|
+
- ty==0.0.34
|
|
25
|
+
pass_filenames: false
|
|
26
|
+
- repo: https://github.com/ComPWA/taplo-pre-commit
|
|
27
|
+
rev: v0.9.3
|
|
28
|
+
hooks:
|
|
29
|
+
- id: taplo-format
|
|
30
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
31
|
+
rev: v6.0.0
|
|
32
|
+
hooks:
|
|
33
|
+
- id: trailing-whitespace
|
|
34
|
+
- id: end-of-file-fixer
|
|
35
|
+
- id: check-added-large-files
|
|
36
|
+
- id: check-case-conflict
|
|
37
|
+
- id: check-toml
|
|
38
|
+
- id: check-yaml
|
|
39
|
+
- id: check-merge-conflict
|
|
40
|
+
- id: no-commit-to-branch
|
|
41
|
+
args: [--branch=main]
|
|
42
|
+
- id: detect-private-key
|
|
43
|
+
- repo: https://github.com/codespell-project/codespell
|
|
44
|
+
rev: v2.4.2
|
|
45
|
+
hooks:
|
|
46
|
+
- id: codespell
|
|
47
|
+
additional_dependencies:
|
|
48
|
+
- tomli
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 scverse®
|
|
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,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scverse-backends
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Pluggable backend dispatch for scverse and scientific Python host libraries
|
|
5
|
+
Project-URL: Bug Tracker, https://github.com/scverse/scverse-backends/issues
|
|
6
|
+
Project-URL: Source, https://github.com/scverse/scverse-backends
|
|
7
|
+
Author: scverse
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: backend-dispatch,scverse,single-cell
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: hatch>=1.9; extra == 'dev'
|
|
25
|
+
Requires-Dist: pre-commit>=3; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
27
|
+
Requires-Dist: ty==0.0.34; extra == 'dev'
|
|
28
|
+
Provides-Extra: docs
|
|
29
|
+
Requires-Dist: myst-parser>=2; extra == 'docs'
|
|
30
|
+
Requires-Dist: scanpydoc[theme]>=0.13; extra == 'docs'
|
|
31
|
+
Requires-Dist: sphinx-autodoc-typehints>=2; extra == 'docs'
|
|
32
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
|
|
33
|
+
Requires-Dist: sphinx-design>=0.5; extra == 'docs'
|
|
34
|
+
Requires-Dist: sphinx>=7; extra == 'docs'
|
|
35
|
+
Provides-Extra: test
|
|
36
|
+
Requires-Dist: pytest-cov>=4; extra == 'test'
|
|
37
|
+
Requires-Dist: pytest>=7; extra == 'test'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# scverse-backends
|
|
41
|
+
|
|
42
|
+
[](https://results.pre-commit.ci/latest/github/scverse/scverse-backends/main)
|
|
43
|
+
[](https://codecov.io/gh/scverse/scverse-backends)
|
|
44
|
+
[](https://scverse-backends.readthedocs.io/en/latest/?badge=latest)
|
|
45
|
+
|
|
46
|
+
> ⚠️ **Under active development.** APIs may shift.
|
|
47
|
+
|
|
48
|
+
The default plugin & dispatch mechanism for [scverse](https://scverse.org).
|
|
49
|
+
Any host library decorates its public functions with `@backend_dispatch`; any
|
|
50
|
+
backend — GPU, distributed, JAX, PyTorch, anything
|
|
51
|
+
— plugs in via a Python entrypoint and gets picked up automatically.
|
|
52
|
+
|
|
53
|
+
Want to add a PyTorch backend, a JAX backend, your own custom one?
|
|
54
|
+
**You don't need a PR against the host.** Ship a package that exposes
|
|
55
|
+
a module or object with `name`, `aliases`, and host-named callables,
|
|
56
|
+
register it as an entry point, and users install it next to the host.
|
|
57
|
+
That's the whole contract.
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import example_host as eh
|
|
61
|
+
|
|
62
|
+
with eh.settings.use_backend("accelerated"):
|
|
63
|
+
eh.some_function(data)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Status
|
|
67
|
+
|
|
68
|
+
- Built from backend-dispatch prototypes in scverse host integrations.
|
|
69
|
+
- Concrete backend aliases belong in host integrations, not in this infrastructure package.
|
|
70
|
+
- Goal: host libraries depend on this package and stop re-rolling their own dispatch.
|
|
71
|
+
|
|
72
|
+
## Docs
|
|
73
|
+
|
|
74
|
+
Full docs at [scverse-backends.readthedocs.io](https://scverse-backends.readthedocs.io/en/latest/).
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# scverse-backends
|
|
2
|
+
|
|
3
|
+
[](https://results.pre-commit.ci/latest/github/scverse/scverse-backends/main)
|
|
4
|
+
[](https://codecov.io/gh/scverse/scverse-backends)
|
|
5
|
+
[](https://scverse-backends.readthedocs.io/en/latest/?badge=latest)
|
|
6
|
+
|
|
7
|
+
> ⚠️ **Under active development.** APIs may shift.
|
|
8
|
+
|
|
9
|
+
The default plugin & dispatch mechanism for [scverse](https://scverse.org).
|
|
10
|
+
Any host library decorates its public functions with `@backend_dispatch`; any
|
|
11
|
+
backend — GPU, distributed, JAX, PyTorch, anything
|
|
12
|
+
— plugs in via a Python entrypoint and gets picked up automatically.
|
|
13
|
+
|
|
14
|
+
Want to add a PyTorch backend, a JAX backend, your own custom one?
|
|
15
|
+
**You don't need a PR against the host.** Ship a package that exposes
|
|
16
|
+
a module or object with `name`, `aliases`, and host-named callables,
|
|
17
|
+
register it as an entry point, and users install it next to the host.
|
|
18
|
+
That's the whole contract.
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import example_host as eh
|
|
22
|
+
|
|
23
|
+
with eh.settings.use_backend("accelerated"):
|
|
24
|
+
eh.some_function(data)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Status
|
|
28
|
+
|
|
29
|
+
- Built from backend-dispatch prototypes in scverse host integrations.
|
|
30
|
+
- Concrete backend aliases belong in host integrations, not in this infrastructure package.
|
|
31
|
+
- Goal: host libraries depend on this package and stop re-rolling their own dispatch.
|
|
32
|
+
|
|
33
|
+
## Docs
|
|
34
|
+
|
|
35
|
+
Full docs at [scverse-backends.readthedocs.io](https://scverse-backends.readthedocs.io/en/latest/).
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
codecov:
|
|
2
|
+
require_ci_to_pass: true
|
|
3
|
+
|
|
4
|
+
coverage:
|
|
5
|
+
precision: 2
|
|
6
|
+
round: down
|
|
7
|
+
status:
|
|
8
|
+
project:
|
|
9
|
+
default:
|
|
10
|
+
target: auto
|
|
11
|
+
threshold: 2%
|
|
12
|
+
patch:
|
|
13
|
+
default:
|
|
14
|
+
target: 80%
|
|
15
|
+
threshold: 5%
|
|
16
|
+
changes: false
|
|
17
|
+
|
|
18
|
+
comment:
|
|
19
|
+
layout: "diff, flags, files"
|
|
20
|
+
behavior: default
|
|
21
|
+
require_changes: true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
SPHINXOPTS ?= -W --keep-going
|
|
2
|
+
SPHINXBUILD ?= sphinx-build
|
|
3
|
+
SOURCEDIR = .
|
|
4
|
+
BUILDDIR = _build
|
|
5
|
+
|
|
6
|
+
.PHONY: help clean html livehtml
|
|
7
|
+
|
|
8
|
+
help:
|
|
9
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
|
|
10
|
+
|
|
11
|
+
clean:
|
|
12
|
+
rm -rf "$(BUILDDIR)" generated
|
|
13
|
+
|
|
14
|
+
html:
|
|
15
|
+
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
|
|
16
|
+
|
|
17
|
+
livehtml:
|
|
18
|
+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
## Public API
|
|
4
|
+
|
|
5
|
+
```{eval-rst}
|
|
6
|
+
.. currentmodule:: scverse_backends
|
|
7
|
+
|
|
8
|
+
.. autosummary::
|
|
9
|
+
:toctree: generated
|
|
10
|
+
:nosignatures:
|
|
11
|
+
|
|
12
|
+
BackendDispatcher
|
|
13
|
+
Settings
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Testing utilities
|
|
17
|
+
|
|
18
|
+
```{eval-rst}
|
|
19
|
+
.. currentmodule:: scverse_backends.testing
|
|
20
|
+
|
|
21
|
+
.. autosummary::
|
|
22
|
+
:toctree: generated
|
|
23
|
+
:nosignatures:
|
|
24
|
+
|
|
25
|
+
run_conformance
|
|
26
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Sphinx configuration for scverse-backends."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from importlib.metadata import metadata
|
|
7
|
+
|
|
8
|
+
# -- Project metadata --------------------------------------------------------
|
|
9
|
+
info = metadata("scverse-backends")
|
|
10
|
+
project = info["Name"]
|
|
11
|
+
author = "scverse"
|
|
12
|
+
copyright = f"{datetime.now():%Y}, {author}"
|
|
13
|
+
release = info["Version"]
|
|
14
|
+
version = ".".join(release.split(".")[:2])
|
|
15
|
+
|
|
16
|
+
# -- General configuration ---------------------------------------------------
|
|
17
|
+
extensions = [
|
|
18
|
+
"myst_parser",
|
|
19
|
+
"sphinx.ext.autodoc",
|
|
20
|
+
"sphinx.ext.autosummary",
|
|
21
|
+
"sphinx.ext.intersphinx",
|
|
22
|
+
"sphinx.ext.napoleon",
|
|
23
|
+
"sphinx.ext.viewcode",
|
|
24
|
+
"sphinx_autodoc_typehints",
|
|
25
|
+
"sphinx_copybutton",
|
|
26
|
+
"sphinx_design",
|
|
27
|
+
"scanpydoc",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
master_doc = "index"
|
|
31
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
32
|
+
templates_path = ["_templates"]
|
|
33
|
+
suppress_warnings = ["myst.header"]
|
|
34
|
+
|
|
35
|
+
# -- MyST --------------------------------------------------------------------
|
|
36
|
+
myst_enable_extensions = [
|
|
37
|
+
"colon_fence",
|
|
38
|
+
"deflist",
|
|
39
|
+
"smartquotes",
|
|
40
|
+
"substitution",
|
|
41
|
+
]
|
|
42
|
+
myst_heading_anchors = 3
|
|
43
|
+
|
|
44
|
+
# -- Autodoc -----------------------------------------------------------------
|
|
45
|
+
autosummary_generate = True
|
|
46
|
+
autodoc_typehints = "description"
|
|
47
|
+
autodoc_member_order = "bysource"
|
|
48
|
+
autodoc_default_options = {
|
|
49
|
+
"members": True,
|
|
50
|
+
"show-inheritance": True,
|
|
51
|
+
}
|
|
52
|
+
napoleon_google_docstring = False
|
|
53
|
+
napoleon_numpy_docstring = True
|
|
54
|
+
typehints_defaults = "comma"
|
|
55
|
+
always_document_param_types = True
|
|
56
|
+
|
|
57
|
+
# -- Intersphinx -------------------------------------------------------------
|
|
58
|
+
intersphinx_mapping = {
|
|
59
|
+
"python": ("https://docs.python.org/3", None),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# -- HTML output -------------------------------------------------------------
|
|
63
|
+
html_theme = "scanpydoc"
|
|
64
|
+
html_title = "scverse-backends"
|
|
65
|
+
html_static_path = ["_static"]
|
|
66
|
+
html_show_sphinx = False
|
|
67
|
+
pygments_style = "default"
|
|
68
|
+
pygments_dark_style = "native"
|
|
69
|
+
|
|
70
|
+
html_theme_options = {
|
|
71
|
+
"repository_url": "https://github.com/scverse/scverse-backends",
|
|
72
|
+
"repository_branch": "main",
|
|
73
|
+
"use_repository_button": True,
|
|
74
|
+
"use_issues_button": True,
|
|
75
|
+
"use_edit_page_button": True,
|
|
76
|
+
"path_to_docs": "docs",
|
|
77
|
+
"navigation_with_keys": False,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
html_context = {
|
|
81
|
+
"github_user": "scverse",
|
|
82
|
+
"github_repo": "scverse-backends",
|
|
83
|
+
"github_version": "main",
|
|
84
|
+
"doc_path": "docs",
|
|
85
|
+
}
|