spoc 0.2.3__tar.gz → 0.3.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.
- spoc-0.3.0/.github/workflows/docs.yml +37 -0
- spoc-0.3.0/.github/workflows/release.yml +41 -0
- spoc-0.3.0/.gitignore +136 -0
- spoc-0.3.0/.prettierignore +1 -0
- spoc-0.3.0/CONTRIBUTING.md +0 -0
- spoc-0.2.3/README.md → spoc-0.3.0/PKG-INFO +9 -21
- spoc-0.3.0/README.md +30 -0
- spoc-0.3.0/Taskfile.yml +263 -0
- spoc-0.3.0/docs/.gitignore +1 -0
- spoc-0.3.0/docs/custom_theme/css/extra.css +57 -0
- spoc-0.3.0/docs/custom_theme/main.html +14 -0
- spoc-0.3.0/docs/docs/advanced/lifecycle.md +1455 -0
- spoc-0.3.0/docs/docs/advanced/plugins.md +1098 -0
- spoc-0.3.0/docs/docs/advanced/workers.md +967 -0
- spoc-0.3.0/docs/docs/api/components.md +41 -0
- spoc-0.3.0/docs/docs/api/core-utils.md +149 -0
- spoc-0.3.0/docs/docs/api/framework.md +38 -0
- spoc-0.3.0/docs/docs/api/importer.md +50 -0
- spoc-0.3.0/docs/docs/api/tools.md +42 -0
- spoc-0.3.0/docs/docs/api/workers.md +25 -0
- spoc-0.3.0/docs/docs/assets/images/logo.png +0 -0
- spoc-0.3.0/docs/docs/assets/images/title.png +0 -0
- spoc-0.3.0/docs/docs/contributing.md +167 -0
- spoc-0.3.0/docs/docs/core/app-system.md +807 -0
- spoc-0.3.0/docs/docs/core/components.md +549 -0
- spoc-0.3.0/docs/docs/core/dependencies.md +708 -0
- spoc-0.3.0/docs/docs/core/framework.md +1104 -0
- spoc-0.3.0/docs/docs/core/importer.md +591 -0
- spoc-0.3.0/docs/docs/examples/app-example.md +1712 -0
- spoc-0.3.0/docs/docs/examples/basic.md +694 -0
- spoc-0.3.0/docs/docs/getting-started/configuration.md +656 -0
- spoc-0.3.0/docs/docs/getting-started/installation.md +205 -0
- spoc-0.3.0/docs/docs/getting-started/quick-start.md +600 -0
- spoc-0.3.0/docs/docs/index.md +173 -0
- spoc-0.3.0/docs/main.py +50 -0
- spoc-0.3.0/docs/mkdocs.yml +157 -0
- spoc-0.3.0/examples/apps/another/__init__.py +0 -0
- spoc-0.3.0/examples/apps/another/models.py +0 -0
- spoc-0.3.0/examples/apps/another/views.py +14 -0
- spoc-0.3.0/examples/apps/auth/__init__.py +0 -0
- spoc-0.3.0/examples/apps/auth/models.py +34 -0
- spoc-0.3.0/examples/apps/auth/views.py +14 -0
- spoc-0.3.0/examples/apps/demo/__init__.py +0 -0
- spoc-0.3.0/examples/apps/demo/extras.py +6 -0
- spoc-0.3.0/examples/apps/demo/models.py +17 -0
- spoc-0.3.0/examples/apps/demo/views.py +14 -0
- spoc-0.3.0/examples/apps/other/__init__.py +0 -0
- spoc-0.3.0/examples/apps/other/models.py +49 -0
- spoc-0.3.0/examples/apps/other/views.py +16 -0
- spoc-0.3.0/examples/config/__init__.py +0 -0
- spoc-0.3.0/examples/config/settings.py +18 -0
- spoc-0.3.0/examples/config/spoc.toml +15 -0
- spoc-0.3.0/examples/framework/__init__.py +4 -0
- spoc-0.3.0/examples/framework/framework.py +106 -0
- spoc-0.3.0/examples/main.py +17 -0
- spoc-0.3.0/examples/workers.py +51 -0
- spoc-0.3.0/pyproject.toml +41 -0
- spoc-0.3.0/src/spoc/__about__.py +5 -0
- spoc-0.3.0/src/spoc/__init__.py +55 -0
- spoc-0.3.0/src/spoc/case_style.py +108 -0
- spoc-0.3.0/src/spoc/components.py +329 -0
- spoc-0.3.0/src/spoc/core/__init__.py +0 -0
- spoc-0.3.0/src/spoc/core/config_loader.py +202 -0
- spoc-0.3.0/src/spoc/core/exceptions.py +104 -0
- spoc-0.3.0/src/spoc/core/importer.py +556 -0
- spoc-0.3.0/src/spoc/core/logging_utils.py +111 -0
- spoc-0.3.0/src/spoc/core/singleton.py +135 -0
- spoc-0.3.0/src/spoc/core/toml_core.py +120 -0
- spoc-0.3.0/src/spoc/core/utils.py +175 -0
- spoc-0.3.0/src/spoc/framework.py +269 -0
- spoc-0.3.0/src/spoc/inject_apps.py +43 -0
- spoc-0.3.0/src/spoc/tools.py +153 -0
- spoc-0.3.0/src/spoc/types.py +14 -0
- spoc-0.3.0/src/spoc/workers.py +271 -0
- spoc-0.3.0/tests/TEST.md +66 -0
- spoc-0.3.0/tests/__init__.py +5 -0
- spoc-0.3.0/tests/test_components.py +290 -0
- spoc-0.3.0/tests/test_config_loader.py +339 -0
- spoc-0.3.0/tests/test_importer.py +530 -0
- spoc-0.3.0/tests/test_singleton.py +270 -0
- spoc-0.3.0/tests/test_tools.py +217 -0
- spoc-0.3.0/tests/test_workers.py +347 -0
- spoc-0.3.0/uv.lock +685 -0
- spoc-0.2.3/PKG-INFO +0 -76
- spoc-0.2.3/pyproject.toml +0 -87
- spoc-0.2.3/src/spoc/__about__.py +0 -5
- spoc-0.2.3/src/spoc/__init__.py +0 -86
- spoc-0.2.3/src/spoc/components.py +0 -158
- spoc-0.2.3/src/spoc/framework.py +0 -171
- spoc-0.2.3/src/spoc/importer/__init__.py +0 -44
- spoc-0.2.3/src/spoc/importer/base.py +0 -136
- spoc-0.2.3/src/spoc/importer/frozendict.py +0 -53
- spoc-0.2.3/src/spoc/importer/get_spoc.py +0 -60
- spoc-0.2.3/src/spoc/importer/tools.py +0 -36
- spoc-0.2.3/src/spoc/importer/types.py +0 -64
- spoc-0.2.3/src/spoc/inject.py +0 -202
- spoc-0.2.3/src/spoc/installer.py +0 -114
- spoc-0.2.3/src/spoc/py.typed +0 -1
- spoc-0.2.3/src/spoc/singleton.py +0 -24
- spoc-0.2.3/src/spoc/toml_core.py +0 -27
- spoc-0.2.3/src/spoc/workers.py +0 -361
- {spoc-0.2.3 → spoc-0.3.0}/LICENSE +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Update Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch: # Allows manual triggering
|
|
5
|
+
release:
|
|
6
|
+
types: [published] # Automatically triggers on new release
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write # Grants write permissions to push changes to the repository
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
update_docs:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout Repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.13"
|
|
22
|
+
|
|
23
|
+
- name: Install uv
|
|
24
|
+
uses: astral-sh/setup-uv@v5
|
|
25
|
+
|
|
26
|
+
- name: Install Dependencies
|
|
27
|
+
run: uv sync --group docs
|
|
28
|
+
|
|
29
|
+
- name: Update mkdocs.yml with Latest Tag
|
|
30
|
+
run: |
|
|
31
|
+
TAG_NAME="${{ github.event.release.tag_name }}"
|
|
32
|
+
cd docs
|
|
33
|
+
sed -i "s|repo_url: https://github.com/${{ github.repository }}/.*|repo_url: https://github.com/${{ github.repository }}/tree/${TAG_NAME}|" mkdocs.yml
|
|
34
|
+
|
|
35
|
+
- name: Deploy MkDocs
|
|
36
|
+
working-directory: docs
|
|
37
|
+
run: uv run mkdocs gh-deploy --force
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Upload Release to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch: # Manually triggered
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- v* # Automatically triggered on tags that match the pattern
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write # Required to create releases
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
pypi-publish:
|
|
14
|
+
name: Publish to PyPI
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write # This permission is needed for creating releases and private repositories.
|
|
18
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout Repository
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v5
|
|
30
|
+
|
|
31
|
+
- name: Build package
|
|
32
|
+
run: uv build
|
|
33
|
+
|
|
34
|
+
- name: Publish package distributions to PyPI
|
|
35
|
+
run: uv publish
|
|
36
|
+
|
|
37
|
+
- name: Create GitHub Release
|
|
38
|
+
env:
|
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
run: |
|
|
41
|
+
gh release create ${{ github.ref }} --title "Release ${{ github.ref_name }}" --notes "Automated release created by GitHub Actions"
|
spoc-0.3.0/.gitignore
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
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
|
+
target/
|
|
76
|
+
|
|
77
|
+
# Jupyter Notebook
|
|
78
|
+
.ipynb_checkpoints
|
|
79
|
+
|
|
80
|
+
# IPython
|
|
81
|
+
profile_default/
|
|
82
|
+
ipython_config.py
|
|
83
|
+
|
|
84
|
+
# pyenv
|
|
85
|
+
.python-version
|
|
86
|
+
|
|
87
|
+
# pipenv
|
|
88
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
89
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
90
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
91
|
+
# install all needed dependencies.
|
|
92
|
+
#Pipfile.lock
|
|
93
|
+
|
|
94
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
95
|
+
__pypackages__/
|
|
96
|
+
|
|
97
|
+
# Celery stuff
|
|
98
|
+
celerybeat-schedule
|
|
99
|
+
celerybeat.pid
|
|
100
|
+
|
|
101
|
+
# SageMath parsed files
|
|
102
|
+
*.sage.py
|
|
103
|
+
|
|
104
|
+
# Environments
|
|
105
|
+
.env
|
|
106
|
+
.venv
|
|
107
|
+
env/
|
|
108
|
+
venv/
|
|
109
|
+
ENV/
|
|
110
|
+
env.bak/
|
|
111
|
+
venv.bak/
|
|
112
|
+
|
|
113
|
+
# Spyder project settings
|
|
114
|
+
.spyderproject
|
|
115
|
+
.spyproject
|
|
116
|
+
|
|
117
|
+
# Rope project settings
|
|
118
|
+
.ropeproject
|
|
119
|
+
|
|
120
|
+
# mkdocs documentation
|
|
121
|
+
/site
|
|
122
|
+
|
|
123
|
+
# mypy
|
|
124
|
+
.mypy_cache/
|
|
125
|
+
.dmypy.json
|
|
126
|
+
dmypy.json
|
|
127
|
+
|
|
128
|
+
# Pyre type checker
|
|
129
|
+
.pyre/
|
|
130
|
+
.pdm-python
|
|
131
|
+
.pdm.toml
|
|
132
|
+
pdm.lock
|
|
133
|
+
|
|
134
|
+
# Others
|
|
135
|
+
.claude/
|
|
136
|
+
.legacy/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
docs/docs/api/**/*.md
|
|
File without changes
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spoc
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Elastic Framework Builder
|
|
5
|
+
Author-email: hlop3z <23062270+hlop3z@users.noreply.github.com>
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.13
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
1
10
|
# Welcome to **SPOC**
|
|
2
11
|
|
|
3
12
|
<img src="https://raw.githubusercontent.com/hlop3z/spoc/main/docs/docs/assets/images/title.png" alt="title-image" width="100%" />
|
|
@@ -27,25 +36,4 @@
|
|
|
27
36
|
## Example
|
|
28
37
|
|
|
29
38
|
```python
|
|
30
|
-
from typing import Any
|
|
31
|
-
import spoc
|
|
32
|
-
|
|
33
|
-
MODULES = ["models", "views"]
|
|
34
|
-
|
|
35
|
-
class MyFramework(spoc.Base):
|
|
36
|
-
components: Any
|
|
37
|
-
plugins: Any
|
|
38
|
-
|
|
39
|
-
def init(self):
|
|
40
|
-
"""__init__ Replacement"""
|
|
41
|
-
app = spoc.init(MODULES)
|
|
42
|
-
|
|
43
|
-
# Assign components and plugins from the initialized app
|
|
44
|
-
self.components = app.components
|
|
45
|
-
self.plugins = app.plugins
|
|
46
|
-
|
|
47
|
-
@staticmethod
|
|
48
|
-
def keys():
|
|
49
|
-
"""Define a list of keys relevant to the framework"""
|
|
50
|
-
return ("components", "plugins")
|
|
51
39
|
```
|
spoc-0.3.0/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Welcome to **SPOC**
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/hlop3z/spoc/main/docs/docs/assets/images/title.png" alt="title-image" width="100%" />
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
**SPOC** is a foundational framework designed to create dynamic and adaptable **`frameworks`**. It involves defining a schema for your **project**(s) and building upon that schema to create a flexible and powerful Application.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Links
|
|
20
|
+
|
|
21
|
+
- [PyPi](https://pypi.org/project/spoc)
|
|
22
|
+
- [Github](https://github.com/hlop3z/spoc)
|
|
23
|
+
- [Read the Documents](https://hlop3z.github.io/spoc/)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
```
|
spoc-0.3.0/Taskfile.yml
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
vars:
|
|
4
|
+
PYTHON: python
|
|
5
|
+
SRC_DIR: src/spoc
|
|
6
|
+
TESTS_DIR: tests
|
|
7
|
+
DOCS_DIR: docs
|
|
8
|
+
|
|
9
|
+
tasks:
|
|
10
|
+
# =============================================================================
|
|
11
|
+
# Installation
|
|
12
|
+
# =============================================================================
|
|
13
|
+
install:
|
|
14
|
+
desc: Install project dependencies
|
|
15
|
+
cmds:
|
|
16
|
+
- uv sync
|
|
17
|
+
|
|
18
|
+
install:dev:
|
|
19
|
+
desc: Install development dependencies
|
|
20
|
+
cmds:
|
|
21
|
+
- uv sync --group dev
|
|
22
|
+
|
|
23
|
+
install:docs:
|
|
24
|
+
desc: Install documentation dependencies
|
|
25
|
+
cmds:
|
|
26
|
+
- uv sync --group docs
|
|
27
|
+
|
|
28
|
+
install:all:
|
|
29
|
+
desc: Install all dependencies (dev + docs)
|
|
30
|
+
cmds:
|
|
31
|
+
- uv sync --all-groups
|
|
32
|
+
|
|
33
|
+
# =============================================================================
|
|
34
|
+
# Testing
|
|
35
|
+
# =============================================================================
|
|
36
|
+
test:
|
|
37
|
+
desc: Run tests with pytest
|
|
38
|
+
cmds:
|
|
39
|
+
- uv run pytest {{.TESTS_DIR}} -v {{.CLI_ARGS}}
|
|
40
|
+
|
|
41
|
+
test:fast:
|
|
42
|
+
desc: Run tests without verbose output
|
|
43
|
+
cmds:
|
|
44
|
+
- uv run pytest {{.TESTS_DIR}} {{.CLI_ARGS}}
|
|
45
|
+
|
|
46
|
+
test:cov:
|
|
47
|
+
desc: Run tests with coverage report
|
|
48
|
+
cmds:
|
|
49
|
+
- uv run pytest {{.TESTS_DIR}} --cov={{.SRC_DIR}} --cov-report=term-missing {{.CLI_ARGS}}
|
|
50
|
+
|
|
51
|
+
# =============================================================================
|
|
52
|
+
# Linting & Formatting
|
|
53
|
+
# =============================================================================
|
|
54
|
+
lint:
|
|
55
|
+
desc: Run ruff linter
|
|
56
|
+
cmds:
|
|
57
|
+
- uv run ruff check {{.SRC_DIR}} {{.TESTS_DIR}} {{.CLI_ARGS}}
|
|
58
|
+
|
|
59
|
+
lint:fix:
|
|
60
|
+
desc: Run ruff linter with auto-fix
|
|
61
|
+
cmds:
|
|
62
|
+
- uv run ruff check {{.SRC_DIR}} {{.TESTS_DIR}} --fix {{.CLI_ARGS}}
|
|
63
|
+
|
|
64
|
+
format:
|
|
65
|
+
desc: Format code with ruff
|
|
66
|
+
cmds:
|
|
67
|
+
- uv run ruff format {{.SRC_DIR}} {{.TESTS_DIR}} {{.CLI_ARGS}}
|
|
68
|
+
|
|
69
|
+
format:check:
|
|
70
|
+
desc: Check code formatting without changes
|
|
71
|
+
cmds:
|
|
72
|
+
- uv run ruff format {{.SRC_DIR}} {{.TESTS_DIR}} --check {{.CLI_ARGS}}
|
|
73
|
+
|
|
74
|
+
# =============================================================================
|
|
75
|
+
# Type Checking
|
|
76
|
+
# =============================================================================
|
|
77
|
+
type:
|
|
78
|
+
desc: Run type checker (ty)
|
|
79
|
+
cmds:
|
|
80
|
+
- uv run ty check {{.SRC_DIR}} {{.CLI_ARGS}}
|
|
81
|
+
|
|
82
|
+
# =============================================================================
|
|
83
|
+
# Quality Checks (All-in-one)
|
|
84
|
+
# =============================================================================
|
|
85
|
+
check:
|
|
86
|
+
desc: Run all quality checks (lint + type + test)
|
|
87
|
+
cmds:
|
|
88
|
+
- task: lint
|
|
89
|
+
- task: type
|
|
90
|
+
- task: test
|
|
91
|
+
|
|
92
|
+
check:fix:
|
|
93
|
+
desc: Fix issues and run checks
|
|
94
|
+
cmds:
|
|
95
|
+
- task: format
|
|
96
|
+
- task: lint:fix
|
|
97
|
+
- task: type
|
|
98
|
+
- task: test
|
|
99
|
+
|
|
100
|
+
# =============================================================================
|
|
101
|
+
# Documentation
|
|
102
|
+
# =============================================================================
|
|
103
|
+
docs:
|
|
104
|
+
desc: Serve documentation locally
|
|
105
|
+
dir: "{{.DOCS_DIR}}"
|
|
106
|
+
cmds:
|
|
107
|
+
- uv run mkdocs serve {{.CLI_ARGS}}
|
|
108
|
+
|
|
109
|
+
docs:build:
|
|
110
|
+
desc: Build documentation
|
|
111
|
+
dir: "{{.DOCS_DIR}}"
|
|
112
|
+
cmds:
|
|
113
|
+
- uv run mkdocs build {{.CLI_ARGS}}
|
|
114
|
+
|
|
115
|
+
docs:deploy:
|
|
116
|
+
desc: Deploy documentation to GitHub Pages
|
|
117
|
+
dir: "{{.DOCS_DIR}}"
|
|
118
|
+
cmds:
|
|
119
|
+
- uv run mkdocs gh-deploy --force {{.CLI_ARGS}}
|
|
120
|
+
|
|
121
|
+
# =============================================================================
|
|
122
|
+
# Build & Release
|
|
123
|
+
# =============================================================================
|
|
124
|
+
build:
|
|
125
|
+
desc: Build the package
|
|
126
|
+
cmds:
|
|
127
|
+
- uv build
|
|
128
|
+
|
|
129
|
+
publish:
|
|
130
|
+
desc: Publish package to PyPI
|
|
131
|
+
cmds:
|
|
132
|
+
- uv publish {{.CLI_ARGS}}
|
|
133
|
+
|
|
134
|
+
publish:test:
|
|
135
|
+
desc: Publish package to TestPyPI
|
|
136
|
+
cmds:
|
|
137
|
+
- uv publish --index testpypi {{.CLI_ARGS}}
|
|
138
|
+
|
|
139
|
+
# =============================================================================
|
|
140
|
+
# Cleanup
|
|
141
|
+
# =============================================================================
|
|
142
|
+
clean:
|
|
143
|
+
desc: Clean build artifacts and caches
|
|
144
|
+
cmds:
|
|
145
|
+
- cmd: rm -rf dist/ build/ *.egg-info
|
|
146
|
+
ignore_error: true
|
|
147
|
+
- cmd: rm -rf .pytest_cache/ .ruff_cache/ .mypy_cache/ .ty_cache/
|
|
148
|
+
ignore_error: true
|
|
149
|
+
- cmd: find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
|
|
150
|
+
ignore_error: true
|
|
151
|
+
- cmd: find . -type f -name "*.pyc" -delete 2>/dev/null
|
|
152
|
+
ignore_error: true
|
|
153
|
+
|
|
154
|
+
clean:all:
|
|
155
|
+
desc: Clean everything including .venv
|
|
156
|
+
cmds:
|
|
157
|
+
- task: clean
|
|
158
|
+
- cmd: rm -rf .venv/
|
|
159
|
+
ignore_error: true
|
|
160
|
+
|
|
161
|
+
# =============================================================================
|
|
162
|
+
# Development Workflow
|
|
163
|
+
# =============================================================================
|
|
164
|
+
dev:
|
|
165
|
+
desc: Setup development environment
|
|
166
|
+
cmds:
|
|
167
|
+
- task: install:all
|
|
168
|
+
- task: check
|
|
169
|
+
|
|
170
|
+
dev:watch:
|
|
171
|
+
desc: Run tests in watch mode (requires pytest-watch)
|
|
172
|
+
cmds:
|
|
173
|
+
- uv run ptw {{.TESTS_DIR}} {{.CLI_ARGS}}
|
|
174
|
+
|
|
175
|
+
# =============================================================================
|
|
176
|
+
# Version Management
|
|
177
|
+
# =============================================================================
|
|
178
|
+
version:
|
|
179
|
+
desc: Show project version
|
|
180
|
+
cmds:
|
|
181
|
+
- uv run python -c "import re; print(re.search(r'__version__ = \"([^\"]+)\"', open('src/spoc/__about__.py').read()).group(1))"
|
|
182
|
+
|
|
183
|
+
version:get:
|
|
184
|
+
desc: Get current version (silent)
|
|
185
|
+
silent: true
|
|
186
|
+
cmds:
|
|
187
|
+
- uv run python -c "import re; print(re.search(r'__version__ = \"([^\"]+)\"', open('src/spoc/__about__.py').read()).group(1))"
|
|
188
|
+
|
|
189
|
+
version:bump:patch:
|
|
190
|
+
desc: Bump patch version (0.0.X)
|
|
191
|
+
cmds:
|
|
192
|
+
- |
|
|
193
|
+
uv run python -c "
|
|
194
|
+
import re
|
|
195
|
+
path = 'src/spoc/__about__.py'
|
|
196
|
+
content = open(path).read()
|
|
197
|
+
match = re.search(r'__version__ = \"(\d+)\.(\d+)\.(\d+)\"', content)
|
|
198
|
+
major, minor, patch = int(match.group(1)), int(match.group(2)), int(match.group(3))
|
|
199
|
+
new_version = f'{major}.{minor}.{patch + 1}'
|
|
200
|
+
new_content = re.sub(r'__version__ = \"[^\"]+\"', f'__version__ = \"{new_version}\"', content)
|
|
201
|
+
open(path, 'w').write(new_content)
|
|
202
|
+
print(f'Bumped version to {new_version}')
|
|
203
|
+
"
|
|
204
|
+
|
|
205
|
+
version:bump:minor:
|
|
206
|
+
desc: Bump minor version (0.X.0)
|
|
207
|
+
cmds:
|
|
208
|
+
- |
|
|
209
|
+
uv run python -c "
|
|
210
|
+
import re
|
|
211
|
+
path = 'src/spoc/__about__.py'
|
|
212
|
+
content = open(path).read()
|
|
213
|
+
match = re.search(r'__version__ = \"(\d+)\.(\d+)\.(\d+)\"', content)
|
|
214
|
+
major, minor, patch = int(match.group(1)), int(match.group(2)), int(match.group(3))
|
|
215
|
+
new_version = f'{major}.{minor + 1}.0'
|
|
216
|
+
new_content = re.sub(r'__version__ = \"[^\"]+\"', f'__version__ = \"{new_version}\"', content)
|
|
217
|
+
open(path, 'w').write(new_content)
|
|
218
|
+
print(f'Bumped version to {new_version}')
|
|
219
|
+
"
|
|
220
|
+
|
|
221
|
+
version:bump:major:
|
|
222
|
+
desc: Bump major version (X.0.0)
|
|
223
|
+
cmds:
|
|
224
|
+
- |
|
|
225
|
+
uv run python -c "
|
|
226
|
+
import re
|
|
227
|
+
path = 'src/spoc/__about__.py'
|
|
228
|
+
content = open(path).read()
|
|
229
|
+
match = re.search(r'__version__ = \"(\d+)\.(\d+)\.(\d+)\"', content)
|
|
230
|
+
major, minor, patch = int(match.group(1)), int(match.group(2)), int(match.group(3))
|
|
231
|
+
new_version = f'{major + 1}.0.0'
|
|
232
|
+
new_content = re.sub(r'__version__ = \"[^\"]+\"', f'__version__ = \"{new_version}\"', content)
|
|
233
|
+
open(path, 'w').write(new_content)
|
|
234
|
+
print(f'Bumped version to {new_version}')
|
|
235
|
+
"
|
|
236
|
+
|
|
237
|
+
version:release:
|
|
238
|
+
desc: Create release (commit, tag, push)
|
|
239
|
+
vars:
|
|
240
|
+
VERSION:
|
|
241
|
+
sh: uv run python -c "import re; print(re.search(r'__version__ = \"([^\"]+)\"', open('src/spoc/__about__.py').read()).group(1))"
|
|
242
|
+
cmds:
|
|
243
|
+
- git add src/spoc/__about__.py
|
|
244
|
+
- git commit -m "v{{.VERSION}}"
|
|
245
|
+
- git tag "v{{.VERSION}}"
|
|
246
|
+
- git push && git push --tags
|
|
247
|
+
|
|
248
|
+
# =============================================================================
|
|
249
|
+
# Utilities
|
|
250
|
+
# =============================================================================
|
|
251
|
+
tree:
|
|
252
|
+
desc: Show project structure
|
|
253
|
+
cmds:
|
|
254
|
+
- cmd: tree -I '__pycache__|.git|.venv|*.egg-info|.pytest_cache|.ruff_cache|node_modules' -L 3
|
|
255
|
+
ignore_error: true
|
|
256
|
+
|
|
257
|
+
# =============================================================================
|
|
258
|
+
# Default Task
|
|
259
|
+
# =============================================================================
|
|
260
|
+
default:
|
|
261
|
+
desc: Show available tasks
|
|
262
|
+
cmds:
|
|
263
|
+
- task --list
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
site/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Tables */
|
|
2
|
+
.md-typeset__table {
|
|
3
|
+
min-width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.md-typeset table:not([class]) {
|
|
6
|
+
display: table;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Name Acronym */
|
|
10
|
+
.name-acronym {
|
|
11
|
+
font-size: 32px;
|
|
12
|
+
letter-spacing: 2px;
|
|
13
|
+
}
|
|
14
|
+
@media only screen and (min-width: 0px) and (max-width: 720px) {
|
|
15
|
+
.name-acronym {
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Title Image */
|
|
21
|
+
.title-image {
|
|
22
|
+
border-radius: 25px;
|
|
23
|
+
|
|
24
|
+
-webkit-box-shadow: 5px 20px 25px 4px rgba(0, 0, 0, 0.75);
|
|
25
|
+
-moz-box-shadow: 5px 20px 25px 4px rgba(0, 0, 0, 0.75);
|
|
26
|
+
box-shadow: 5px 20px 25px 4px rgba(0, 0, 0, 0.75);
|
|
27
|
+
}
|
|
28
|
+
.title-image {
|
|
29
|
+
height: auto;
|
|
30
|
+
width: 968px;
|
|
31
|
+
}
|
|
32
|
+
@media only screen and (max-width: 968px) {
|
|
33
|
+
.title-image {
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Layout */
|
|
39
|
+
.md-grid {
|
|
40
|
+
max-width: 90%;
|
|
41
|
+
}
|
|
42
|
+
.md-sidebar--primary {
|
|
43
|
+
width: 9rem;
|
|
44
|
+
}
|
|
45
|
+
.md-sidebar--secondary {
|
|
46
|
+
width: 10rem;
|
|
47
|
+
}
|
|
48
|
+
.md-footer-meta__inner {
|
|
49
|
+
justify-content: center !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* DOCS */
|
|
53
|
+
.doc code,
|
|
54
|
+
.doc-heading * {
|
|
55
|
+
color: #4cae4f !important;
|
|
56
|
+
/* font-size: 1em; */
|
|
57
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block styles %}
|
|
4
|
+
{{ super() }}
|
|
5
|
+
<link rel="stylesheet" href="{{ base_url }}/css/extra.css" />
|
|
6
|
+
{% endblock %}
|
|
7
|
+
|
|
8
|
+
{% block libs %}
|
|
9
|
+
{{ super() }}
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
{% block scripts %}
|
|
13
|
+
{{ super() }}
|
|
14
|
+
{% endblock %}
|