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.
Files changed (86) hide show
  1. spoc-0.3.2/PKG-INFO +70 -0
  2. spoc-0.3.2/README.md +61 -0
  3. {spoc-0.3.0 → spoc-0.3.2}/docs/mkdocs.yml +2 -1
  4. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/__about__.py +1 -1
  5. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/importer.py +4 -3
  6. spoc-0.3.0/PKG-INFO +0 -39
  7. spoc-0.3.0/README.md +0 -30
  8. {spoc-0.3.0 → spoc-0.3.2}/.github/workflows/docs.yml +0 -0
  9. {spoc-0.3.0 → spoc-0.3.2}/.github/workflows/release.yml +0 -0
  10. {spoc-0.3.0 → spoc-0.3.2}/.gitignore +0 -0
  11. {spoc-0.3.0 → spoc-0.3.2}/.prettierignore +0 -0
  12. {spoc-0.3.0 → spoc-0.3.2}/CONTRIBUTING.md +0 -0
  13. {spoc-0.3.0 → spoc-0.3.2}/LICENSE +0 -0
  14. {spoc-0.3.0 → spoc-0.3.2}/Taskfile.yml +0 -0
  15. {spoc-0.3.0 → spoc-0.3.2}/docs/.gitignore +0 -0
  16. {spoc-0.3.0 → spoc-0.3.2}/docs/custom_theme/css/extra.css +0 -0
  17. {spoc-0.3.0 → spoc-0.3.2}/docs/custom_theme/main.html +0 -0
  18. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/lifecycle.md +0 -0
  19. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/plugins.md +0 -0
  20. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/advanced/workers.md +0 -0
  21. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/components.md +0 -0
  22. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/core-utils.md +0 -0
  23. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/framework.md +0 -0
  24. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/importer.md +0 -0
  25. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/tools.md +0 -0
  26. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/api/workers.md +0 -0
  27. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/assets/images/logo.png +0 -0
  28. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/assets/images/title.png +0 -0
  29. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/contributing.md +0 -0
  30. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/app-system.md +0 -0
  31. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/components.md +0 -0
  32. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/dependencies.md +0 -0
  33. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/framework.md +0 -0
  34. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/core/importer.md +0 -0
  35. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/examples/app-example.md +0 -0
  36. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/examples/basic.md +0 -0
  37. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/configuration.md +0 -0
  38. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/installation.md +0 -0
  39. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/getting-started/quick-start.md +0 -0
  40. {spoc-0.3.0 → spoc-0.3.2}/docs/docs/index.md +0 -0
  41. {spoc-0.3.0 → spoc-0.3.2}/docs/main.py +0 -0
  42. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/__init__.py +0 -0
  43. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/models.py +0 -0
  44. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/another/views.py +0 -0
  45. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/__init__.py +0 -0
  46. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/models.py +0 -0
  47. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/auth/views.py +0 -0
  48. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/__init__.py +0 -0
  49. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/extras.py +0 -0
  50. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/models.py +0 -0
  51. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/demo/views.py +0 -0
  52. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/__init__.py +0 -0
  53. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/models.py +0 -0
  54. {spoc-0.3.0 → spoc-0.3.2}/examples/apps/other/views.py +0 -0
  55. {spoc-0.3.0 → spoc-0.3.2}/examples/config/__init__.py +0 -0
  56. {spoc-0.3.0 → spoc-0.3.2}/examples/config/settings.py +0 -0
  57. {spoc-0.3.0 → spoc-0.3.2}/examples/config/spoc.toml +0 -0
  58. {spoc-0.3.0 → spoc-0.3.2}/examples/framework/__init__.py +0 -0
  59. {spoc-0.3.0 → spoc-0.3.2}/examples/framework/framework.py +0 -0
  60. {spoc-0.3.0 → spoc-0.3.2}/examples/main.py +0 -0
  61. {spoc-0.3.0 → spoc-0.3.2}/examples/workers.py +0 -0
  62. {spoc-0.3.0 → spoc-0.3.2}/pyproject.toml +0 -0
  63. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/__init__.py +0 -0
  64. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/case_style.py +0 -0
  65. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/components.py +0 -0
  66. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/__init__.py +0 -0
  67. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/config_loader.py +0 -0
  68. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/exceptions.py +0 -0
  69. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/logging_utils.py +0 -0
  70. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/singleton.py +0 -0
  71. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/toml_core.py +0 -0
  72. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/core/utils.py +0 -0
  73. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/framework.py +0 -0
  74. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/inject_apps.py +0 -0
  75. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/tools.py +0 -0
  76. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/types.py +0 -0
  77. {spoc-0.3.0 → spoc-0.3.2}/src/spoc/workers.py +0 -0
  78. {spoc-0.3.0 → spoc-0.3.2}/tests/TEST.md +0 -0
  79. {spoc-0.3.0 → spoc-0.3.2}/tests/__init__.py +0 -0
  80. {spoc-0.3.0 → spoc-0.3.2}/tests/test_components.py +0 -0
  81. {spoc-0.3.0 → spoc-0.3.2}/tests/test_config_loader.py +0 -0
  82. {spoc-0.3.0 → spoc-0.3.2}/tests/test_importer.py +0 -0
  83. {spoc-0.3.0 → spoc-0.3.2}/tests/test_singleton.py +0 -0
  84. {spoc-0.3.0 → spoc-0.3.2}/tests/test_tools.py +0 -0
  85. {spoc-0.3.0 → spoc-0.3.2}/tests/test_workers.py +0 -0
  86. {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
+ ![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)
15
+ ![Language](https://img.shields.io/github/languages/top/hlop3z/spoc)
16
+ ![GitHub](https://img.shields.io/github/v/tag/hlop3z/spoc?label=github)
17
+ ![PyPI](https://img.shields.io/pypi/v/spoc?color=blue)
18
+ ![Downloads](https://img.shields.io/pypi/dm/spoc?color=darkgreen)
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
+ ![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)
6
+ ![Language](https://img.shields.io/github/languages/top/hlop3z/spoc)
7
+ ![GitHub](https://img.shields.io/github/v/tag/hlop3z/spoc?label=github)
8
+ ![PyPI](https://img.shields.io/pypi/v/spoc?color=blue)
9
+ ![Downloads](https://img.shields.io/pypi/dm/spoc?color=darkgreen)
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)
@@ -1,7 +1,8 @@
1
1
  # Configurations
2
2
  site_name: Spoc
3
3
  site_url: https://hlop3z.github.io/spoc/
4
- repo_url: https://github.com/hlop3z/spoc/
4
+ repo_url: https://github.com/hlop3z/spoc
5
+ edit_uri: ""
5
6
  copyright: Copyright © hlop3z
6
7
 
7
8
  # Navigation
@@ -1,5 +1,5 @@
1
1
  """Project Info."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.3.2"
4
4
  __license__ = "BSD-3-Clause"
5
5
  __author__ = "hlop3z"
@@ -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
- assert module is not None, f"Failed to load module {name}"
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
- ![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)
17
- ![Language](https://img.shields.io/github/languages/top/hlop3z/spoc)
18
- ![GitHub](https://img.shields.io/github/v/tag/hlop3z/spoc?label=github)
19
- ![PyPI](https://img.shields.io/pypi/v/spoc?color=blue)
20
- ![Downloads](https://img.shields.io/pypi/dm/spoc?color=darkgreen)
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
- ![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)
8
- ![Language](https://img.shields.io/github/languages/top/hlop3z/spoc)
9
- ![GitHub](https://img.shields.io/github/v/tag/hlop3z/spoc?label=github)
10
- ![PyPI](https://img.shields.io/pypi/v/spoc?color=blue)
11
- ![Downloads](https://img.shields.io/pypi/dm/spoc?color=darkgreen)
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