disco-tools 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,30 @@
1
+ name: Build (pure Python)
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-22.04
12
+ steps:
13
+ - name: Check out
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Build sdist + wheel (pure)
22
+ run: |
23
+ python -m pip install -U pip build
24
+ python -m build # produces dist/*.tar.gz and dist/*.whl (py3-none-any)
25
+
26
+ - name: Upload artifacts
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist/*
@@ -0,0 +1,84 @@
1
+ name: release-publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch: # manual run
7
+ inputs:
8
+ publish_target:
9
+ description: "Publish when run manually?"
10
+ required: true
11
+ default: "none"
12
+ type: choice
13
+ options: [ "none", "testpypi", "pypi" ]
14
+
15
+ jobs:
16
+ build-and-publish:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ id-token: write # required for PyPI Trusted Publisher (OIDC)
20
+ contents: read
21
+
22
+ steps:
23
+ - name: ๐Ÿงฉ Checkout source at the release tag (with tags)
24
+ uses: actions/checkout@v4
25
+ with:
26
+ ref: ${{ github.event.release.tag_name }} # e.g., v0.1.0
27
+ fetch-depth: 0 # full history
28
+ fetch-tags: true # ensure tags are present
29
+
30
+ - name: ๐Ÿ Set up Python
31
+ uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+
35
+ - name: ๐Ÿ“ฆ Install build tools
36
+ run: |
37
+ python -m pip install -U pip setuptools wheel build twine setuptools-scm
38
+
39
+ - name: ๐Ÿ—๏ธ Build sdist + universal wheel
40
+ run: |
41
+ rm -rf dist build *.egg-info **/*.egg-info
42
+ python -m build --sdist --wheel
43
+ python -m twine check dist/*
44
+
45
+ - name: ๐Ÿ”Ž Inspect wheel METADATA
46
+ run: |
47
+ python - <<'PY'
48
+ import zipfile, pathlib
49
+ whls = sorted(pathlib.Path("dist").glob("*.whl"))
50
+ assert whls, "No wheels found in dist/"
51
+ with zipfile.ZipFile(whls[-1]) as z:
52
+ meta = [n for n in z.namelist() if n.endswith('.dist-info/METADATA')]
53
+ assert meta, "No METADATA in wheel"
54
+ data = z.read(meta[0]).decode()
55
+ print("--- METADATA header ---")
56
+ for k in ("Metadata-Version", "Name:", "Version:"):
57
+ print(next((line for line in data.splitlines() if line.startswith(k)), f"{k} MISSING"))
58
+ print("-----------------------")
59
+ PY
60
+
61
+ - name: ๐Ÿ“‹ List built artifacts
62
+ run: ls -lh dist
63
+
64
+ - name: ๐Ÿงช Determine publish target
65
+ id: target
66
+ run: |
67
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
68
+ echo "manual=${{ github.event.inputs.publish_target }}" >> "$GITHUB_OUTPUT"
69
+ else
70
+ echo "manual=none" >> "$GITHUB_OUTPUT"
71
+ fi
72
+
73
+ - name: ๐Ÿš€ Publish to PyPI
74
+ if: github.event_name == 'release' || steps.target.outputs.manual == 'pypi'
75
+ uses: pypa/gh-action-pypi-publish@release/v1
76
+ with:
77
+ skip-existing: true
78
+
79
+ - name: ๐Ÿš€ Publish to TestPyPI
80
+ if: steps.target.outputs.manual == 'testpypi'
81
+ uses: pypa/gh-action-pypi-publish@release/v1
82
+ with:
83
+ repository-url: https://test.pypi.org/legacy/
84
+ skip-existing: true
@@ -0,0 +1,17 @@
1
+ name: Tests
2
+ on: { push: { branches: [ main ] }, pull_request: {} }
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-22.04
7
+ steps:
8
+ - uses: actions/checkout@v4
9
+ with: { fetch-depth: 0 }
10
+ - uses: actions/setup-python@v5
11
+ with: { python-version: "3.12" }
12
+ - run: |
13
+ python -m pip install -U pip
14
+ pip install -e '.[dev,parquet]'
15
+ pytest -q
16
+ mypy src/tools
17
+
@@ -0,0 +1,224 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+ *.pyd
9
+ *.dll
10
+ *.dylib
11
+
12
+ # Native build artifacts
13
+ *.o
14
+ *.obj
15
+ *.a
16
+ *.lib
17
+ *.exp
18
+ *.pdb
19
+ *.pch
20
+ *.lo
21
+ *.la
22
+ *.mod
23
+ *.asm
24
+ *.s
25
+
26
+ # macOS / Xcode debug symbols
27
+ *.dSYM/
28
+
29
+ # Distribution / packaging
30
+ .Python
31
+ build/
32
+ develop-eggs/
33
+ dist/
34
+ downloads/
35
+ eggs/
36
+ .eggs/
37
+ lib/
38
+ lib64/
39
+ parts/
40
+ sdist/
41
+ var/
42
+ wheels/
43
+ share/python-wheels/
44
+ *.egg-info/
45
+ .installed.cfg
46
+ *.egg
47
+ MANIFEST
48
+ wheelhouse/
49
+
50
+ # scikit-build / CMake (classic & core)
51
+ _skbuild/
52
+ CMakeCache.txt
53
+ CMakeFiles/
54
+ cmake-build-*/
55
+ CMakeUserPresets.json
56
+ CMakeScripts/
57
+ Makefile
58
+ cmake_install.cmake
59
+ install_manifest.txt
60
+
61
+ # PyInstaller
62
+ *.manifest
63
+ *.spec
64
+
65
+ # Installer logs
66
+ pip-log.txt
67
+ pip-delete-this-directory.txt
68
+
69
+ # Unit test / coverage reports
70
+ htmlcov/
71
+ .tox/
72
+ .nox/
73
+ .coverage
74
+ .coverage.*
75
+ .cache
76
+ nosetests.xml
77
+ coverage.xml
78
+ *.cover
79
+ *.py.cover
80
+ .hypothesis/
81
+ .pytest_cache/
82
+ cover/
83
+ # C/C++ coverage
84
+ *.gcda
85
+ *.gcno
86
+ *.gcov
87
+
88
+ # Translations
89
+ *.mo
90
+ *.pot
91
+
92
+ # Django stuff:
93
+ *.log
94
+ local_settings.py
95
+ db.sqlite3
96
+ db.sqlite3-journal
97
+
98
+ # Flask stuff:
99
+ instance/
100
+ .webassets-cache
101
+
102
+ # Scrapy stuff:
103
+ .scrapy
104
+
105
+ # Sphinx documentation
106
+ docs/_build/
107
+
108
+ # PyBuilder
109
+ .pybuilder/
110
+ target/
111
+
112
+ # Jupyter Notebook
113
+ .ipynb_checkpoints
114
+
115
+ # IPython
116
+ profile_default/
117
+ ipython_config.py
118
+
119
+ # pyenv
120
+ # .python-version
121
+
122
+ # pipenv
123
+ #Pipfile.lock
124
+
125
+ # UV
126
+ #uv.lock
127
+
128
+ # poetry
129
+ #poetry.lock
130
+ #poetry.toml
131
+
132
+ # pdm
133
+ #pdm.lock
134
+ #pdm.toml
135
+ .pdm-python
136
+ .pdm-build/
137
+
138
+ # pixi
139
+ #pixi.lock
140
+ .pixi
141
+
142
+ # PEP 582
143
+ __pypackages__/
144
+
145
+ # Celery stuff
146
+ celerybeat-schedule
147
+ celerybeat.pid
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ .venv-*
157
+ env/
158
+ venv/
159
+ ENV/
160
+ env.bak/
161
+ venv.bak/
162
+
163
+ # Spyder project settings
164
+ .spyderproject
165
+ .spyproject
166
+
167
+ # Rope project settings
168
+ .ropeproject
169
+
170
+ # mkdocs documentation
171
+ /site
172
+
173
+ # mypy
174
+ .mypy_cache/
175
+ .dmypy.json
176
+ dmypy.json
177
+
178
+ # Pyre type checker
179
+ .pyre/
180
+
181
+ # pytype static type analyzer
182
+ .pytype/
183
+
184
+ # Cython debug symbols
185
+ cython_debug/
186
+
187
+ # PyCharm / JetBrains (keep project-specific files if you prefer)
188
+ # See: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ .idea/
190
+
191
+ # Abstra
192
+ .abstra/
193
+
194
+ # Visual Studio Code
195
+ # .vscode/
196
+
197
+ # Ruff
198
+ .ruff_cache/
199
+
200
+ # PyPI configuration
201
+ .pypirc
202
+
203
+ # Cursor
204
+ .cursorignore
205
+ .cursorindexingignore
206
+
207
+ # Marimo
208
+ marimo/_static/
209
+ marimo/_lsp/
210
+ __marimo__/
211
+
212
+ # OS cruft
213
+ .DS_Store
214
+ Thumbs.db
215
+ Icon?
216
+
217
+ # setuptools-scm generated version file
218
+ src/tools/_version.py
219
+
220
+ # tmp segments generated in tests
221
+ tmp_segments/
222
+
223
+ # local scripts not to include
224
+ scripts/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michiel Jansen
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,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: disco-tools
3
+ Version: 0.1.0
4
+ Summary: Common tools for disco simulation engine.
5
+ Author: Michiel Jansen
6
+ License: MIT
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: numpy>=1.23
17
+ Requires-Dist: pyyaml>=6.0
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest>=8; extra == "dev"
20
+ Requires-Dist: pytest-cov>=5; extra == "dev"
21
+ Requires-Dist: mypy>=1.10; extra == "dev"
22
+ Requires-Dist: twine>=5; extra == "dev"
23
+ Requires-Dist: types-pyyaml>=6.0; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # ๐Ÿงพ disco-tools
27
+
28
+ **{{project_description}}**
29
+
30
+ [![PyPI](https://img.shields.io/pypi/v/disco-tools.svg)](https://pypi.org/project/disco-tools/)
31
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
32
+ [![Build](https://github.com/michielmj/disco-tools/actions/workflows/build.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)
33
+ [![Tests](https://github.com/michielmj/disco-tools/actions/workflows/test.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)
34
+
35
+ ---
36
+
37
+ ## ๐Ÿงญ Overview
38
+
39
+ `disco-tools` is a collection of reusable Python utilities supporting simulation, analytics, and data-driven decision systems.
40
+ It provides modular building blocks for working with metadata, scheduling, simulation orchestration, and system integration.
41
+
42
+ Each tool is designed to be:
43
+ - **Lightweight** โ€” minimal dependencies
44
+ - **Composable** โ€” works as a standalone library or inside larger systems
45
+ - **Fast** โ€” optimized for high-throughput, data-heavy environments
46
+
47
+ Documentation for individual modules is available in the [`docs/`](docs) folder.
48
+
49
+ ---
50
+
51
+ ## โœจ Features
52
+
53
+ - โš™๏ธ **Label Selector** โ€” Fast rule engine for qualifying and filtering metadata
54
+ โ†’ [Read documentation โ€บ](docs/label_selector.md)
55
+
56
+ - ๐Ÿ—“๏ธ **Scheduler Utilities** โ€” Tools for time- and resource-based planning (coming soon)
57
+ - ๐Ÿงฉ **Simulation Helpers** โ€” Common components for distributed simulation (coming soon)
58
+ - ๐Ÿงฎ **Data Utilities** โ€” Lightweight statistical and transformation helpers (coming soon)
59
+
60
+ ---
61
+
62
+ ## ๐Ÿš€ Installation
63
+
64
+ ```bash
65
+ pip install disco-tools
66
+ ```
67
+
68
+ ---
69
+
70
+ ## ๐Ÿงฐ Development Setup
71
+
72
+ Clone and install in editable mode:
73
+
74
+ ```bash
75
+ git clone https://github.com/michielmj/disco-tools.git
76
+ cd disco-tools
77
+ pip install -e .[dev]
78
+ ```
79
+
80
+ Run all tests:
81
+
82
+ ```bash
83
+ pytest -q
84
+ ```
85
+
86
+ ---
87
+
88
+ ## ๐Ÿ“š Documentation
89
+
90
+ - [Label Selector](docs/label_selector.md) โ€” fast, composable rule engine for keyโ€“value metadata
91
+ - Additional module docs will be added under the [`docs/`](docs) directory as the toolkit evolves.
92
+
93
+ ---
94
+
95
+ ## ๐Ÿงช Example Usage
96
+
97
+ ```python
98
+ from disco_tools.label_selector import Label, qualifies
99
+
100
+ rule = (Label("env") == "prod") + Label("version").gte(10)
101
+ meta = {"env": "prod", "version": 12}
102
+
103
+ if qualifies(meta, rule):
104
+ print("Match!")
105
+ ```
106
+
107
+ ---
108
+
109
+ ## ๐Ÿงพ License
110
+
111
+ MIT License ยฉ 2025 โ€” part of the **disco-tools** project.
@@ -0,0 +1,86 @@
1
+ # ๐Ÿงพ disco-tools
2
+
3
+ **{{project_description}}**
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/disco-tools.svg)](https://pypi.org/project/disco-tools/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+ [![Build](https://github.com/michielmj/disco-tools/actions/workflows/build.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)
8
+ [![Tests](https://github.com/michielmj/disco-tools/actions/workflows/test.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)
9
+
10
+ ---
11
+
12
+ ## ๐Ÿงญ Overview
13
+
14
+ `disco-tools` is a collection of reusable Python utilities supporting simulation, analytics, and data-driven decision systems.
15
+ It provides modular building blocks for working with metadata, scheduling, simulation orchestration, and system integration.
16
+
17
+ Each tool is designed to be:
18
+ - **Lightweight** โ€” minimal dependencies
19
+ - **Composable** โ€” works as a standalone library or inside larger systems
20
+ - **Fast** โ€” optimized for high-throughput, data-heavy environments
21
+
22
+ Documentation for individual modules is available in the [`docs/`](docs) folder.
23
+
24
+ ---
25
+
26
+ ## โœจ Features
27
+
28
+ - โš™๏ธ **Label Selector** โ€” Fast rule engine for qualifying and filtering metadata
29
+ โ†’ [Read documentation โ€บ](docs/label_selector.md)
30
+
31
+ - ๐Ÿ—“๏ธ **Scheduler Utilities** โ€” Tools for time- and resource-based planning (coming soon)
32
+ - ๐Ÿงฉ **Simulation Helpers** โ€” Common components for distributed simulation (coming soon)
33
+ - ๐Ÿงฎ **Data Utilities** โ€” Lightweight statistical and transformation helpers (coming soon)
34
+
35
+ ---
36
+
37
+ ## ๐Ÿš€ Installation
38
+
39
+ ```bash
40
+ pip install disco-tools
41
+ ```
42
+
43
+ ---
44
+
45
+ ## ๐Ÿงฐ Development Setup
46
+
47
+ Clone and install in editable mode:
48
+
49
+ ```bash
50
+ git clone https://github.com/michielmj/disco-tools.git
51
+ cd disco-tools
52
+ pip install -e .[dev]
53
+ ```
54
+
55
+ Run all tests:
56
+
57
+ ```bash
58
+ pytest -q
59
+ ```
60
+
61
+ ---
62
+
63
+ ## ๐Ÿ“š Documentation
64
+
65
+ - [Label Selector](docs/label_selector.md) โ€” fast, composable rule engine for keyโ€“value metadata
66
+ - Additional module docs will be added under the [`docs/`](docs) directory as the toolkit evolves.
67
+
68
+ ---
69
+
70
+ ## ๐Ÿงช Example Usage
71
+
72
+ ```python
73
+ from disco_tools.label_selector import Label, qualifies
74
+
75
+ rule = (Label("env") == "prod") + Label("version").gte(10)
76
+ meta = {"env": "prod", "version": 12}
77
+
78
+ if qualifies(meta, rule):
79
+ print("Match!")
80
+ ```
81
+
82
+ ---
83
+
84
+ ## ๐Ÿงพ License
85
+
86
+ MIT License ยฉ 2025 โ€” part of the **disco-tools** project.