netherframe.codec.autoid 0.4.0__tar.gz → 0.6.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.
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/PKG-INFO +2 -3
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/netherframe/codec/autoid/codec_registration.py +1 -2
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/netherframe/codec/autoid/preprocessor.py +7 -9
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/pyproject.toml +3 -4
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/pyproject.toml.orig +3 -4
- netherframe_codec_autoid-0.4.0/data/purelib/nf_codec_autoid_autoregister.pth +0 -1
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/LICENSE +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/README.md +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/data/purelib/nf_codec_autoid_autoregister.start +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/netherframe/codec/autoid/__init__.py +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/netherframe/codec/autoid/py.typed +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/__init__.py +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/codec_registration.py +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/preprocessor.py +0 -0
- {netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: netherframe.codec.autoid
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Auto-ID codec and preprocessor for Netherframe
|
|
5
5
|
Author: Sourabh Cheedella
|
|
6
6
|
Author-email: Sourabh Cheedella <cheedella.sourabh@gmail.com>
|
|
@@ -8,10 +8,9 @@ License-Expression: MIT
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.15
|
|
13
12
|
Requires-Dist: libcst>=1.9.0
|
|
14
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.15
|
|
15
14
|
Project-URL: Homepage, https://netherframe.arsenal.sh
|
|
16
15
|
Project-URL: Repository, https://github.com/arsenal-sh/netherframe
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Register the nf_autoid source codec without importing the preprocessor.
|
|
2
2
|
|
|
3
|
-
This module is loaded by a .start entry point (
|
|
4
|
-
at every interpreter start, so it must stay cheap: libcst and the preprocessor
|
|
3
|
+
This module is loaded by a .start entry point (PEP 829) at every interpreter start, so it must stay cheap: libcst and the preprocessor
|
|
5
4
|
load only when a source file actually declares ``# coding: nf_autoid``.
|
|
6
5
|
"""
|
|
7
6
|
|
|
@@ -5,8 +5,8 @@ injects variable names into Netherframe construct instantiations using LibCST
|
|
|
5
5
|
and registers a custom codec for transparent preprocessing during imports.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from collections.abc import Buffer
|
|
9
8
|
import codecs
|
|
9
|
+
from collections.abc import Buffer
|
|
10
10
|
|
|
11
11
|
import libcst as cst
|
|
12
12
|
|
|
@@ -268,9 +268,7 @@ class LibCSTTransformer(cst.CSTTransformer):
|
|
|
268
268
|
# So we don't wrap these automatically
|
|
269
269
|
return updated_node
|
|
270
270
|
|
|
271
|
-
_NON_CONSTRUCT_BUILTINS = frozenset(
|
|
272
|
-
{"open", "dict", "list", "set", "tuple", "str", "int", "float", "bool", "bytes", "object", "range", "enumerate", "zip", "map", "filter", "iter"}
|
|
273
|
-
)
|
|
271
|
+
_NON_CONSTRUCT_BUILTINS = frozenset({"open", "dict", "list", "set", "tuple", "str", "int", "float", "bool", "bytes", "object", "range", "enumerate", "zip", "map", "filter", "iter"})
|
|
274
272
|
|
|
275
273
|
def leave_With(self, original_node: cst.With, updated_node: cst.With) -> cst.With:
|
|
276
274
|
"""Transform context manager assignments when BindContext is present."""
|
|
@@ -287,8 +285,8 @@ class LibCSTTransformer(cst.CSTTransformer):
|
|
|
287
285
|
continue
|
|
288
286
|
var_name = self._extract_asname(item.asname)
|
|
289
287
|
if var_name:
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
new_items.append(item.with_changes(item=self._inject_nf_id(item.item, var_name)))
|
|
289
|
+
continue
|
|
292
290
|
new_items.append(item)
|
|
293
291
|
|
|
294
292
|
return updated_node.with_changes(items=new_items)
|
|
@@ -355,16 +353,16 @@ def create_autoid_codec() -> codecs.CodecInfo:
|
|
|
355
353
|
from codecs import utf_8_encode
|
|
356
354
|
|
|
357
355
|
class AutoIdIncrementalDecoder(codecs.BufferedIncrementalDecoder):
|
|
358
|
-
def _buffer_decode(
|
|
356
|
+
def _buffer_decode(
|
|
359
357
|
self,
|
|
360
|
-
|
|
358
|
+
input: Buffer, # noqa: A002 - match BufferedIncrementalDecoder's keyword parameter
|
|
361
359
|
errors: str,
|
|
362
360
|
final: bool,
|
|
363
361
|
) -> tuple[str, int]:
|
|
364
362
|
if not final:
|
|
365
363
|
return "", 0
|
|
366
364
|
# Decode as UTF-8 first
|
|
367
|
-
input_bytes = bytes(
|
|
365
|
+
input_bytes = bytes(input)
|
|
368
366
|
data = input_bytes.decode("utf-8", errors)
|
|
369
367
|
# Apply our preprocessing
|
|
370
368
|
processed = preprocess_source(data)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "netherframe.codec.autoid"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
4
4
|
description = "Auto-ID codec and preprocessor for Netherframe"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.15"
|
|
7
7
|
classifiers = [
|
|
8
8
|
"Development Status :: 4 - Beta",
|
|
9
9
|
"Intended Audience :: Developers",
|
|
10
|
-
"Programming Language :: Python :: 3.14",
|
|
11
10
|
"Programming Language :: Python :: 3.15",
|
|
12
11
|
]
|
|
13
12
|
license = "MIT"
|
|
@@ -23,7 +22,7 @@ Homepage = "https://netherframe.arsenal.sh"
|
|
|
23
22
|
Repository = "https://github.com/arsenal-sh/netherframe"
|
|
24
23
|
|
|
25
24
|
[build-system]
|
|
26
|
-
requires = ["uv_build>=0.13.
|
|
25
|
+
requires = ["uv_build>=0.13.10,<0.14.0"]
|
|
27
26
|
build-backend = "uv_build"
|
|
28
27
|
|
|
29
28
|
[tool.uv]
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "netherframe.codec.autoid"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
4
4
|
description = "Auto-ID codec and preprocessor for Netherframe"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Sourabh Cheedella", email = "cheedella.sourabh@gmail.com"},
|
|
7
7
|
]
|
|
8
8
|
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.15"
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Development Status :: 4 - Beta",
|
|
12
12
|
"Intended Audience :: Developers",
|
|
13
|
-
"Programming Language :: Python :: 3.14",
|
|
14
13
|
"Programming Language :: Python :: 3.15",
|
|
15
14
|
]
|
|
16
15
|
license = "MIT"
|
|
@@ -24,7 +23,7 @@ Homepage = "https://netherframe.arsenal.sh"
|
|
|
24
23
|
Repository = "https://github.com/arsenal-sh/netherframe"
|
|
25
24
|
|
|
26
25
|
[build-system]
|
|
27
|
-
requires = ["uv_build>=0.13.
|
|
26
|
+
requires = ["uv_build>=0.13.10,<0.14.0"]
|
|
28
27
|
build-backend = "uv_build"
|
|
29
28
|
|
|
30
29
|
[tool.uv]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import netherframe.codec.autoid.codec_registration
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/netherframe/codec/autoid/py.typed
RENAMED
|
File without changes
|
{netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{netherframe_codec_autoid-0.4.0 → netherframe_codec_autoid-0.6.0}/nf/codec/autoid/preprocessor.py
RENAMED
|
File without changes
|
|
File without changes
|