camas 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.
@@ -0,0 +1,64 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["*"]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ check:
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
15
+ fail-fast: false
16
+ runs-on: ${{ matrix.os }}
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - uses: astral-sh/setup-uv@v6
23
+
24
+ - run: uv run camas matrix --effects='(Summary(SummaryOptions(Fixed(120))),)'
25
+
26
+ - run: uv build
27
+
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist-${{ matrix.os }}
31
+ path: |
32
+ dist/*.tar.gz
33
+ dist/*.whl
34
+
35
+ coverage:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v5
39
+ with:
40
+ fetch-depth: 0
41
+
42
+ - uses: astral-sh/setup-uv@v6
43
+
44
+ - run: uv run camas coverage --effects='(Summary(),)'
45
+
46
+ publish:
47
+ if: startsWith(github.ref, 'refs/tags/')
48
+ needs: [check, coverage]
49
+ runs-on: ubuntu-latest
50
+ environment:
51
+ name: pypi
52
+ url: https://pypi.org/p/camas
53
+ permissions:
54
+ id-token: write
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ with:
58
+ fetch-depth: 0
59
+
60
+ - uses: astral-sh/setup-uv@v6
61
+
62
+ - run: uv build
63
+
64
+ - uses: pypa/gh-action-pypi-publish@release/v1
camas-0.1.0/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ __pycache__
2
+ .coverage
3
+ .venv*
@@ -0,0 +1,3 @@
1
+ 3.14
2
+ 3.13
3
+ 3.12
@@ -0,0 +1,7 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-python.python",
4
+ "charliermarsh.ruff",
5
+ "ms-python.mypy-type-checker"
6
+ ]
7
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "[python]": {
3
+ "editor.formatOnSave": true,
4
+ "editor.defaultFormatter": "charliermarsh.ruff",
5
+ "editor.codeActionsOnSave": {
6
+ "source.organizeImports": "always"
7
+ }
8
+ },
9
+ "flake8.enabled": false,
10
+ "ruff.enable": true,
11
+ "ruff.lint.enable": true,
12
+ "mypy-type-checker.importStrategy": "fromEnvironment"
13
+ }
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ jphutchins@gmail.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,37 @@
1
+ # Camas
2
+
3
+ Contributions and bug reports are welcome!
4
+
5
+ > [!IMPORTANT]
6
+ > ### First time setup
7
+ >
8
+ > - Install [uv](https://github.com/astral-sh/uv)
9
+ > - Initialize the environment:
10
+ > ```
11
+ > uv sync --locked --all-extras --all-packages --dev
12
+ > ```
13
+
14
+ ### Formatting
15
+ ```
16
+ uv run task format
17
+ ```
18
+ > [!NOTE]
19
+ > VSCode is setup to do this for you on save - feel free to add more editors.
20
+
21
+ ### Linting
22
+ ```
23
+ uv run task lint
24
+ ```
25
+ > [!NOTE]
26
+ > VSCode is setup to to run these LSPs in the background - feel free to add more
27
+ > editors.
28
+
29
+ ### Tests
30
+ ```
31
+ uv run task test
32
+ ```
33
+
34
+ ### All
35
+ ```
36
+ uv run task all
37
+ ```
camas-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JP Hutchins
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.
camas-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.4
2
+ Name: camas
3
+ Version: 0.1.0
4
+ Summary: Generic parallel/sequential task runner with TUI output
5
+ Project-URL: Homepage, https://github.com/JPHutchins/camas
6
+ Project-URL: Repository, https://github.com/JPHutchins/camas
7
+ Project-URL: Issues, https://github.com/JPHutchins/camas/issues
8
+ Author-email: JP Hutchins <jp@intercreate.io>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: async,parallel,sequential,task-runner,tui
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+
24
+ # Camas
25
+
26
+ Generic parallel/sequential task runner with a live tree-style TUI.
27
+
28
+ [![CI](https://github.com/JPHutchins/camas/actions/workflows/ci.yaml/badge.svg)](https://github.com/JPHutchins/camas/actions/workflows/ci.yaml)
29
+
30
+ ## Install
31
+
32
+ ```
33
+ uv add camas
34
+ ```
35
+
36
+ or
37
+
38
+ ```
39
+ pip install camas
40
+ ```
41
+
42
+ ## Quick start
43
+
44
+ Camas takes a typed Python expression describing a tree of `Task`, `Sequential`,
45
+ and `Parallel` nodes and runs it, streaming progress into a live tree in your
46
+ terminal.
47
+
48
+ Run two checks in parallel:
49
+ ```
50
+ python -m camas 'Parallel(tasks=(Task("ruff check ."), Task("mypy .")))'
51
+ ```
52
+
53
+ A typical CI pipeline — format-check, then checks in parallel, then tests:
54
+ ```
55
+ python -m camas 'Sequential(tasks=(
56
+ Task("ruff format . --check"),
57
+ Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
58
+ Task("pytest"),
59
+ ))'
60
+ ```
61
+
62
+ Run one task across a matrix of Python versions in parallel:
63
+ ```
64
+ python -m camas 'Parallel(
65
+ tasks=(Task("pytest --python {PY}"),),
66
+ matrix={"PY": ("3.12", "3.13", "3.14")},
67
+ )'
68
+ ```
69
+
70
+ Use `--dry-run` to print the task tree without executing it.
71
+
72
+ ## Library
73
+
74
+ The same building blocks are available as a library:
75
+
76
+ ```python
77
+ import asyncio
78
+ from camas import Parallel, Sequential, Task, run
79
+ from camas.effect.termtree import Termtree, TermtreeOptions
80
+
81
+ task = Sequential(tasks=(
82
+ Task("ruff format . --check"),
83
+ Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
84
+ Task("pytest"),
85
+ ))
86
+
87
+ result = asyncio.run(run(task, effects=(Termtree(TermtreeOptions()),)))
88
+ raise SystemExit(result.returncode)
89
+ ```
90
+
91
+ `Task`, `Sequential`, and `Parallel` are immutable `NamedTuple` values. A
92
+ `Sequential` short-circuits on the first non-zero exit; a `Parallel` runs its
93
+ children concurrently. Both accept an optional `matrix` mapping for variable
94
+ expansion in task commands, names, and environments.
95
+
96
+ ## License
97
+
98
+ [MIT](LICENSE)
camas-0.1.0/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Camas
2
+
3
+ Generic parallel/sequential task runner with a live tree-style TUI.
4
+
5
+ [![CI](https://github.com/JPHutchins/camas/actions/workflows/ci.yaml/badge.svg)](https://github.com/JPHutchins/camas/actions/workflows/ci.yaml)
6
+
7
+ ## Install
8
+
9
+ ```
10
+ uv add camas
11
+ ```
12
+
13
+ or
14
+
15
+ ```
16
+ pip install camas
17
+ ```
18
+
19
+ ## Quick start
20
+
21
+ Camas takes a typed Python expression describing a tree of `Task`, `Sequential`,
22
+ and `Parallel` nodes and runs it, streaming progress into a live tree in your
23
+ terminal.
24
+
25
+ Run two checks in parallel:
26
+ ```
27
+ python -m camas 'Parallel(tasks=(Task("ruff check ."), Task("mypy .")))'
28
+ ```
29
+
30
+ A typical CI pipeline — format-check, then checks in parallel, then tests:
31
+ ```
32
+ python -m camas 'Sequential(tasks=(
33
+ Task("ruff format . --check"),
34
+ Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
35
+ Task("pytest"),
36
+ ))'
37
+ ```
38
+
39
+ Run one task across a matrix of Python versions in parallel:
40
+ ```
41
+ python -m camas 'Parallel(
42
+ tasks=(Task("pytest --python {PY}"),),
43
+ matrix={"PY": ("3.12", "3.13", "3.14")},
44
+ )'
45
+ ```
46
+
47
+ Use `--dry-run` to print the task tree without executing it.
48
+
49
+ ## Library
50
+
51
+ The same building blocks are available as a library:
52
+
53
+ ```python
54
+ import asyncio
55
+ from camas import Parallel, Sequential, Task, run
56
+ from camas.effect.termtree import Termtree, TermtreeOptions
57
+
58
+ task = Sequential(tasks=(
59
+ Task("ruff format . --check"),
60
+ Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
61
+ Task("pytest"),
62
+ ))
63
+
64
+ result = asyncio.run(run(task, effects=(Termtree(TermtreeOptions()),)))
65
+ raise SystemExit(result.returncode)
66
+ ```
67
+
68
+ `Task`, `Sequential`, and `Parallel` are immutable `NamedTuple` values. A
69
+ `Sequential` short-circuits on the first non-zero exit; a `Parallel` runs its
70
+ children concurrently. Both accept an optional `matrix` mapping for variable
71
+ expansion in task commands, names, and environments.
72
+
73
+ ## License
74
+
75
+ [MIT](LICENSE)
camas-0.1.0/check.py ADDED
@@ -0,0 +1,57 @@
1
+ """camas task definitions for this project.
2
+
3
+ Run directly with ``python check.py <task>``. Every module-level
4
+ ``Task``/``Sequential``/``Parallel`` becomes an invokable task by its binding
5
+ name. Private names (leading ``_``) are skipped.
6
+ """
7
+
8
+ from camas import Parallel, Sequential, Task
9
+ from camas.main import run_cli
10
+
11
+ format = Task("uv run ruff format .")
12
+ format_check = Task("uv run ruff format --check .")
13
+ lint = Task("uv run ruff check .")
14
+ mypy = Task("uv run mypy .")
15
+ ty = Task("uv run ty check")
16
+ zuban = Task("uv run zuban check")
17
+ pyrefly = Task("uv run pyrefly check")
18
+ pyright = Task("uv run pyright src tests")
19
+
20
+ typecheck = Parallel(tasks=(mypy, pyright, ty, zuban, pyrefly))
21
+ test = Task("uv run pytest --doctest-modules -v -m 'not slow'")
22
+ coverage = Task("uv run pytest --doctest-modules -m 'not slow' --cov --cov-report=term-missing")
23
+
24
+ all = Sequential(
25
+ tasks=(
26
+ format,
27
+ Parallel(tasks=(lint, typecheck, test)),
28
+ )
29
+ )
30
+
31
+ check = Sequential(
32
+ tasks=(
33
+ format_check,
34
+ Parallel(tasks=(lint, typecheck, test)),
35
+ )
36
+ )
37
+
38
+ venvs = Parallel(
39
+ tasks=(
40
+ Sequential(
41
+ tasks=(
42
+ Task("uv venv --python {PY} .venv-{PY}"),
43
+ Task("uv sync", env={"UV_PROJECT_ENVIRONMENT": ".venv-{PY}"}),
44
+ )
45
+ ),
46
+ ),
47
+ matrix={"PY": ("3.12", "3.13", "3.14")},
48
+ )
49
+
50
+ matrix = Parallel(
51
+ tasks=(check,),
52
+ matrix={"UV_PROJECT_ENVIRONMENT": (".venv-3.12", ".venv-3.13", ".venv-3.14")},
53
+ )
54
+
55
+
56
+ if __name__ == "__main__":
57
+ run_cli(globals())
@@ -0,0 +1,121 @@
1
+ [project]
2
+ name = "camas"
3
+ description = "Generic parallel/sequential task runner with TUI output"
4
+ readme = "README.md"
5
+ license = "MIT"
6
+ authors = [{ name = "JP Hutchins", email = "jp@intercreate.io" }]
7
+ requires-python = ">=3.12"
8
+ dependencies = []
9
+ dynamic = ["version"]
10
+ keywords = ["task-runner", "parallel", "sequential", "tui", "async"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Intended Audience :: Developers",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Python :: 3.14",
19
+ "Topic :: Software Development :: Build Tools",
20
+ "Typing :: Typed",
21
+ ]
22
+
23
+ [project.urls]
24
+ Homepage = "https://github.com/JPHutchins/camas"
25
+ Repository = "https://github.com/JPHutchins/camas"
26
+ Issues = "https://github.com/JPHutchins/camas/issues"
27
+
28
+ [project.scripts]
29
+ camas = "camas.main:main"
30
+
31
+ [build-system]
32
+ requires = ["hatchling", "hatch-vcs"]
33
+ build-backend = "hatchling.build"
34
+
35
+ [tool.hatch.version]
36
+ source = "vcs"
37
+
38
+ [dependency-groups]
39
+ dev = [
40
+ "mypy>=1.19",
41
+ "pyright>=1.1.408",
42
+ "pytest>=9,<10",
43
+ "pytest-cov>=7.0.0",
44
+ "cyclopts>=4,<5",
45
+ "ruff>=0.12.0",
46
+ "ty>=0.0.31,<1",
47
+ "zuban>=0.7,<1",
48
+ "pyrefly>=0.61,<1",
49
+ ]
50
+
51
+ [tool.camas.tasks]
52
+ format = "uv run ruff format ."
53
+ lint = "uv run ruff check ."
54
+ mypy = "uv run mypy ."
55
+ ty = "uv run ty check"
56
+ zuban = "uv run zuban check"
57
+ pyrefly = "uv run pyrefly check"
58
+ pyright = "uv run pyright src tests"
59
+ typecheck = "Parallel(tasks=(mypy, pyright, ty, zuban, pyrefly))"
60
+ test = "pytest --doctest-modules -v -m 'not slow'"
61
+ coverage = "pytest --doctest-modules -m 'not slow' --cov --cov-report=term-missing"
62
+ all = '''
63
+ Sequential(tasks=(
64
+ format,
65
+ Parallel(tasks=(lint, typecheck, test)),
66
+ ))
67
+ '''
68
+ matrix = '''
69
+ Parallel(
70
+ tasks=(all,),
71
+ matrix={"UV_PROJECT_ENVIRONMENT": (
72
+ ".venv-3.12",
73
+ ".venv-3.13",
74
+ ".venv-3.14"
75
+ )},
76
+ )
77
+ '''
78
+
79
+ [tool.pytest.ini_options]
80
+ testpaths = ["src", "tests"]
81
+ markers = ["slow: visual demo tests with real delays"]
82
+
83
+ [tool.ruff]
84
+ line-length = 100
85
+
86
+ [tool.ruff.lint]
87
+ extend-select = ["I"]
88
+
89
+ [tool.ruff.format]
90
+ indent-style = "tab"
91
+
92
+ [tool.mypy]
93
+ strict = true
94
+ warn_unused_ignores = true
95
+
96
+ [tool.pyright]
97
+ typeCheckingMode = "strict"
98
+ include = ["src", "tests"]
99
+
100
+ [tool.coverage.run]
101
+ source = ["camas", "tests"]
102
+ branch = true
103
+ omit = ["tests/test_demos.py", "src/camas/__main__.py"]
104
+
105
+ [tool.coverage.report]
106
+ fail_under = 100
107
+ partial_branches = ["pragma: no branch", "case LeafInfo", "case Waiting"]
108
+ exclude_also = ["async for .* in proc\\.stdout"]
109
+ exclude_lines = [
110
+ "@overload",
111
+ "assert_never",
112
+ "case _:",
113
+ "pragma: no cover",
114
+ "if __name__ == .__main__.:",
115
+ "if TYPE_CHECKING",
116
+ ':\s*\.\.\.\s*$',
117
+ '^\s*\.\.\.\s*$',
118
+ "raise AssertionError",
119
+ "@pytest.mark.slow",
120
+ "@app.command",
121
+ ]