spoc 0.3.0__tar.gz → 0.3.2__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.2/PKG-INFO +70 -0
- spoc-0.3.2/README.md +61 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/mkdocs.yml +2 -1
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/__about__.py +1 -1
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/importer.py +4 -3
- spoc-0.3.0/PKG-INFO +0 -39
- spoc-0.3.0/README.md +0 -30
- {spoc-0.3.0 → spoc-0.3.2}/.github/workflows/docs.yml +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/.github/workflows/release.yml +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/.gitignore +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/.prettierignore +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/CONTRIBUTING.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/LICENSE +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/Taskfile.yml +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/.gitignore +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/custom_theme/css/extra.css +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/custom_theme/main.html +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/lifecycle.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/plugins.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/workers.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/components.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/core-utils.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/framework.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/importer.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/tools.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/workers.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/assets/images/logo.png +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/assets/images/title.png +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/contributing.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/app-system.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/components.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/dependencies.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/framework.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/importer.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/examples/app-example.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/examples/basic.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/configuration.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/installation.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/quick-start.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/docs/index.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/docs/main.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/models.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/views.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/models.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/views.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/extras.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/models.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/views.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/models.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/views.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/config/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/config/settings.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/config/spoc.toml +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/framework/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/framework/framework.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/main.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/examples/workers.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/pyproject.toml +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/case_style.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/components.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/config_loader.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/exceptions.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/logging_utils.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/singleton.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/toml_core.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/utils.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/framework.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/inject_apps.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/tools.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/types.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/src/spoc/workers.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/TEST.md +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/__init__.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_components.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_config_loader.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_importer.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_singleton.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_tools.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/tests/test_workers.py +0 -0
- {spoc-0.3.0 → spoc-0.3.2}/uv.lock +0 -0
spoc-0.3.2/PKG-INFO
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spoc
|
|
3
|
+
Version: 0.3.2
|
|
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
|
+
|
|
10
|
+
# SPOC
|
|
11
|
+
|
|
12
|
+
<img src="https://raw.githubusercontent.com/hlop3z/spoc/main/docs/docs/assets/images/title.png" alt="title-image" width="100%" />
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
**SPOC** is a Python framework for building **modular monolithic applications**. Inspired by Django's app system, it provides automatic module discovery, dependency management, and lifecycle orchestration.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **App-based architecture** - Organize code into self-contained, reusable modules
|
|
25
|
+
- **Automatic discovery** - Apps and components are discovered and loaded at runtime
|
|
26
|
+
- **Dependency management** - Define module dependencies with automatic load ordering
|
|
27
|
+
- **Component registry** - Register and retrieve components using decorators
|
|
28
|
+
- **Lifecycle hooks** - Startup and shutdown hooks for proper resource management
|
|
29
|
+
- **TOML configuration** - Simple configuration with `spoc.toml`
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
**Requires Python 3.13+**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install spoc
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from pathlib import Path
|
|
43
|
+
from spoc import Framework, Schema
|
|
44
|
+
|
|
45
|
+
# Define your application schema
|
|
46
|
+
schema = Schema(
|
|
47
|
+
modules=["models", "views"],
|
|
48
|
+
dependencies={"views": ["models"]},
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
# Create and run the framework
|
|
52
|
+
framework = Framework(
|
|
53
|
+
base_dir=Path(__file__).parent,
|
|
54
|
+
schema=schema,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Access registered components
|
|
58
|
+
print(framework.components.models.values())
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Documentation
|
|
62
|
+
|
|
63
|
+
For detailed documentation, tutorials, and examples:
|
|
64
|
+
|
|
65
|
+
**[Read the Docs](https://hlop3z.github.io/spoc/)**
|
|
66
|
+
|
|
67
|
+
## Links
|
|
68
|
+
|
|
69
|
+
- [PyPI](https://pypi.org/project/spoc)
|
|
70
|
+
- [GitHub](https://github.com/hlop3z/spoc)
|
spoc-0.3.2/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# 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
|
+
**SPOC** is a Python framework for building **modular monolithic applications**. Inspired by Django's app system, it provides automatic module discovery, dependency management, and lifecycle orchestration.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **App-based architecture** - Organize code into self-contained, reusable modules
|
|
16
|
+
- **Automatic discovery** - Apps and components are discovered and loaded at runtime
|
|
17
|
+
- **Dependency management** - Define module dependencies with automatic load ordering
|
|
18
|
+
- **Component registry** - Register and retrieve components using decorators
|
|
19
|
+
- **Lifecycle hooks** - Startup and shutdown hooks for proper resource management
|
|
20
|
+
- **TOML configuration** - Simple configuration with `spoc.toml`
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
**Requires Python 3.13+**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install spoc
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
from spoc import Framework, Schema
|
|
35
|
+
|
|
36
|
+
# Define your application schema
|
|
37
|
+
schema = Schema(
|
|
38
|
+
modules=["models", "views"],
|
|
39
|
+
dependencies={"views": ["models"]},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Create and run the framework
|
|
43
|
+
framework = Framework(
|
|
44
|
+
base_dir=Path(__file__).parent,
|
|
45
|
+
schema=schema,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Access registered components
|
|
49
|
+
print(framework.components.models.values())
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Documentation
|
|
53
|
+
|
|
54
|
+
For detailed documentation, tutorials, and examples:
|
|
55
|
+
|
|
56
|
+
**[Read the Docs](https://hlop3z.github.io/spoc/)**
|
|
57
|
+
|
|
58
|
+
## Links
|
|
59
|
+
|
|
60
|
+
- [PyPI](https://pypi.org/project/spoc)
|
|
61
|
+
- [GitHub](https://github.com/hlop3z/spoc)
|
|
@@ -273,12 +273,13 @@ class Importer(metaclass=SingletonMeta):
|
|
|
273
273
|
"""
|
|
274
274
|
# Load the module if not already loaded
|
|
275
275
|
module = self.load(name)
|
|
276
|
-
|
|
276
|
+
if module is None:
|
|
277
|
+
if self.mode == "strict":
|
|
278
|
+
raise AssertionError(f"Failed to load module {name}")
|
|
279
|
+
return None
|
|
277
280
|
|
|
278
281
|
# Update the module info with dependencies and lifecycle functions
|
|
279
282
|
module_info = self._module_cache.get(name)
|
|
280
|
-
if not module_info and self.mode != "strict":
|
|
281
|
-
module_info = ModuleInfo(name=name, module=module)
|
|
282
283
|
assert module_info is not None, f"Module {name} not found in cache"
|
|
283
284
|
module_info.dependencies = dependencies or []
|
|
284
285
|
module_info.on_startup = self.on_startup
|
spoc-0.3.0/PKG-INFO
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
# Welcome to **SPOC**
|
|
11
|
-
|
|
12
|
-
<img src="https://raw.githubusercontent.com/hlop3z/spoc/main/docs/docs/assets/images/title.png" alt="title-image" width="100%" />
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-

|
|
17
|
-

|
|
18
|
-

|
|
19
|
-

|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
**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.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Links
|
|
29
|
-
|
|
30
|
-
- [PyPi](https://pypi.org/project/spoc)
|
|
31
|
-
- [Github](https://github.com/hlop3z/spoc)
|
|
32
|
-
- [Read the Documents](https://hlop3z.github.io/spoc/)
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Example
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
```
|
spoc-0.3.0/README.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|