op-system 0.1.1__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 (34) hide show
  1. op_system-0.1.1/.github/workflows/ci.yaml +103 -0
  2. op_system-0.1.1/.github/workflows/gh-pages.yaml +108 -0
  3. op_system-0.1.1/.github/workflows/release.yaml +196 -0
  4. op_system-0.1.1/.gitignore +172 -0
  5. op_system-0.1.1/LICENSE +21 -0
  6. op_system-0.1.1/PKG-INFO +459 -0
  7. op_system-0.1.1/README.md +414 -0
  8. op_system-0.1.1/docs/api-reference/.gitignore +1 -0
  9. op_system-0.1.1/docs/development/creating-a-release.md +132 -0
  10. op_system-0.1.1/docs/guides/getting-started.md +16 -0
  11. op_system-0.1.1/docs/index.md +3 -0
  12. op_system-0.1.1/flepimop2-op_system/LICENSE +676 -0
  13. op_system-0.1.1/flepimop2-op_system/README.md +5 -0
  14. op_system-0.1.1/flepimop2-op_system/pyproject.toml +86 -0
  15. op_system-0.1.1/flepimop2-op_system/src/flepimop2/system/op_system/__init__.py +325 -0
  16. op_system-0.1.1/flepimop2-op_system/src/flepimop2/system/op_system/py.typed +1 -0
  17. op_system-0.1.1/flepimop2-op_system/tests/test_system.py +432 -0
  18. op_system-0.1.1/justfile +209 -0
  19. op_system-0.1.1/mkdocs.yml +53 -0
  20. op_system-0.1.1/overrides/main.html +8 -0
  21. op_system-0.1.1/pyproject.toml +99 -0
  22. op_system-0.1.1/scripts/__init__.py +1 -0
  23. op_system-0.1.1/scripts/api-reference.py +209 -0
  24. op_system-0.1.1/scripts/release_validate.py +108 -0
  25. op_system-0.1.1/src/op_system/__init__.py +85 -0
  26. op_system-0.1.1/src/op_system/_identifer_string.py +103 -0
  27. op_system-0.1.1/src/op_system/_state_string.py +161 -0
  28. op_system-0.1.1/src/op_system/compile.py +499 -0
  29. op_system-0.1.1/src/op_system/py.typed +0 -0
  30. op_system-0.1.1/src/op_system/specs.py +2309 -0
  31. op_system-0.1.1/tests/conftest.py +3 -0
  32. op_system-0.1.1/tests/op_system/test__version__.py +8 -0
  33. op_system-0.1.1/tests/op_system/test_op_system_compile.py +400 -0
  34. op_system-0.1.1/tests/op_system/test_op_system_specs.py +1207 -0
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: 'ci'
3
+
4
+ 'on':
5
+ pull_request:
6
+ branches:
7
+ - 'main'
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: 'read'
12
+
13
+ jobs:
14
+ docs:
15
+ name: 'docs'
16
+ runs-on: 'ubuntu-latest'
17
+ steps:
18
+ - name: 'checkout repository'
19
+ uses: 'actions/checkout@v6'
20
+ with:
21
+ persist-credentials: false
22
+ - name: 'install just'
23
+ uses: 'extractions/setup-just@v3'
24
+ - name: 'setup uv'
25
+ uses: 'astral-sh/setup-uv@v7'
26
+ with:
27
+ enable-cache: true
28
+ cache-dependency-glob: '**/pyproject.toml'
29
+ python-version: '3.12'
30
+ - name: 'build documentation'
31
+ run: 'just docs'
32
+ env:
33
+ UV_PYTHON_VERSION: '3.12'
34
+ quality:
35
+ name: 'quality'
36
+ runs-on: 'ubuntu-latest'
37
+ steps:
38
+ - name: 'checkout repository'
39
+ uses: 'actions/checkout@v6'
40
+ with:
41
+ persist-credentials: false
42
+ - name: 'install just'
43
+ uses: 'extractions/setup-just@v3'
44
+ - name: 'setup uv'
45
+ uses: 'astral-sh/setup-uv@v7'
46
+ with:
47
+ enable-cache: true
48
+ cache-dependency-glob: '**/pyproject.toml'
49
+ python-version: '3.12'
50
+ - name: 'run quality checks'
51
+ run: 'just quality'
52
+ env:
53
+ UV_PYTHON_VERSION: '3.12'
54
+ build-check:
55
+ name: 'build-check'
56
+ runs-on: 'ubuntu-latest'
57
+ steps:
58
+ - name: 'checkout repository'
59
+ uses: 'actions/checkout@v6'
60
+ with:
61
+ persist-credentials: false
62
+ - name: 'install just'
63
+ uses: 'extractions/setup-just@v3'
64
+ - name: 'setup uv'
65
+ uses: 'astral-sh/setup-uv@v7'
66
+ with:
67
+ enable-cache: true
68
+ cache-dependency-glob: '**/pyproject.toml'
69
+ python-version: '3.12'
70
+ - name: 'run build validation'
71
+ run: 'just build-check'
72
+ env:
73
+ UV_PYTHON_VERSION: '3.12'
74
+ tests:
75
+ name: 'tests (${{ matrix.python-version }})'
76
+ needs:
77
+ - 'quality'
78
+ - 'docs'
79
+ - 'build-check'
80
+ runs-on: 'ubuntu-latest'
81
+ strategy:
82
+ matrix:
83
+ python-version:
84
+ - '3.11'
85
+ - '3.12'
86
+ - '3.13'
87
+ steps:
88
+ - name: 'checkout repository'
89
+ uses: 'actions/checkout@v6'
90
+ with:
91
+ persist-credentials: false
92
+ - name: 'install just'
93
+ uses: 'extractions/setup-just@v3'
94
+ - name: 'setup uv with python ${{ matrix.python-version }}'
95
+ uses: 'astral-sh/setup-uv@v7'
96
+ with:
97
+ enable-cache: true
98
+ cache-dependency-glob: '**/pyproject.toml'
99
+ python-version: '${{ matrix.python-version }}'
100
+ - name: 'run test suite'
101
+ run: 'just test'
102
+ env:
103
+ UV_PYTHON_VERSION: '${{ matrix.python-version }}'
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: 'GitHub Pages Documentation'
3
+
4
+ 'on':
5
+ push:
6
+ branches:
7
+ - 'main'
8
+ workflow_call:
9
+ inputs:
10
+ deploy-mode:
11
+ description: 'Deployment mode used to determine docs aliases'
12
+ required: false
13
+ default: 'push'
14
+ type: 'string'
15
+ workflow_dispatch:
16
+ inputs:
17
+ deploy-mode:
18
+ description: 'Deployment mode used to determine docs aliases'
19
+ required: false
20
+ default: 'push'
21
+ type: 'choice'
22
+ options:
23
+ - 'push'
24
+ - 'release'
25
+
26
+ concurrency:
27
+ group: ${{ github.workflow }}-${{ github.ref }}
28
+ cancel-in-progress: true
29
+
30
+ permissions:
31
+ contents: 'read'
32
+
33
+ jobs:
34
+ deploy:
35
+ name: 'Deploy Documentation to GitHub Pages'
36
+ runs-on: 'ubuntu-latest'
37
+ strategy:
38
+ matrix:
39
+ python-version:
40
+ - '3.12'
41
+ permissions:
42
+ contents: 'write' # Needed to push to gh-pages
43
+ steps:
44
+ - name: 'Checkout repository'
45
+ uses: 'actions/checkout@v6'
46
+ with:
47
+ ref: 'main'
48
+ persist-credentials: true
49
+ - name: 'Fetch gh-pages branch'
50
+ run: |
51
+ git fetch origin gh-pages:gh-pages --depth=1
52
+ git config --global user.name "${ACTOR}"
53
+ git config --global user.email "${ACTOR}@users.noreply.github.com"
54
+ env:
55
+ ACTOR: "${{ github.actor }}"
56
+ - name: 'Install just'
57
+ uses: 'extractions/setup-just@v3'
58
+ - name: 'Setup uv with python ${{ matrix.python-version }}'
59
+ uses: 'astral-sh/setup-uv@v7'
60
+ with:
61
+ enable-cache: true
62
+ cache-dependency-glob: 'pyproject.toml'
63
+ python-version: '${{ matrix.python-version }}'
64
+ - name: 'Extract op_system version'
65
+ id: extract-version
66
+ run: |
67
+ cat > version.py << EOF
68
+ import tomllib
69
+ with open('pyproject.toml', 'rb') as f:
70
+ data = tomllib.load(f)
71
+ version = data['project']['version']
72
+ version = '.'.join(version.split('.')[:2])
73
+ print(f"version={version}")
74
+ EOF
75
+ uv run -qq python version.py >> $GITHUB_OUTPUT
76
+ rm version.py
77
+ - name: 'Build API Reference'
78
+ run: 'just api-reference'
79
+ - name: 'Determine deploy mode'
80
+ id: determine-mode
81
+ run: |
82
+ if [ "${EVENT_NAME}" = "workflow_call" ]; then
83
+ echo "deploy-mode=${CALL_MODE}" >> "${GITHUB_OUTPUT}"
84
+ elif [ "${EVENT_NAME}" = "workflow_dispatch" ] \
85
+ && [ -n "${DISPATCH_MODE}" ]; then
86
+ echo "deploy-mode=${DISPATCH_MODE}" >> "${GITHUB_OUTPUT}"
87
+ else
88
+ echo "deploy-mode=push" >> "${GITHUB_OUTPUT}"
89
+ fi
90
+ env:
91
+ CALL_MODE: '${{ inputs.deploy-mode }}'
92
+ DISPATCH_MODE: '${{ github.event.inputs.deploy-mode }}'
93
+ EVENT_NAME: '${{ github.event_name }}'
94
+ - name: 'Deploy to GitHub Pages'
95
+ run: |
96
+ uv run mike set-default latest
97
+ if [ "${DEPLOY_MODE}" = "release" ] || [[ $VERSION == 0* ]]; then
98
+ ALIAS=latest
99
+ else
100
+ ALIAS=dev
101
+ fi
102
+ uv run mike deploy \
103
+ --push --update-aliases \
104
+ ${VERSION} ${ALIAS}
105
+ env:
106
+ DEPLOY_MODE: "${{ steps.determine-mode.outputs.deploy-mode }}"
107
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
108
+ VERSION: "${{ steps.extract-version.outputs.version }}"
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: 'Release'
3
+
4
+ 'on':
5
+ workflow_dispatch:
6
+ inputs:
7
+ publish-target:
8
+ description: 'Package publish target'
9
+ required: true
10
+ default: 'none'
11
+ type: 'choice'
12
+ options:
13
+ - 'none'
14
+ - 'testpypi'
15
+ - 'pypi'
16
+ create-github-release:
17
+ description: 'Create the GitHub release after publishing'
18
+ required: true
19
+ default: false
20
+ type: 'boolean'
21
+ deploy-docs:
22
+ description: 'Deploy versioned docs after creating the GitHub release'
23
+ required: true
24
+ default: false
25
+ type: 'boolean'
26
+
27
+ permissions:
28
+ contents: 'read'
29
+
30
+ jobs:
31
+ validate:
32
+ name: 'Validate release'
33
+ runs-on: 'ubuntu-latest'
34
+ outputs:
35
+ version: '${{ steps.validate-version.outputs.version }}'
36
+ docs-version: '${{ steps.validate-version.outputs.docs-version }}'
37
+ prerelease: '${{ steps.validate-version.outputs.prerelease }}'
38
+ steps:
39
+ - name: 'Install just'
40
+ uses: 'extractions/setup-just@v3'
41
+ - name: 'Checkout repository'
42
+ uses: 'actions/checkout@v6'
43
+ with:
44
+ fetch-depth: 0
45
+ persist-credentials: false
46
+ - name: 'Setup uv with python 3.12'
47
+ uses: 'astral-sh/setup-uv@v7.2.0'
48
+ with:
49
+ enable-cache: true
50
+ cache-dependency-glob: |
51
+ pyproject.toml
52
+ flepimop2-op_system/pyproject.toml
53
+ python-version: '3.12'
54
+ - name: 'Validate shared package version'
55
+ id: validate-version
56
+ run: 'uv run python scripts/release_validate.py --github-output "${GITHUB_OUTPUT}"'
57
+ - name: 'Run release build validation'
58
+ run: 'just build-all'
59
+ env:
60
+ UV_PYTHON_VERSION: '3.12'
61
+ - name: 'Build core release artifacts'
62
+ run: |
63
+ rm -rf release-dist
64
+ mkdir -p release-dist/op_system
65
+ uv run --with build --with twine python -m build --outdir release-dist/op_system
66
+ uv run --with twine python -m twine check --strict release-dist/op_system/*
67
+ - name: 'Build provider release artifacts'
68
+ run: |
69
+ mkdir -p release-dist/flepimop2-op_system
70
+ cd flepimop2-op_system
71
+ uv run --with build --with twine python -m build --outdir ../release-dist/flepimop2-op_system
72
+ uv run --with twine python -m twine check --strict ../release-dist/flepimop2-op_system/*
73
+ - name: 'Upload core package artifacts'
74
+ uses: 'actions/upload-artifact@v4'
75
+ with:
76
+ name: 'op-system-dist'
77
+ path: 'release-dist/op_system/*'
78
+ if-no-files-found: 'error'
79
+ - name: 'Upload provider package artifacts'
80
+ uses: 'actions/upload-artifact@v4'
81
+ with:
82
+ name: 'flepimop2-op-system-dist'
83
+ path: 'release-dist/flepimop2-op_system/*'
84
+ if-no-files-found: 'error'
85
+
86
+ publish-core:
87
+ name: 'Publish op_system'
88
+ needs:
89
+ - 'validate'
90
+ runs-on: 'ubuntu-latest'
91
+ env:
92
+ PACKAGE_DIST_DIR: 'dist/op_system'
93
+ permissions:
94
+ id-token: 'write'
95
+ steps:
96
+ - name: 'Skip core publish'
97
+ if: "${{ github.event.inputs.publish-target == 'none' }}"
98
+ run: 'echo "publish-target=none; skipping op_system publish."'
99
+ - name: 'Download core package artifacts'
100
+ if: "${{ github.event.inputs.publish-target != 'none' }}"
101
+ uses: 'actions/download-artifact@v4'
102
+ with:
103
+ name: 'op-system-dist'
104
+ path: '${{ env.PACKAGE_DIST_DIR }}'
105
+ - name: 'Publish core package to TestPyPI'
106
+ if: "${{ github.event.inputs.publish-target == 'testpypi' }}"
107
+ uses: 'pypa/gh-action-pypi-publish@release/v1'
108
+ with:
109
+ packages-dir: '${{ env.PACKAGE_DIST_DIR }}'
110
+ repository-url: 'https://test.pypi.org/legacy/'
111
+ - name: 'Publish core package to PyPI'
112
+ if: "${{ github.event.inputs.publish-target == 'pypi' }}"
113
+ uses: 'pypa/gh-action-pypi-publish@release/v1'
114
+ with:
115
+ packages-dir: '${{ env.PACKAGE_DIST_DIR }}'
116
+
117
+ publish-provider:
118
+ name: 'Publish flepimop2-op_system'
119
+ needs:
120
+ - 'validate'
121
+ - 'publish-core'
122
+ runs-on: 'ubuntu-latest'
123
+ env:
124
+ PACKAGE_DIST_DIR: 'dist/flepimop2-op_system'
125
+ permissions:
126
+ id-token: 'write'
127
+ steps:
128
+ - name: 'Skip provider publish'
129
+ if: "${{ github.event.inputs.publish-target == 'none' }}"
130
+ run: 'echo "publish-target=none; skipping flepimop2-op_system publish."'
131
+ - name: 'Download provider package artifacts'
132
+ if: "${{ github.event.inputs.publish-target != 'none' }}"
133
+ uses: 'actions/download-artifact@v4'
134
+ with:
135
+ name: 'flepimop2-op-system-dist'
136
+ path: '${{ env.PACKAGE_DIST_DIR }}'
137
+ - name: 'Publish provider package to TestPyPI'
138
+ if: "${{ github.event.inputs.publish-target == 'testpypi' }}"
139
+ uses: 'pypa/gh-action-pypi-publish@release/v1'
140
+ with:
141
+ packages-dir: '${{ env.PACKAGE_DIST_DIR }}'
142
+ repository-url: 'https://test.pypi.org/legacy/'
143
+ - name: 'Publish provider package to PyPI'
144
+ if: "${{ github.event.inputs.publish-target == 'pypi' }}"
145
+ uses: 'pypa/gh-action-pypi-publish@release/v1'
146
+ with:
147
+ packages-dir: '${{ env.PACKAGE_DIST_DIR }}'
148
+
149
+ create-github-release:
150
+ name: 'Create GitHub release'
151
+ needs:
152
+ - 'validate'
153
+ - 'publish-provider'
154
+ if: >-
155
+ ${{
156
+ github.event.inputs.create-github-release == 'true' &&
157
+ (github.event.inputs.publish-target == 'none' ||
158
+ needs.publish-provider.result == 'success')
159
+ }}
160
+ runs-on: 'ubuntu-latest'
161
+ permissions:
162
+ contents: 'write'
163
+ steps:
164
+ - name: 'Create release'
165
+ run: |
166
+ ARGS=(
167
+ release create "v${VERSION}"
168
+ --target "${GITHUB_SHA}"
169
+ --title "v${VERSION}"
170
+ --generate-notes
171
+ )
172
+ if [ "${PRERELEASE}" = 'true' ]; then
173
+ ARGS+=(--prerelease)
174
+ fi
175
+ gh "${ARGS[@]}"
176
+ env:
177
+ GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
178
+ GITHUB_SHA: '${{ github.sha }}'
179
+ PRERELEASE: '${{ needs.validate.outputs.prerelease }}'
180
+ VERSION: '${{ needs.validate.outputs.version }}'
181
+
182
+ deploy-docs:
183
+ name: 'Deploy release docs'
184
+ needs:
185
+ - 'create-github-release'
186
+ if: >-
187
+ ${{
188
+ github.event.inputs.deploy-docs == 'true' &&
189
+ needs.create-github-release.result == 'success'
190
+ }}
191
+ permissions:
192
+ contents: 'write'
193
+ uses: './.github/workflows/gh-pages.yaml'
194
+ with:
195
+ deploy-mode: 'release'
196
+ secrets: 'inherit'
@@ -0,0 +1,172 @@
1
+ # ================================
2
+ # Python bytecode / cache
3
+ # ================================
4
+ __pycache__/
5
+ *.py[codz]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # ================================
12
+ # Distribution / packaging
13
+ # ================================
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # ================================
34
+ # PyInstaller
35
+ # ================================
36
+ *.manifest
37
+ *.spec
38
+
39
+ # ================================
40
+ # Logs / coverage / testing
41
+ # ================================
42
+ pip-log.txt
43
+ pip-delete-this-directory.txt
44
+
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # ================================
60
+ # Localization
61
+ # ================================
62
+ *.mo
63
+ *.pot
64
+
65
+ # ================================
66
+ # Framework-specific
67
+ # ================================
68
+ *.log
69
+ local_settings.py
70
+ db.sqlite3
71
+ db.sqlite3-journal
72
+
73
+ instance/
74
+ .webassets-cache
75
+ .scrapy
76
+
77
+ docs/_build/
78
+
79
+ .pybuilder/
80
+ target/
81
+
82
+ # ================================
83
+ # Jupyter / IPython
84
+ # ================================
85
+ .ipynb_checkpoints
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # ================================
90
+ # Python env managers
91
+ # ================================
92
+ .python-version
93
+
94
+ # ================================
95
+ # Dependency managers
96
+ # ================================
97
+ uv.lock
98
+
99
+ .pdm-python
100
+ .pdm-build/
101
+
102
+ .pixi
103
+
104
+ __pypackages__/
105
+
106
+ # ================================
107
+ # Runtime artifacts
108
+ # ================================
109
+ celerybeat-schedule
110
+ celerybeat.pid
111
+
112
+ *.sage.py
113
+
114
+ # ================================
115
+ # Virtual environments
116
+ # ================================
117
+ .env
118
+ .envrc
119
+ .venv
120
+ env/
121
+ venv/
122
+ ENV/
123
+ env.bak/
124
+ venv.bak/
125
+
126
+ # ================================
127
+ # IDEs / Editors
128
+ # ================================
129
+ .spyderproject
130
+ .spyproject
131
+ .ropeproject
132
+
133
+ /site
134
+
135
+ .mypy_cache/
136
+ .dmypy.json
137
+ dmypy.json
138
+
139
+ .pyre/
140
+ .pytype/
141
+
142
+ cython_debug/
143
+
144
+ .ruff_cache/
145
+
146
+ .pypirc
147
+
148
+ .cursorignore
149
+ .cursorindexingignore
150
+
151
+ marimo/_static/
152
+ marimo/_lsp/
153
+ __marimo__/
154
+
155
+ # ================================
156
+ # Example output artifacts
157
+ # ================================
158
+
159
+ # Matplotlib / plotting outputs
160
+ *.png
161
+ *.pdf
162
+ *.svg
163
+
164
+ # Numpy saved arrays
165
+ *.npy
166
+ *.npz
167
+
168
+ # CSV outputs from examples
169
+ *.csv
170
+
171
+ # Optional example output directory convention
172
+ examples/output/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joshua Macdonald, Carl Pearson, and Timothy Willard
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.