novelty-namespace 0.1.0__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.

Potentially problematic release.


This version of novelty-namespace might be problematic. Click here for more details.

@@ -0,0 +1,13 @@
1
+ # Authors
2
+
3
+ ## Technical leads
4
+
5
+ - Jonathan Dung - owner
6
+
7
+ ## Developers
8
+
9
+ - Jonathan Dung - sole maintainer
10
+
11
+ ## All other contributors and their affiliations
12
+
13
+ None at the moment.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jonathan Dung
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: novelty-namespace
3
+ Version: 0.1.0
4
+ Author: Jonathan Dung
5
+ Author-email: Jonathan Dung <jonathandung@yahoo.com>
6
+ License-Expression: MIT
7
+ License-File: AUTHORS.md
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Maintainer: Jonathan Dung
12
+ Maintainer-email: Jonathan Dung <jonathandung@yahoo.com>
13
+ Description-Content-Type: text/markdown
14
+
File without changes
@@ -0,0 +1,64 @@
1
+ # Copyright (c) 2026 Jonathan Dung
2
+ # All rights reserved.
3
+ """Provides a metaclass for creating self-contained namespaces with inheritance support."""
4
+ import types
5
+ from contextlib import suppress
6
+
7
+
8
+ class NamespaceMeta(type):
9
+ __cnt = __import__("itertools").count()
10
+
11
+ def __new__(cls, n, b, a, /, **k): # ruff: ignore[undocumented-public-method]
12
+ if (c := k.pop("metaclass")) is not cls:
13
+ x = f"NamespaceMeta is not compatible with {c}"
14
+ raise TypeError(x)
15
+ if (m := a.get("__module__")) is None:
16
+ m = f"<unknown-{next(cls.__cnt)}>"
17
+ return _Namespace(f"{m}.{n}", types.resolve_bases(b), {**a, **k})
18
+
19
+
20
+ __reg = {}
21
+
22
+ class _Namespace:
23
+ def __init__(self, *a):
24
+ __reg[id(self)] = a
25
+
26
+ def __getattribute__(self, n, a=suppress(AttributeError), b=suppress(KeyError), /):
27
+ r = __reg[id(self)]
28
+ with b:
29
+ return r[2][n]
30
+ for c in r[1]:
31
+ with a:
32
+ return getattr(c, n)
33
+ raise AttributeError(n)
34
+
35
+ def __setattr__(self, n, v, /):
36
+ __reg[id(self)][2][n] = v
37
+
38
+ def __delattr__(self, n, /):
39
+ del __reg[id(self)][2][n]
40
+
41
+ def __repr__(self):
42
+ return f"<namespace {__reg[id(self)][0]}>"
43
+
44
+ def __del__(self):
45
+ del __reg[id(self)]
46
+
47
+ __hash__ = None
48
+
49
+
50
+ def extract_dict(ns, *, writethrough=False):
51
+ """Give a dictionary representing the members of the namespace.
52
+
53
+ Args:
54
+ ns: The namespace to extract the dictionary from.
55
+ writethrough: If True, the returned dictionary will be a reference to the
56
+ internal dictionary of the namespace; otherwise, a copy of the internal
57
+ dictionary will be returned, which is the default behaviour.
58
+
59
+ Returns:
60
+ A dictionary representing the members of the namespace.
61
+
62
+ """
63
+ d = __reg[id(ns)][2]
64
+ return d if writethrough else d.copy()
File without changes
@@ -0,0 +1,84 @@
1
+ [build-system]
2
+ build-backend = "uv_build"
3
+ requires = ["uv_build>=0.12.11"]
4
+
5
+ [dependency-groups]
6
+
7
+ [project]
8
+ classifiers = [
9
+ "Development Status :: 3 - Alpha",
10
+ "Programming Language :: Python :: 3",
11
+ ]
12
+ license = "MIT"
13
+ license-files = [
14
+ "AUTHORS.md",
15
+ "LICENSE",
16
+ ]
17
+ name = "novelty-namespace"
18
+ readme = "README.md"
19
+ version = "0.1.0"
20
+
21
+ [[project.authors]]
22
+ name = "Jonathan Dung"
23
+ email = "jonathandung@yahoo.com"
24
+
25
+ [[project.maintainers]]
26
+ name = "Jonathan Dung"
27
+ email = "jonathandung@yahoo.com"
28
+
29
+ [tool.ruff]
30
+ required-version = ">=0.16.6"
31
+
32
+ [tool.ruff.lint]
33
+ ignore = [
34
+ "missing-whitespace-around-arithmetic-operator",
35
+ "missing-whitespace-around-bitwise-or-shift-operator",
36
+ "missing-whitespace-around-parameter-equals",
37
+ "multi-line-summary-second-line",
38
+ "blank-line-before-class",
39
+ "too-few-spaces-before-inline-comment",
40
+ "blank-line-between-methods",
41
+ "blank-lines-top-level",
42
+ "blank-lines-after-function-or-class",
43
+ "blank-lines-before-nested-definition",
44
+ "line-too-long",
45
+ "multiple-statements-on-one-line-colon",
46
+ "multiple-statements-on-one-line-semicolon",
47
+ "ambiguous-variable-name",
48
+ "non-ascii-name",
49
+ "non-ascii-import-name",
50
+ "docstring-in-stub",
51
+ "mutable-class-default",
52
+ "non-empty-init-module",
53
+ "raise-vanilla-args",
54
+ ]
55
+ preview = true
56
+ select = ["ALL"]
57
+ typing-extensions = false
58
+
59
+ [tool.ruff.lint.flake8-bugbear]
60
+ extend-immutable-calls = ["contextlib.suppress"]
61
+
62
+ [tool.ruff.lint.per-file-ignores]
63
+ "*.py" = [
64
+ "ANN",
65
+ "undocumented-magic-method",
66
+ "undocumented-public-class",
67
+ ]
68
+ "docs/source/conf.py" = [
69
+ "implicit-namespace-package",
70
+ "missing-copyright-notice",
71
+ "undocumented-public-module",
72
+ "undocumented-public-package",
73
+ ]
74
+
75
+ [tool.ty.rules]
76
+ all = "error"
77
+ missing-override-decorator = "ignore"
78
+
79
+ [tool.uv]
80
+ required-version = ">=0.12.11"
81
+
82
+ [tool.uv.build-backend]
83
+ module-name = "novelty_namespace"
84
+ module-root = ""
@@ -0,0 +1,42 @@
1
+ [build-system]
2
+ build-backend = "uv_build"
3
+ requires = ["uv_build>=0.12.11"]
4
+
5
+ [dependency-groups]
6
+
7
+ [project]
8
+ authors = [{name = "Jonathan Dung", email = "jonathandung@yahoo.com"}]
9
+ classifiers = ["Development Status :: 3 - Alpha", "Programming Language :: Python :: 3"]
10
+ license = "MIT"
11
+ license-files = ["AUTHORS.md", "LICENSE"]
12
+ maintainers = [{name = "Jonathan Dung", email = "jonathandung@yahoo.com"}]
13
+ name = "novelty-namespace"
14
+ readme = "README.md"
15
+ version = "0.1.0"
16
+
17
+ [tool.ruff]
18
+ required-version = ">=0.16.6"
19
+
20
+ [tool.ruff.lint]
21
+ ignore = ["missing-whitespace-around-arithmetic-operator", "missing-whitespace-around-bitwise-or-shift-operator", "missing-whitespace-around-parameter-equals", "multi-line-summary-second-line", "blank-line-before-class", "too-few-spaces-before-inline-comment", "blank-line-between-methods", "blank-lines-top-level", "blank-lines-after-function-or-class", "blank-lines-before-nested-definition", "line-too-long", "multiple-statements-on-one-line-colon", "multiple-statements-on-one-line-semicolon", "ambiguous-variable-name", "non-ascii-name", "non-ascii-import-name", "docstring-in-stub", "mutable-class-default", "non-empty-init-module", "raise-vanilla-args"]
22
+ preview = true
23
+ select = ["ALL"]
24
+ typing-extensions = false
25
+
26
+ [tool.ruff.lint.flake8-bugbear]
27
+ extend-immutable-calls = ["contextlib.suppress"]
28
+
29
+ [tool.ruff.lint.per-file-ignores]
30
+ "*.py" = ["ANN", "undocumented-magic-method", "undocumented-public-class"]
31
+ "docs/source/conf.py" = ["implicit-namespace-package", "missing-copyright-notice", "undocumented-public-module", "undocumented-public-package"]
32
+
33
+ [tool.ty.rules]
34
+ all = "error"
35
+ missing-override-decorator = "ignore"
36
+
37
+ [tool.uv]
38
+ required-version = ">=0.12.11"
39
+
40
+ [tool.uv.build-backend]
41
+ module-name = "novelty_namespace"
42
+ module-root = ""