mixinv2 0.3.0.post27.dev0__tar.gz → 0.3.0.post31.dev0__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 (20) hide show
  1. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/PKG-INFO +1 -1
  2. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/tutorial.rst +18 -2
  3. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/.gitignore +0 -0
  4. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/README.md +0 -0
  5. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/Makefile +0 -0
  6. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/_static/favicon.svg +0 -0
  7. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/_static/logo.svg +0 -0
  8. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/conf.py +0 -0
  9. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/index.rst +0 -0
  10. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/installation.rst +0 -0
  11. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/mixinv2-tutorial.rst +0 -0
  12. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/docs/specification.md +0 -0
  13. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/pyproject.toml +0 -0
  14. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/__init__.py +0 -0
  15. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_config.py +0 -0
  16. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_core.py +0 -0
  17. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_interned_linked_list.py +0 -0
  18. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_mixin_directory.py +0 -0
  19. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_mixin_parser.py +0 -0
  20. {mixinv2-0.3.0.post27.dev0 → mixinv2-0.3.0.post31.dev0}/src/mixinv2/_runtime.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mixinv2
3
- Version: 0.3.0.post27.dev0
3
+ Version: 0.3.0.post31.dev0
4
4
  Summary: A dependency injection framework with pytest-fixture syntax, plus a configuration language for declarative programming
5
5
  Project-URL: Repository, https://github.com/Atry/MIXINv2
6
6
  Author-email: "Yang, Bo" <yang-bo@yang-bo.com>
@@ -27,6 +27,22 @@ values are passed as kwargs when calling the evaluated scope.
27
27
  database layer — it only declares ``connection: sqlite3.Connection`` as a parameter
28
28
  and receives it automatically from the composed scope.
29
29
 
30
+ .. tip:: **Naming convention**
31
+
32
+ Throughout this tutorial we use **UpperCamelCase** for scopes and **lowerCamelCase**
33
+ for resources. The idea is that a scope is conceptually a *class* — an instantiable
34
+ container — while a resource is a lazily-evaluated value inside it.
35
+
36
+ In the example above, ``SQLiteDatabase`` and ``UserRepository`` are scopes
37
+ (UpperCamelCase), while ``databasePath``, ``connection``, and ``userCount`` are
38
+ resources (lowerCamelCase).
39
+
40
+ This convention extends to Python modules used as scopes: a module file representing
41
+ a scope is named in UpperCamelCase (e.g., ``SqliteDatabase.py``), and a subpackage
42
+ representing a nested scope likewise (e.g., ``UserRepository/Request/``). This
43
+ deviates from PEP 8 — the MIXINv2 decorators form a DSL, and the casing signals
44
+ that the code is not plain Python data model.
45
+
30
46
 
31
47
  Step 2 — Layer cross-cutting concerns with ``@patch`` and ``@merge``
32
48
  --------------------------------------------------------------------
@@ -183,8 +199,8 @@ way:
183
199
  import UserRepository # UserRepository/ package
184
200
 
185
201
  The same decorators work on module-level functions exactly as on class methods. A
186
- subpackage becomes a nested scope — ``UserRepository/RequestScope/`` is the
187
- module equivalent of a nested ``@scope class RequestScope``.
202
+ subpackage becomes a nested scope — ``UserRepository/Request/`` is the
203
+ module equivalent of a nested ``@scope class Request``.
188
204
 
189
205
  Use ``@extend`` in a package's ``__init__.py`` to declare the composition, then
190
206
  ``evaluate()`` receives the single package: