pyboot-framework 0.1.2__tar.gz → 0.1.3__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 (25) hide show
  1. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/PKG-INFO +1 -1
  2. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/pyproject.toml +1 -1
  3. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/builtins/configuration.py +12 -3
  4. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/pyboot_plugin.py +1 -1
  5. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/PKG-INFO +1 -1
  6. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/README.md +0 -0
  7. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/setup.cfg +0 -0
  8. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/__init__.py +0 -0
  9. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/__init__.py +0 -0
  10. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/application.py +0 -0
  11. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/builtins/BuiltInAttr.py +0 -0
  12. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/builtins/__init__.py +0 -0
  13. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/builtins/component.py +0 -0
  14. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/builtins/py.typed +0 -0
  15. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/exceptions.py +0 -0
  16. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/ioc.py +0 -0
  17. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/plugin_loader.py +0 -0
  18. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/pyboot_context.py +0 -0
  19. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/core/types.py +0 -0
  20. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot/py.typed +0 -0
  21. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/SOURCES.txt +0 -0
  22. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/dependency_links.txt +0 -0
  23. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/entry_points.txt +0 -0
  24. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/requires.txt +0 -0
  25. {pyboot_framework-0.1.2 → pyboot_framework-0.1.3}/src/pyboot_framework.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyboot-framework
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: A lightweight, extensible Python framework for building applications with dependency injection and a modular plugin architecture.
5
5
  Author: Siddharth Karn
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyboot-framework"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "A lightweight, extensible Python framework for building applications with dependency injection and a modular plugin architecture."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -41,7 +41,6 @@ class ConfigurationPlugin(PyBootPlugin):
41
41
  def before_register(self, context: PyBootContext) -> None:
42
42
  return super().before_register(context)
43
43
 
44
- # A Configuration class is a class that contains bean factory methods that produce beans for the application context.Its main responsibility is to define and configure beans that can be used throughout the application.So it must not wait for the application context to be fully initialized before it can register its beans. Instead, it should register its beans during the configuration phase of the application context initialization process.
45
44
  def on_register(self, context: PyBootContext) -> None:
46
45
 
47
46
  for clazz in context.discovered_classes:
@@ -53,6 +52,18 @@ class ConfigurationPlugin(PyBootPlugin):
53
52
  #register the class
54
53
  context.ioc.register_class(clazz=clazz)
55
54
 
55
+
56
+ return
57
+
58
+
59
+ #A Configuration class is a class that contains methods that are annotated with @Bean. These methods are used to create beans that can be injected into other classes. The after_register method is used to register the bean factories with the IoC container. It gets the bean of the configuration class and immediately register the methods as bean factories. It does not wait for the on_load method to be called. This is because the bean factories need to be registered before the on_load method is called, so that the beans can be created and injected into other classes.
60
+ def after_register(self, context: PyBootContext) -> None:
61
+ for clazz in context.discovered_classes:
62
+
63
+ #skip other classes
64
+ if not getattr(clazz,BuiltInAttr.IS_PYBOOT_CONFIGURATION_CLASS.value,False):
65
+ continue
66
+
56
67
  #immediately get the bean
57
68
  config_bean = context.ioc.get_bean(clazz=clazz)
58
69
 
@@ -80,8 +91,6 @@ class ConfigurationPlugin(PyBootPlugin):
80
91
  # register the bean factory
81
92
  context.ioc.register_bean_factory(clazz=return_type, method=method)
82
93
 
83
- def after_register(self, context: PyBootContext) -> None:
84
- return super().after_register(context)
85
94
 
86
95
  def before_load(self, context: PyBootContext) -> None:
87
96
  return super().before_load(context)
@@ -34,7 +34,7 @@ class PyBootPlugin(ABC):
34
34
 
35
35
  @abstractmethod
36
36
  def before_load(self,context:PyBootContext)->None:
37
- """Runs before the pyboot load of the plugins"""
37
+ """Runs before the pyboot load of the plugins.It means it runs before pyboot create all the beans of the registered classes"""
38
38
  pass
39
39
 
40
40
  @abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyboot-framework
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: A lightweight, extensible Python framework for building applications with dependency injection and a modular plugin architecture.
5
5
  Author: Siddharth Karn
6
6
  License-Expression: MIT