codegen-2 2.16.0__tar.gz → 2.16.1__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,31 @@
1
+ Metadata-Version: 2.3
2
+ Name: codegen-2
3
+ Version: 2.16.1
4
+ Summary: Meta-programming
5
+ Author: Binh Vu
6
+ Author-email: Binh Vu <binh@toan2.com>
7
+ License: MIT
8
+ Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
9
+ Requires-Dist: autoflake>=2.2.1 ; extra == 'dev'
10
+ Requires-Python: >=3.11
11
+ Provides-Extra: dev
12
+ Description-Content-Type: text/markdown
13
+
14
+ # codegen
15
+
16
+ `codegen` is a small code generation library for building Python and partial TypeScript output from a lightweight AST.
17
+
18
+ - PyPI/package name: `codegen-2`
19
+ - Import path: `codegen`
20
+ - Main public module: `codegen.models`
21
+ - Python requirement: `>=3.11`
22
+
23
+ Use this import pattern:
24
+
25
+ ```python
26
+ from codegen.models import Program, DeferredVar, ImportHelper, expr, stmt
27
+ ```
28
+
29
+ The top-level `codegen/__init__.py` is empty, so `from codegen import Program` does not work.
30
+
31
+ Full reference: [docs/codegen-reference.md](docs/codegen-reference.md)
@@ -0,0 +1,18 @@
1
+ # codegen
2
+
3
+ `codegen` is a small code generation library for building Python and partial TypeScript output from a lightweight AST.
4
+
5
+ - PyPI/package name: `codegen-2`
6
+ - Import path: `codegen`
7
+ - Main public module: `codegen.models`
8
+ - Python requirement: `>=3.11`
9
+
10
+ Use this import pattern:
11
+
12
+ ```python
13
+ from codegen.models import Program, DeferredVar, ImportHelper, expr, stmt
14
+ ```
15
+
16
+ The top-level `codegen/__init__.py` is empty, so `from codegen import Program` does not work.
17
+
18
+ Full reference: [docs/codegen-reference.md](docs/codegen-reference.md)
@@ -66,6 +66,9 @@ class ExprConstant(Expr):
66
66
  + "}"
67
67
  )
68
68
  if isinstance(val, set):
69
+ if len(val) == 0:
70
+ return "set()"
71
+
69
72
  return (
70
73
  "{"
71
74
  + ", ".join(sorted((ExprConstant.constant_to_python(v) for v in val)))
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codegen-2"
3
- version = "2.16.0"
3
+ version = "2.16.1"
4
4
  description = "Meta-programming"
5
5
  authors = [{ name = "Binh Vu", email = "binh@toan2.com" }]
6
6
  license = { text = "MIT" }
codegen_2-2.16.0/PKG-INFO DELETED
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: codegen-2
3
- Version: 2.16.0
4
- Summary: Meta-programming
5
- Author: Binh Vu
6
- Author-email: Binh Vu <binh@toan2.com>
7
- License: MIT
8
- Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
9
- Requires-Dist: autoflake>=2.2.1 ; extra == 'dev'
10
- Requires-Python: >=3.11
11
- Provides-Extra: dev
12
- Description-Content-Type: text/markdown
13
-
14
- # codegen
15
- Meta-programming
@@ -1,2 +0,0 @@
1
- # codegen
2
- Meta-programming