pycordis2 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.
- pycordis2-0.1.0/.gitattributes +3 -0
- pycordis2-0.1.0/.github/workflows/build.yml +69 -0
- pycordis2-0.1.0/.github/workflows/ci.yml +84 -0
- pycordis2-0.1.0/.github/workflows/pages.yml +52 -0
- pycordis2-0.1.0/.github/workflows/release.yml +48 -0
- pycordis2-0.1.0/.gitignore +31 -0
- pycordis2-0.1.0/GitVersion.yml +13 -0
- pycordis2-0.1.0/LICENSE +22 -0
- pycordis2-0.1.0/PKG-INFO +81 -0
- pycordis2-0.1.0/README.md +61 -0
- pycordis2-0.1.0/codecov.yml +13 -0
- pycordis2-0.1.0/conformance/ledger.toml +2166 -0
- pycordis2-0.1.0/conformance/upstream.json +1862 -0
- pycordis2-0.1.0/docs/README.md +107 -0
- pycordis2-0.1.0/docs/api/index.md +260 -0
- pycordis2-0.1.0/docs/architecture.md +158 -0
- pycordis2-0.1.0/docs/build_specs/completed/conformance.md +456 -0
- pycordis2-0.1.0/docs/build_specs/completed/core_port.md +1108 -0
- pycordis2-0.1.0/docs/build_specs/completed/pages_and_ci.md +437 -0
- pycordis2-0.1.0/docs/build_specs/index.md +7 -0
- pycordis2-0.1.0/docs/contributing.md +189 -0
- pycordis2-0.1.0/docs/developer_guide.md +168 -0
- pycordis2-0.1.0/docs/getting_started.md +41 -0
- pycordis2-0.1.0/docs/javascripts/mathjax.js +27 -0
- pycordis2-0.1.0/docs/javascripts/vendor/mathjax/LICENSE +202 -0
- pycordis2-0.1.0/docs/javascripts/vendor/mathjax/tex-svg.js +1 -0
- pycordis2-0.1.0/docs/user_guide.md +164 -0
- pycordis2-0.1.0/pyproject.toml +78 -0
- pycordis2-0.1.0/scripts/gen_ref_pages.py +120 -0
- pycordis2-0.1.0/scripts/upstream_inventory.py +996 -0
- pycordis2-0.1.0/src/pycordis/__init__.py +51 -0
- pycordis2-0.1.0/src/pycordis/context.py +577 -0
- pycordis2-0.1.0/src/pycordis/deferred.py +134 -0
- pycordis2-0.1.0/src/pycordis/disposables.py +105 -0
- pycordis2-0.1.0/src/pycordis/errors.py +126 -0
- pycordis2-0.1.0/src/pycordis/events.py +386 -0
- pycordis2-0.1.0/src/pycordis/fiber.py +891 -0
- pycordis2-0.1.0/src/pycordis/keys.py +64 -0
- pycordis2-0.1.0/src/pycordis/logger.py +313 -0
- pycordis2-0.1.0/src/pycordis/py.typed +0 -0
- pycordis2-0.1.0/src/pycordis/reflect.py +447 -0
- pycordis2-0.1.0/src/pycordis/registry.py +413 -0
- pycordis2-0.1.0/src/pycordis/scheduler.py +333 -0
- pycordis2-0.1.0/src/pycordis/service.py +165 -0
- pycordis2-0.1.0/src/pycordis/traceable.py +374 -0
- pycordis2-0.1.0/tests/conformance_checks.py +688 -0
- pycordis2-0.1.0/tests/conftest.py +175 -0
- pycordis2-0.1.0/tests/test_associate.py +218 -0
- pycordis2-0.1.0/tests/test_component.py +537 -0
- pycordis2-0.1.0/tests/test_conformance.py +618 -0
- pycordis2-0.1.0/tests/test_context.py +108 -0
- pycordis2-0.1.0/tests/test_decorator.py +155 -0
- pycordis2-0.1.0/tests/test_dispose.py +261 -0
- pycordis2-0.1.0/tests/test_doc_examples.py +24 -0
- pycordis2-0.1.0/tests/test_docstrings.py +149 -0
- pycordis2-0.1.0/tests/test_effect_forms.py +342 -0
- pycordis2-0.1.0/tests/test_events.py +758 -0
- pycordis2-0.1.0/tests/test_fiber.py +540 -0
- pycordis2-0.1.0/tests/test_intercept.py +164 -0
- pycordis2-0.1.0/tests/test_invariants.py +472 -0
- pycordis2-0.1.0/tests/test_inventory.py +364 -0
- pycordis2-0.1.0/tests/test_invoke.py +110 -0
- pycordis2-0.1.0/tests/test_isolate.py +195 -0
- pycordis2-0.1.0/tests/test_keys.py +22 -0
- pycordis2-0.1.0/tests/test_logger.py +313 -0
- pycordis2-0.1.0/tests/test_package.py +56 -0
- pycordis2-0.1.0/tests/test_reflect.py +495 -0
- pycordis2-0.1.0/tests/test_replace.py +329 -0
- pycordis2-0.1.0/tests/test_scheduler.py +447 -0
- pycordis2-0.1.0/tests/test_service.py +321 -0
- pycordis2-0.1.0/tests/test_service_dispose.py +638 -0
- pycordis2-0.1.0/tests/test_shadow.py +301 -0
- pycordis2-0.1.0/tests/test_threading.py +144 -0
- pycordis2-0.1.0/tests/test_traceable.py +111 -0
- pycordis2-0.1.0/tests/test_update.py +408 -0
- pycordis2-0.1.0/tests/test_utils.py +136 -0
- pycordis2-0.1.0/uv.lock +759 -0
- pycordis2-0.1.0/zensical.toml +111 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
# The only workflow that calculates the version and builds the archives.
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
outputs:
|
|
7
|
+
version:
|
|
8
|
+
description: The version that GitVersion calculated.
|
|
9
|
+
value: ${{ jobs.build.outputs.version }}
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
version: ${{ steps.gitversion.outputs.semVer }}
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0 # GitVersion needs the history and the tags
|
|
23
|
+
- name: Install GitVersion
|
|
24
|
+
uses: gittools/actions/gitversion/setup@7417b1089e2c7de93510f1901d656ddf60bb024f # v4.7.0
|
|
25
|
+
with:
|
|
26
|
+
versionSpec: "6.8.2"
|
|
27
|
+
- name: Calculate the version
|
|
28
|
+
id: gitversion
|
|
29
|
+
uses: gittools/actions/gitversion/execute@7417b1089e2c7de93510f1901d656ddf60bb024f # v4.7.0
|
|
30
|
+
with:
|
|
31
|
+
configFilePath: GitVersion.yml
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
34
|
+
with:
|
|
35
|
+
version: "0.9.3"
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
- name: Set the version and build
|
|
38
|
+
run: |
|
|
39
|
+
uv version "${{ steps.gitversion.outputs.semVer }}" --frozen
|
|
40
|
+
uv build
|
|
41
|
+
- name: Check the archives
|
|
42
|
+
run: |
|
|
43
|
+
python - <<'PY'
|
|
44
|
+
import glob, sys, tarfile, zipfile
|
|
45
|
+
|
|
46
|
+
errors = []
|
|
47
|
+
(wheel,) = glob.glob("dist/*.whl")
|
|
48
|
+
(sdist,) = glob.glob("dist/*.tar.gz")
|
|
49
|
+
with zipfile.ZipFile(wheel) as zf:
|
|
50
|
+
names = zf.namelist()
|
|
51
|
+
with tarfile.open(sdist) as tf:
|
|
52
|
+
sdist_names = tf.getnames()
|
|
53
|
+
if "pycordis/py.typed" not in names:
|
|
54
|
+
errors.append("the wheel has no pycordis/py.typed")
|
|
55
|
+
if not any(n.endswith("licenses/LICENSE") for n in names):
|
|
56
|
+
errors.append("the wheel has no license file")
|
|
57
|
+
if not any(n.endswith("/LICENSE") for n in sdist_names):
|
|
58
|
+
errors.append("the sdist has no license file")
|
|
59
|
+
if any(n.startswith("tests/") for n in names):
|
|
60
|
+
errors.append("the wheel contains tests/")
|
|
61
|
+
if errors:
|
|
62
|
+
sys.exit("\n".join(errors))
|
|
63
|
+
PY
|
|
64
|
+
- name: Upload the archives
|
|
65
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
66
|
+
with:
|
|
67
|
+
name: dist
|
|
68
|
+
path: dist/
|
|
69
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [develop, master]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
uses: ./.github/workflows/build.yml
|
|
18
|
+
|
|
19
|
+
test:
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
python-version: ["3.12", "3.13"]
|
|
25
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
30
|
+
with:
|
|
31
|
+
version: "0.9.3"
|
|
32
|
+
python-version: ${{ matrix.python-version }}
|
|
33
|
+
enable-cache: true
|
|
34
|
+
- name: Install the project
|
|
35
|
+
run: uv sync --frozen
|
|
36
|
+
- name: Run the full test suite with coverage
|
|
37
|
+
run: uv run pytest --cov --cov-report=term-missing --cov-report=xml
|
|
38
|
+
- name: Upload coverage to Codecov
|
|
39
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
40
|
+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
41
|
+
with:
|
|
42
|
+
files: coverage.xml
|
|
43
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
44
|
+
fail_ci_if_error: false
|
|
45
|
+
|
|
46
|
+
lint:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
50
|
+
- name: Install uv
|
|
51
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
52
|
+
with:
|
|
53
|
+
version: "0.9.3"
|
|
54
|
+
python-version: "3.12"
|
|
55
|
+
enable-cache: true
|
|
56
|
+
- name: Check the lock file
|
|
57
|
+
run: uv lock --check
|
|
58
|
+
- name: Install the project
|
|
59
|
+
run: uv sync --frozen
|
|
60
|
+
- name: Ruff lint
|
|
61
|
+
run: uv run ruff check .
|
|
62
|
+
- name: Ruff format check
|
|
63
|
+
run: uv run ruff format --check .
|
|
64
|
+
|
|
65
|
+
docs:
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
69
|
+
- name: Install uv
|
|
70
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
71
|
+
with:
|
|
72
|
+
version: "0.9.3"
|
|
73
|
+
python-version: "3.12"
|
|
74
|
+
enable-cache: true
|
|
75
|
+
- name: Install the project
|
|
76
|
+
run: uv sync --frozen
|
|
77
|
+
- name: Generate the API pages and nav
|
|
78
|
+
run: uv run python scripts/gen_ref_pages.py
|
|
79
|
+
- name: Check for generated drift
|
|
80
|
+
run: |
|
|
81
|
+
git diff --exit-code
|
|
82
|
+
test -z "$(git status --porcelain)"
|
|
83
|
+
- name: Build the documentation
|
|
84
|
+
run: uv run zensical build --strict
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: pages
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
21
|
+
with:
|
|
22
|
+
version: "0.9.3"
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
enable-cache: true
|
|
25
|
+
- name: Install the project
|
|
26
|
+
run: uv sync --frozen
|
|
27
|
+
- name: Generate the API pages and nav
|
|
28
|
+
run: uv run python scripts/gen_ref_pages.py
|
|
29
|
+
- name: Check for generated drift
|
|
30
|
+
run: |
|
|
31
|
+
git diff --exit-code
|
|
32
|
+
test -z "$(git status --porcelain)"
|
|
33
|
+
- name: Build the documentation
|
|
34
|
+
run: uv run zensical build --strict
|
|
35
|
+
- name: Upload the site
|
|
36
|
+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
37
|
+
with:
|
|
38
|
+
path: site
|
|
39
|
+
|
|
40
|
+
deploy:
|
|
41
|
+
needs: build
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
permissions:
|
|
44
|
+
pages: write
|
|
45
|
+
id-token: write
|
|
46
|
+
environment:
|
|
47
|
+
name: github-pages
|
|
48
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
49
|
+
steps:
|
|
50
|
+
- name: Deploy to GitHub Pages
|
|
51
|
+
id: deployment
|
|
52
|
+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# A push to master publishes the calculated version to PyPI and tags the built commit.
|
|
4
|
+
# GITHUB_TOKEN cannot start a workflow from a tag, so the tag job runs after the upload.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: release
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
uses: ./.github/workflows/build.yml
|
|
19
|
+
|
|
20
|
+
publish:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
environment: pypi
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
id-token: write # PyPI trusted publishing
|
|
27
|
+
steps:
|
|
28
|
+
- name: Download the archives
|
|
29
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
30
|
+
with:
|
|
31
|
+
name: dist
|
|
32
|
+
path: dist/
|
|
33
|
+
- name: Upload to PyPI
|
|
34
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
35
|
+
|
|
36
|
+
tag:
|
|
37
|
+
needs: [build, publish]
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
permissions:
|
|
40
|
+
contents: write
|
|
41
|
+
steps:
|
|
42
|
+
- name: Create the tag
|
|
43
|
+
env:
|
|
44
|
+
GH_TOKEN: ${{ github.token }}
|
|
45
|
+
run: |
|
|
46
|
+
gh api "repos/${{ github.repository }}/git/refs" \
|
|
47
|
+
-f ref="refs/tags/v${{ needs.build.outputs.version }}" \
|
|
48
|
+
-f sha="${{ github.sha }}"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Byte-compiled files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
|
|
5
|
+
# Build and distribution
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
*.egg-info/
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv/
|
|
12
|
+
|
|
13
|
+
# Test and coverage output
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
.coverage.*
|
|
17
|
+
coverage.xml
|
|
18
|
+
htmlcov/
|
|
19
|
+
|
|
20
|
+
# Tool caches
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
|
|
24
|
+
# Documentation build output and generated API pages
|
|
25
|
+
site/
|
|
26
|
+
docs/api/*
|
|
27
|
+
!docs/api/index.md
|
|
28
|
+
|
|
29
|
+
# Editor and OS files
|
|
30
|
+
.DS_Store
|
|
31
|
+
.idea/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
workflow: GitFlow/v1
|
|
2
|
+
# The repository has no tag yet. Remove this line after the tag v0.1.0 exists.
|
|
3
|
+
next-version: 0.1.0
|
|
4
|
+
branches:
|
|
5
|
+
main:
|
|
6
|
+
regex: ^master$
|
|
7
|
+
track-merge-message: true
|
|
8
|
+
# A merge to master gives a clean version (0.1.0), not a pre-release count.
|
|
9
|
+
mode: ContinuousDeployment
|
|
10
|
+
pull-request:
|
|
11
|
+
# The default label, PullRequest<N>, is not a PEP 440 pre-release label, and
|
|
12
|
+
# `uv version` rejects it. A pull-request build is never published.
|
|
13
|
+
label: alpha
|
pycordis2-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-present Shigma
|
|
4
|
+
Copyright (c) 2026-present Thomas Chen
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
pycordis2-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pycordis2
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python port of the Cordis core: plugin and service composition from revertible effects.
|
|
5
|
+
Project-URL: Repository, https://github.com/uclatommy/pycordis
|
|
6
|
+
Project-URL: Upstream, https://github.com/cordiverse/cordis
|
|
7
|
+
Author: Thomas Chen
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: cordis,dependency-injection,effects,hot-reload,plugin
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# pycordis
|
|
22
|
+
|
|
23
|
+
[](https://github.com/uclatommy/pycordis/actions/workflows/ci.yml)
|
|
24
|
+
[](https://codecov.io/gh/uclatommy/pycordis)
|
|
25
|
+
|
|
26
|
+
pycordis is a Python implementation of the programming model in *A Programming Paradigm for
|
|
27
|
+
Spatiotemporal Composability* (arXiv `2608.25512`), with the core package of
|
|
28
|
+
[Cordis](https://github.com/cordiverse/cordis) (`packages/core`) as its reference
|
|
29
|
+
implementation. It composes plugins and services from **revertible effects** and **declared
|
|
30
|
+
dependencies**: each plugin runs in a fiber, every side effect that the fiber makes has an
|
|
31
|
+
inverse, and the framework loads, unloads, and reloads fibers when the services that they depend
|
|
32
|
+
on change.
|
|
33
|
+
|
|
34
|
+
**Documentation**: <https://uclatommy.github.io/pycordis/>
|
|
35
|
+
**Status**: pre-1.0 (`0.x`): a breaking change to the public API increments the minor version.
|
|
36
|
+
|
|
37
|
+
## Upstream
|
|
38
|
+
|
|
39
|
+
- **Tracked upstream revision**: `cordiverse/cordis` `68c9d9917871d8680bc7ccb9034b9284d5102433`
|
|
40
|
+
(`v4.0.0-rc.13`)
|
|
41
|
+
- **Semantic contract and conformance**: [docs/architecture.md](docs/architecture.md#semantic-contract)
|
|
42
|
+
- **Divergences from upstream**: [docs/architecture.md](docs/architecture.md#divergences-from-upstream)
|
|
43
|
+
- **Porting workflow**: [docs/developer_guide.md](docs/developer_guide.md#port-an-upstream-change)
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- Python 3.12 or later
|
|
48
|
+
- No runtime dependencies
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install pycordis2
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The import name is `pycordis`.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from pycordis import Context, ImmediateScheduler
|
|
62
|
+
|
|
63
|
+
root = Context(ImmediateScheduler())
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def greeter(ctx: Context, config: object) -> None:
|
|
67
|
+
print("start")
|
|
68
|
+
ctx.effect(lambda: lambda: print("stop"))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
fiber = root.use(greeter) # prints "start"
|
|
72
|
+
fiber.dispose() # prints "stop"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The [User Guide](docs/user_guide.md) explains fibers, effects, services, and schedulers. See
|
|
76
|
+
[Getting Started](docs/getting_started.md) for development setup.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT. pycordis is a derivative work of Cordis, Copyright (c) 2021-present Shigma. See
|
|
81
|
+
[LICENSE](LICENSE).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# pycordis
|
|
2
|
+
|
|
3
|
+
[](https://github.com/uclatommy/pycordis/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/uclatommy/pycordis)
|
|
5
|
+
|
|
6
|
+
pycordis is a Python implementation of the programming model in *A Programming Paradigm for
|
|
7
|
+
Spatiotemporal Composability* (arXiv `2608.25512`), with the core package of
|
|
8
|
+
[Cordis](https://github.com/cordiverse/cordis) (`packages/core`) as its reference
|
|
9
|
+
implementation. It composes plugins and services from **revertible effects** and **declared
|
|
10
|
+
dependencies**: each plugin runs in a fiber, every side effect that the fiber makes has an
|
|
11
|
+
inverse, and the framework loads, unloads, and reloads fibers when the services that they depend
|
|
12
|
+
on change.
|
|
13
|
+
|
|
14
|
+
**Documentation**: <https://uclatommy.github.io/pycordis/>
|
|
15
|
+
**Status**: pre-1.0 (`0.x`): a breaking change to the public API increments the minor version.
|
|
16
|
+
|
|
17
|
+
## Upstream
|
|
18
|
+
|
|
19
|
+
- **Tracked upstream revision**: `cordiverse/cordis` `68c9d9917871d8680bc7ccb9034b9284d5102433`
|
|
20
|
+
(`v4.0.0-rc.13`)
|
|
21
|
+
- **Semantic contract and conformance**: [docs/architecture.md](docs/architecture.md#semantic-contract)
|
|
22
|
+
- **Divergences from upstream**: [docs/architecture.md](docs/architecture.md#divergences-from-upstream)
|
|
23
|
+
- **Porting workflow**: [docs/developer_guide.md](docs/developer_guide.md#port-an-upstream-change)
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python 3.12 or later
|
|
28
|
+
- No runtime dependencies
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install pycordis2
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The import name is `pycordis`.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from pycordis import Context, ImmediateScheduler
|
|
42
|
+
|
|
43
|
+
root = Context(ImmediateScheduler())
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def greeter(ctx: Context, config: object) -> None:
|
|
47
|
+
print("start")
|
|
48
|
+
ctx.effect(lambda: lambda: print("stop"))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
fiber = root.use(greeter) # prints "start"
|
|
52
|
+
fiber.dispose() # prints "stop"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The [User Guide](docs/user_guide.md) explains fibers, effects, services, and schedulers. See
|
|
56
|
+
[Getting Started](docs/getting_started.md) for development setup.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT. pycordis is a derivative work of Cordis, Copyright (c) 2021-present Shigma. See
|
|
61
|
+
[LICENSE](LICENSE).
|