From 37542dc69d707c3b7726fe759e7240d89faf775f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:44:23 +0000 Subject: [PATCH] Deployed 57cbb4e with MkDocs version: 1.5.3 --- .nojekyll | 0 404.html | 406 + api/index.html | 770 ++ assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.8fd75fb4.min.js | 29 + assets/javascripts/bundle.8fd75fb4.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/stylesheets/main.f2e4d321.min.css | 1 + assets/stylesheets/main.f2e4d321.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + faq/index.html | 586 ++ favicon.ico | Bin 0 -> 4286 bytes getting-started/index.html | 558 ++ index.html | 529 ++ modguard_screencap.gif | Bin 0 -> 360508 bytes modguard_screencap_2x.gif | Bin 0 -> 271038 bytes search/search_index.json | 1 + sitemap.xml | 33 + sitemap.xml.gz | Bin 0 -> 255 bytes usage/index.html | 585 ++ why-modguard/index.html | 543 ++ 57 files changed, 11301 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 api/index.html create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.8fd75fb4.min.js create mode 100644 assets/javascripts/bundle.8fd75fb4.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/stylesheets/main.f2e4d321.min.css create mode 100644 assets/stylesheets/main.f2e4d321.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 faq/index.html create mode 100644 favicon.ico create mode 100644 getting-started/index.html create mode 100644 index.html create mode 100644 modguard_screencap.gif create mode 100644 modguard_screencap_2x.gif create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 usage/index.html create mode 100644 why-modguard/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..f30a4b0d --- /dev/null +++ b/404.html @@ -0,0 +1,406 @@ + + + +
+ + + + + + + + + + + + + + +modguard.Boundary
A Boundary
makes all internal members private by default.
Boundary
accepts no arguments, and has no runtime behavior. It is detected statically by modguard
.
+
__init__.py
When a Boundary
appears in __init__.py
, this marks the contents of the entire package as private by default.
+
# project/core/inner.py
+# This function will be considered private
+# due to the boundary at 'project.core'
+def private_function():
+ ...
+
When a Boundary
appears in a standalone Python file, this marks the contents of the file itself as private by default.
+
# project/core/other.py
+from modguard import Boundary
+
+Boundary()
+
+# This function will be considered private
+# due to the boundary at 'project.core.other'
+def other_private_function():
+ ...
+
modguard.public
Marking a member as public
allows it to be imported outside its boundary. This should be used to mark the intended public interface of a package or module.
public
can be used as either a decorator or a bare function, and has no runtime behavior. It is detected statically by modguard
.
public
accepts one optional positional argument (path
) and one optional keyword argument (allowlist
).
When present, path
identifies the object being marked as public.
+
import modguard
+
+x: int = 3
+
+# These are functionally the same
+modguard.public("x")
+modguard.public(x)
+
When present, allowlist
defines a list of module paths which are allowed to import the object. Modules which are descendants of the modules in the allowlist
are also allowed. If any other modules import the object, they will be flagged as errors by modguard
.
+
# In project/utils.py
+import modguard
+
+x: int = 3
+
+modguard.public(x, allowlist=["project.core.domain"])
+
+...
+# In project/core/other_domain/logic.py
+# This import is not allowed,
+# because the module ('project.core.other_domain.logic')
+# is not contained by any module in the allowlist
+from project.utils import x
+
public
can also be used as a decorator to mark functions and classes as public. Its behavior is the same as when used as a function, and it accepts the same keyword arguments (the decorated object is treated as path
)
import modguard
+
+@modguard.public(allowlist=["project.core.domain"])
+def my_pub_function():
+ ...
+
When public
is used without a path
argument, it signifies that the entire containing module is public. This means that any top-level member of the module or the module itself can be imported externally (subject to allowlist
).
+
# In project/core/logic.py
+import modguard
+
+modguard.public()
+...
+# In project/cli.py
+# This import is allowed because 'project.core.logic' is public
+from project.core import logic
+
__init__.py
When public
is used without a path
argument in the __init__.py
of a package, the top-level module of the package is treated as public.
+
# In project/core/__init__.py
+import modguard
+
+modguard.Boundary()
+modguard.public()
+...
+# In project/cli.py
+# This import is allowed because 'project.core' is public
+from project import core
+
modguard-ignore
To ignore a particular import which should be allowed unconditionally, use the modguard-ignore
comment directive.
+
modguard-ignore
should match the alias as it is used in the subsequent import line, not the full module path from the project root.
+Note: Boundary violations are detected at the import layer. This means that specific nonstandard custom syntax to access modules/submodules such as getattr or dynamically generated namespaces will not be caught by modguard.
+ + + + + + + + + + + + + +{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var Va=/["'&<>]/;qn.exports=za;function za(e){var t=""+e,r=Va.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i