mixinv2 0.3.0.post29.dev0__tar.gz → 0.3.0.post32.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.
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/PKG-INFO +1 -1
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/tutorial.rst +18 -2
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/.gitignore +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/README.md +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/Makefile +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/_static/favicon.svg +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/_static/logo.svg +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/conf.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/index.rst +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/installation.rst +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/mixinv2-tutorial.rst +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/docs/specification.md +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/pyproject.toml +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/__init__.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_config.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_core.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_interned_linked_list.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_mixin_directory.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_mixin_parser.py +0 -0
- {mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.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.
|
|
3
|
+
Version: 0.3.0.post32.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/
|
|
187
|
-
module equivalent of a nested ``@scope class
|
|
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:
|
|
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
|
{mixinv2-0.3.0.post29.dev0 → mixinv2-0.3.0.post32.dev0}/src/mixinv2/_interned_linked_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|