grip-core-py 0.1.0rc1__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.
Files changed (73) hide show
  1. grip_core_py-0.1.0rc1/.github/workflows/publish.yml +102 -0
  2. grip_core_py-0.1.0rc1/.gitignore +171 -0
  3. grip_core_py-0.1.0rc1/AGENTS.md +39 -0
  4. grip_core_py-0.1.0rc1/LICENSE +504 -0
  5. grip_core_py-0.1.0rc1/PKG-INFO +163 -0
  6. grip_core_py-0.1.0rc1/README.md +147 -0
  7. grip_core_py-0.1.0rc1/RELEASE.md +133 -0
  8. grip_core_py-0.1.0rc1/gearu.toml +24 -0
  9. grip_core_py-0.1.0rc1/pyproject.toml +43 -0
  10. grip_core_py-0.1.0rc1/scripts/check_release.py +75 -0
  11. grip_core_py-0.1.0rc1/src/grip_core/__init__.py +165 -0
  12. grip_core_py-0.1.0rc1/src/grip_core/core/__init__.py +159 -0
  13. grip_core_py-0.1.0rc1/src/grip_core/core/async_loop.py +90 -0
  14. grip_core_py-0.1.0rc1/src/grip_core/core/async_state_helpers.py +100 -0
  15. grip_core_py-0.1.0rc1/src/grip_core/core/async_stream_tap.py +451 -0
  16. grip_core_py-0.1.0rc1/src/grip_core/core/async_tap.py +854 -0
  17. grip_core_py-0.1.0rc1/src/grip_core/core/atom_tap.py +101 -0
  18. grip_core_py-0.1.0rc1/src/grip_core/core/base_tap.py +223 -0
  19. grip_core_py-0.1.0rc1/src/grip_core/core/context.py +231 -0
  20. grip_core_py-0.1.0rc1/src/grip_core/core/drip.py +522 -0
  21. grip_core_py-0.1.0rc1/src/grip_core/core/errors.py +5 -0
  22. grip_core_py-0.1.0rc1/src/grip_core/core/function_tap.py +168 -0
  23. grip_core_py-0.1.0rc1/src/grip_core/core/graph.py +566 -0
  24. grip_core_py-0.1.0rc1/src/grip_core/core/graph_dump.py +399 -0
  25. grip_core_py-0.1.0rc1/src/grip_core/core/grip.py +263 -0
  26. grip_core_py-0.1.0rc1/src/grip_core/core/grok.py +14 -0
  27. grip_core_py-0.1.0rc1/src/grip_core/core/grok_impl.py +185 -0
  28. grip_core_py-0.1.0rc1/src/grip_core/core/interfaces.py +248 -0
  29. grip_core_py-0.1.0rc1/src/grip_core/core/matcher.py +130 -0
  30. grip_core_py-0.1.0rc1/src/grip_core/core/query.py +120 -0
  31. grip_core_py-0.1.0rc1/src/grip_core/core/query_evaluator.py +290 -0
  32. grip_core_py-0.1.0rc1/src/grip_core/core/tap.py +7 -0
  33. grip_core_py-0.1.0rc1/src/grip_core/core/tap_resolver.py +274 -0
  34. grip_core_py-0.1.0rc1/src/grip_core/core/task_queue.py +253 -0
  35. grip_core_py-0.1.0rc1/src/grip_core/core/use_grip.py +78 -0
  36. grip_core_py-0.1.0rc1/src/grip_core/debug/__init__.py +5 -0
  37. grip_core_py-0.1.0rc1/src/grip_core/debug/qt.py +154 -0
  38. grip_core_py-0.1.0rc1/src/grip_core/debug/snapshot.py +93 -0
  39. grip_core_py-0.1.0rc1/tests/__init__.py +0 -0
  40. grip_core_py-0.1.0rc1/tests/core/__init__.py +0 -0
  41. grip_core_py-0.1.0rc1/tests/core/helpers/__init__.py +0 -0
  42. grip_core_py-0.1.0rc1/tests/core/helpers/test_taps.py +51 -0
  43. grip_core_py-0.1.0rc1/tests/core/test_async_state_helpers.py +74 -0
  44. grip_core_py-0.1.0rc1/tests/core/test_async_stream_tap.py +221 -0
  45. grip_core_py-0.1.0rc1/tests/core/test_async_tap.py +279 -0
  46. grip_core_py-0.1.0rc1/tests/core/test_async_tap_advanced.py +285 -0
  47. grip_core_py-0.1.0rc1/tests/core/test_async_tap_history.py +99 -0
  48. grip_core_py-0.1.0rc1/tests/core/test_async_tap_perf.py +61 -0
  49. grip_core_py-0.1.0rc1/tests/core/test_atom_tap.py +81 -0
  50. grip_core_py-0.1.0rc1/tests/core/test_base_tap_behavior.py +124 -0
  51. grip_core_py-0.1.0rc1/tests/core/test_context.py +86 -0
  52. grip_core_py-0.1.0rc1/tests/core/test_destination_lifecycle.py +70 -0
  53. grip_core_py-0.1.0rc1/tests/core/test_drip.py +309 -0
  54. grip_core_py-0.1.0rc1/tests/core/test_engine.py +90 -0
  55. grip_core_py-0.1.0rc1/tests/core/test_function_tap.py +91 -0
  56. grip_core_py-0.1.0rc1/tests/core/test_function_tap_state_handle.py +79 -0
  57. grip_core_py-0.1.0rc1/tests/core/test_graph_dump.py +109 -0
  58. grip_core_py-0.1.0rc1/tests/core/test_graph_gc.py +189 -0
  59. grip_core_py-0.1.0rc1/tests/core/test_grip.py +23 -0
  60. grip_core_py-0.1.0rc1/tests/core/test_grip_registry.py +131 -0
  61. grip_core_py-0.1.0rc1/tests/core/test_matcher.py +127 -0
  62. grip_core_py-0.1.0rc1/tests/core/test_query_evaluator.py +468 -0
  63. grip_core_py-0.1.0rc1/tests/core/test_query_model.py +40 -0
  64. grip_core_py-0.1.0rc1/tests/core/test_tap_factory.py +133 -0
  65. grip_core_py-0.1.0rc1/tests/core/test_tap_hierarchy_complex.py +205 -0
  66. grip_core_py-0.1.0rc1/tests/core/test_tap_resolver.py +292 -0
  67. grip_core_py-0.1.0rc1/tests/core/test_tap_resolver_delta.py +64 -0
  68. grip_core_py-0.1.0rc1/tests/core/test_task_queue.py +62 -0
  69. grip_core_py-0.1.0rc1/tests/core/test_use_grip.py +21 -0
  70. grip_core_py-0.1.0rc1/tests/core/test_watch_drip.py +96 -0
  71. grip_core_py-0.1.0rc1/tests/debug/test_graph_snapshot.py +43 -0
  72. grip_core_py-0.1.0rc1/tests/debug/test_qt_graph.py +71 -0
  73. grip_core_py-0.1.0rc1/uv.lock +184 -0
@@ -0,0 +1,102 @@
1
+ name: Publish grip-core-py to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ # Manual runs verify the candidate but never upload to PyPI.
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: grip-core-py-pypi
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ verify:
18
+ name: Release checks
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 40
21
+ env:
22
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
23
+ PYTHONDONTWRITEBYTECODE: "1"
24
+ # uv-managed interpreters include Tk; runner-provided ones may not.
25
+ UV_PYTHON_PREFERENCE: only-managed
26
+ steps:
27
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
28
+ with:
29
+ ref: ${{ github.event.release.tag_name || github.sha }}
30
+ persist-credentials: false
31
+
32
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
33
+ with:
34
+ python-version: "3.12"
35
+
36
+ - name: Require package and release version agreement
37
+ run: |
38
+ python -m pip install packaging==25.0
39
+ python - <<'PY'
40
+ import os
41
+ from pathlib import Path
42
+ import tomllib
43
+
44
+ from packaging.version import Version
45
+
46
+ project = tomllib.loads(Path("pyproject.toml").read_text())["project"]
47
+ if project["name"] != "grip-core-py":
48
+ raise SystemExit("Expected the grip-core-py distribution")
49
+ version = project["version"]
50
+ tag = os.environ["RELEASE_TAG"]
51
+ # Tags use SemVer spelling (v1.2.3-rc.1); metadata uses PEP 440 (1.2.3rc1).
52
+ if tag and Version(tag.removeprefix("v")) != Version(version):
53
+ raise SystemExit(f"Release tag {tag!r} does not match v{version}")
54
+ print(f"Verifying grip-core-py {version}")
55
+ PY
56
+
57
+ - name: Install uv and display libraries for Qt and Tk tests
58
+ run: |
59
+ python -m pip install uv==0.12.10
60
+ sudo apt-get update
61
+ sudo apt-get install -y xvfb libegl1 libgl1 libxkbcommon0 libxkbcommon-x11-0 libfontconfig1 libdbus-1-3
62
+
63
+ - name: Run the release checks
64
+ run: xvfb-run -a python scripts/check_release.py
65
+
66
+ - name: Collect the verified distributions
67
+ # The PyPI action uploads the files directly inside packages-dir.
68
+ run: |
69
+ mkdir -p dist
70
+ cp build/release/*/*.whl build/release/*/*.tar.gz dist/
71
+ ls -l dist
72
+
73
+ - name: Retain the verified distributions
74
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
75
+ with:
76
+ name: grip-core-py-distributions
77
+ path: dist/*
78
+ if-no-files-found: error
79
+
80
+ publish:
81
+ name: Publish verified distributions to PyPI
82
+ if: github.event_name == 'release' && github.repository == 'owebeeone/grip-py'
83
+ needs: verify
84
+ runs-on: ubuntu-latest
85
+ timeout-minutes: 10
86
+ permissions:
87
+ id-token: write
88
+ # The PyPI trusted publisher is configured with the "pypi" environment.
89
+ # This workflow uploads artifacts; it does not create tags or GitHub releases.
90
+ environment:
91
+ name: pypi
92
+ url: https://pypi.org/project/grip-core-py/
93
+ steps:
94
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
95
+ with:
96
+ name: grip-core-py-distributions
97
+ path: dist
98
+
99
+ - name: Publish using PyPI trusted publishing
100
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
101
+ with:
102
+ packages-dir: dist/
@@ -0,0 +1,171 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
@@ -0,0 +1,39 @@
1
+ # AGENTS
2
+
3
+ ## Scope
4
+ This file defines repository-specific coding instructions for `grip-py`.
5
+
6
+ ## Design Rules
7
+ - Prefer `@dataclass` for classes that primarily hold state.
8
+ - When a class is not a good dataclass candidate (for example, protocol classes or classes requiring highly custom initialization/slots behavior), keep it as a normal class and document that choice in code review notes or PR description.
9
+ - Keep type annotations complete and precise so IDE inference remains strong.
10
+
11
+ ## Paths in version control
12
+ - Do not store absolute filesystem paths in any committed file; use paths relative to this repository (the `grip-py` submodule root). If a path would cross into a parent monorepo checkout, truncate to the closest submodule root instead of embedding machine-specific prefixes.
13
+
14
+ ## Development Process (TDD)
15
+ Use a strict red/green/refactor workflow for all behavior changes.
16
+
17
+ 1. Red: Add or update tests first to express the expected behavior, then run the smallest relevant test target and confirm it fails.
18
+ 2. Green: Implement the minimal code change required to make the failing test pass.
19
+ 3. Refactor: Improve structure/readability while preserving behavior.
20
+ 4. Verify targeted scope: Re-run the focused test subset.
21
+ 5. Verify full regression: Run the full test suite before finalizing.
22
+
23
+ ## Test Commands
24
+ - Focused tests: `uv run --with pytest --with pytest-cov pytest <test-path> -q`
25
+ - Full suite: `uv run --with pytest --with pytest-cov pytest -q`
26
+
27
+ <!-- gearu:agents:start -->
28
+ ## Releases
29
+
30
+ - This repository uses [Gearu](https://owebeeone.github.io/gearu/) for release
31
+ preparation.
32
+ - Read `RELEASE.md` before planning or performing a release.
33
+ - `gearu plan VERSION` and `gearu plan --bump LEVEL` are read-only. Do not run
34
+ `gearu release`, push a release tag, or create a GitHub Release unless the
35
+ user explicitly requests it.
36
+ - Never move or reuse a release tag. Correct released content with a new version.
37
+ - Never publish directly to PyPI, crates.io, or npm from a local checkout.
38
+ Registry publication belongs in the repository's release workflow.
39
+ <!-- gearu:agents:end -->