terser-hints 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.
@@ -0,0 +1,6 @@
1
+ ### Python
2
+ **/__pycache__/
3
+ *.py[cod]
4
+
5
+ ### Patches
6
+ **/work/patched/
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: terser-hints
3
+ Version: 0.1.0
4
+ Summary: Type hint stubs for py-terser
5
+ Project-URL: source, https://github.com/MadeByAlpha/py-terser.git
6
+ Project-URL: issues, https://github.com/MadeByAlpha/py-terser/issues
7
+ Author-email: Alpha <dev@alpha93.kr>
8
+ License-Expression: MIT
9
+ Keywords: compressor,mangler,minifier,minify,uglifier,uglify
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Environment :: Plugins
13
+ Classifier: Framework :: Hatch
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: Free Threading
25
+ Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
26
+ Classifier: Programming Language :: Python :: Implementation :: CPython
27
+ Classifier: Topic :: Software Development :: Build Tools
28
+ Classifier: Topic :: Software Development :: Libraries
29
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
+ Classifier: Topic :: Software Development :: Pre-processors
31
+ Classifier: Topic :: Text Processing :: General
32
+ Classifier: Topic :: Utilities
33
+ Requires-Python: >=3.10
File without changes
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [tool.hatch.build.targets.wheel]
6
+ packages = ["src/terser_hints.py"]
7
+
8
+ [tool.hatch.build.targets.force-include]
9
+ "src/terser_hints.py" = "terser_hints.py"
10
+ "src/terser_hints.pyi" = "terser_hints.pyi"
11
+
12
+
13
+ [project]
14
+ name = "terser-hints"
15
+ version = "0.1.0"
16
+ authors = [{ name = "Alpha", email = "dev@alpha93.kr" }]
17
+ description = "Type hint stubs for py-terser"
18
+ keywords = ["minify", "minifier", "uglify", "uglifier", "mangler", "compressor"]
19
+ readme = "README.md"
20
+ license = "MIT"
21
+ classifiers = [
22
+ "Environment :: Console",
23
+ "Environment :: Plugins",
24
+ "Framework :: Hatch",
25
+ "Topic :: Software Development :: Build Tools",
26
+ "Topic :: Software Development :: Libraries",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ "Topic :: Software Development :: Pre-processors",
29
+ "Topic :: Text Processing :: General",
30
+ "Topic :: Utilities",
31
+
32
+ "Programming Language :: Python",
33
+ "Programming Language :: Python :: 3",
34
+ "Programming Language :: Python :: 3 :: Only",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Programming Language :: Python :: 3.13",
39
+ "Programming Language :: Python :: 3.14",
40
+ #"Programming Language :: Python :: 3.15", # TODO
41
+ "Programming Language :: Python :: Free Threading",
42
+ "Programming Language :: Python :: Free Threading :: 3 - Stable",
43
+ "Programming Language :: Python :: Implementation :: CPython",
44
+
45
+ "Intended Audience :: Developers",
46
+ "License :: OSI Approved :: MIT License",
47
+
48
+ "Development Status :: 3 - Alpha",
49
+ ]
50
+
51
+ requires-python = ">=3.10"
52
+ dependencies = []
53
+
54
+ [dependency-groups]
55
+
56
+
57
+ [project.urls]
58
+ source = "https://github.com/MadeByAlpha/py-terser.git"
59
+ issues = "https://github.com/MadeByAlpha/py-terser/issues"
@@ -0,0 +1,13 @@
1
+ preserve_docstring = preserve_annotations = not_none = inline = lambda x: x
2
+ constant = lambda x: x()
3
+ unreachable = lambda: None
4
+
5
+
6
+ __all__ = (
7
+ "constant",
8
+ "inline",
9
+ "not_none",
10
+ "preserve_annotations",
11
+ "preserve_docstring",
12
+ "unreachable",
13
+ )
@@ -0,0 +1,42 @@
1
+ from collections.abc import Callable
2
+ from typing import Never, TypeGuard
3
+
4
+ def preserve_docstring[T: type | Callable](obj: T, /) -> T:
5
+ """
6
+ Marker decorator: tells terser to keep this class/function's docstring
7
+ even when docstring removal is otherwise enabled. Detected statically,
8
+ a no-op at runtime.
9
+ """
10
+
11
+ def preserve_annotations[T: type | Callable](obj: T, /) -> T:
12
+ """
13
+ Marker decorator: tells terser to keep this function/class's type annotations
14
+ even when annotation removal is otherwise enabled. Detected statically,
15
+ a no-op at runtime.
16
+ """
17
+
18
+ def inline[T: Callable](obj: T, /) -> T:
19
+ ...
20
+
21
+ def not_none[T](value: T | None, /) -> T:
22
+ ...
23
+
24
+ def constant[T](func: Callable[[], T], /) -> T:
25
+ """
26
+ Marker decorator: tells terser this function is only ever called once, to
27
+ compute a constant - immediately call it and rebind its name to the result,
28
+ the same as the `@lambda _: _()` idiom. Detected statically; at runtime this
29
+ just calls `fn` once and returns its result.
30
+ """
31
+
32
+ def unreachable() -> Never:
33
+ ...
34
+
35
+ __all__ = (
36
+ "constant",
37
+ "inline",
38
+ "not_none",
39
+ "preserve_annotations",
40
+ "preserve_docstring",
41
+ "unreachable",
42
+ )