codecin 5.4.2__tar.gz → 5.4.3__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.
Files changed (90) hide show
  1. {codecin-5.4.2 → codecin-5.4.3}/PKG-INFO +1 -1
  2. {codecin-5.4.2 → codecin-5.4.3}/codecin/__init__.py +1 -1
  3. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/version_gen.go +1 -1
  4. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/PKG-INFO +1 -1
  5. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/SOURCES.txt +1 -1
  6. codecin-5.4.3/setup.py +76 -0
  7. codecin-5.4.2/codecin/libcodecin_native.so +0 -0
  8. {codecin-5.4.2 → codecin-5.4.3}/LICENSE +0 -0
  9. {codecin-5.4.2 → codecin-5.4.3}/README.md +0 -0
  10. {codecin-5.4.2 → codecin-5.4.3}/codecin/aot.py +0 -0
  11. {codecin-5.4.2 → codecin-5.4.3}/codecin/assembler.py +0 -0
  12. {codecin-5.4.2 → codecin-5.4.3}/codecin/cache.py +0 -0
  13. {codecin-5.4.2 → codecin-5.4.3}/codecin/cin.py +0 -0
  14. {codecin-5.4.2 → codecin-5.4.3}/codecin/cli.py +0 -0
  15. {codecin-5.4.2 → codecin-5.4.3}/codecin/config.py +0 -0
  16. {codecin-5.4.2 → codecin-5.4.3}/codecin/console.py +0 -0
  17. {codecin-5.4.2 → codecin-5.4.3}/codecin/cpu.py +0 -0
  18. {codecin-5.4.2 → codecin-5.4.3}/codecin/crom.py +0 -0
  19. {codecin-5.4.2 → codecin-5.4.3}/codecin/debugger.py +0 -0
  20. {codecin-5.4.2 → codecin-5.4.3}/codecin/disasm.py +0 -0
  21. {codecin-5.4.2 → codecin-5.4.3}/codecin/errors.py +0 -0
  22. {codecin-5.4.2 → codecin-5.4.3}/codecin/isa.py +0 -0
  23. {codecin-5.4.2 → codecin-5.4.3}/codecin/jit.py +0 -0
  24. {codecin-5.4.2 → codecin-5.4.3}/codecin/logger.py +0 -0
  25. {codecin-5.4.2 → codecin-5.4.3}/codecin/memory.py +0 -0
  26. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/aot.go +0 -0
  27. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/build.go +0 -0
  28. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/aot/stub_main.go.txt +0 -0
  29. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/build.ps1 +0 -0
  30. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/build.sh +0 -0
  31. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/cmd/codecin/main.go +0 -0
  32. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/codegen.go +0 -0
  33. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/compile_test.go +0 -0
  34. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/parser.go +0 -0
  35. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/syscalls.go +0 -0
  36. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/tokenizer.go +0 -0
  37. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/compiler/types.go +0 -0
  38. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio.go +0 -0
  39. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio_other.go +0 -0
  40. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/audio_windows.go +0 -0
  41. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/canvas.go +0 -0
  42. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/crom.go +0 -0
  43. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/encode.go +0 -0
  44. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/engine_test.go +0 -0
  45. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/isa_gen.go +0 -0
  46. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/system.go +0 -0
  47. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/termux.go +0 -0
  48. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/engine/vm.go +0 -0
  49. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/go.mod +0 -0
  50. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/ir/ir.go +0 -0
  51. {codecin-5.4.2 → codecin-5.4.3}/codecin/native/main.go +0 -0
  52. {codecin-5.4.2 → codecin-5.4.3}/codecin/native.py +0 -0
  53. {codecin-5.4.2 → codecin-5.4.3}/codecin/registers.py +0 -0
  54. {codecin-5.4.2 → codecin-5.4.3}/codecin/stats.py +0 -0
  55. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/dependency_links.txt +0 -0
  56. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/entry_points.txt +0 -0
  57. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/requires.txt +0 -0
  58. {codecin-5.4.2 → codecin-5.4.3}/codecin.egg-info/top_level.txt +0 -0
  59. {codecin-5.4.2 → codecin-5.4.3}/pyproject.toml +0 -0
  60. {codecin-5.4.2 → codecin-5.4.3}/setup.cfg +0 -0
  61. {codecin-5.4.2 → codecin-5.4.3}/tests/test_aot.py +0 -0
  62. {codecin-5.4.2 → codecin-5.4.3}/tests/test_assembler_ext.py +0 -0
  63. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cache.py +0 -0
  64. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_host.py +0 -0
  65. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_new_features.py +0 -0
  66. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_syntax.py +0 -0
  67. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cin_system.py +0 -0
  68. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cli.py +0 -0
  69. {codecin-5.4.2 → codecin-5.4.3}/tests/test_compiler_errors.py +0 -0
  70. {codecin-5.4.2 → codecin-5.4.3}/tests/test_cpu_interpreted.py +0 -0
  71. {codecin-5.4.2 → codecin-5.4.3}/tests/test_debugger.py +0 -0
  72. {codecin-5.4.2 → codecin-5.4.3}/tests/test_examples.py +0 -0
  73. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_ab.py +0 -0
  74. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_crom_mmu.py +0 -0
  75. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_import.py +0 -0
  76. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_importloc.py +0 -0
  77. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_mmu.py +0 -0
  78. {codecin-5.4.2 → codecin-5.4.3}/tests/test_features_remote.py +0 -0
  79. {codecin-5.4.2 → codecin-5.4.3}/tests/test_go_compiler.py +0 -0
  80. {codecin-5.4.2 → codecin-5.4.3}/tests/test_isa_dispatch.py +0 -0
  81. {codecin-5.4.2 → codecin-5.4.3}/tests/test_isa_single_source.py +0 -0
  82. {codecin-5.4.2 → codecin-5.4.3}/tests/test_libs.py +0 -0
  83. {codecin-5.4.2 → codecin-5.4.3}/tests/test_libs_ext.py +0 -0
  84. {codecin-5.4.2 → codecin-5.4.3}/tests/test_literals_and_bom.py +0 -0
  85. {codecin-5.4.2 → codecin-5.4.3}/tests/test_memory_protection.py +0 -0
  86. {codecin-5.4.2 → codecin-5.4.3}/tests/test_native_hardening.py +0 -0
  87. {codecin-5.4.2 → codecin-5.4.3}/tests/test_switch_semantics.py +0 -0
  88. {codecin-5.4.2 → codecin-5.4.3}/tests/test_three_paths.py +0 -0
  89. {codecin-5.4.2 → codecin-5.4.3}/tests/test_version.py +0 -0
  90. {codecin-5.4.2 → codecin-5.4.3}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codecin
3
- Version: 5.4.2
3
+ Version: 5.4.3
4
4
  Summary: Code CIN - 高级语言与运行时 (CIN/PL/ASM 工具链 + Go 原生 VM + ARM64/RISC-V/FP/Vector 指令集)
5
5
  Author: ByUsi Studio, 北啊呢
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- __version__ = "5.4.2"
1
+ __version__ = "5.4.3"
2
2
  __author__ = "ByUsi Studio"
3
3
 
4
4
  from .config import Config
@@ -4,4 +4,4 @@
4
4
  package engine
5
5
 
6
6
  // BuildVersion 是 Code CIN 的版本号 (被 codecin_version() 与日志使用)。
7
- const BuildVersion = "5.4.2"
7
+ const BuildVersion = "5.4.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codecin
3
- Version: 5.4.2
3
+ Version: 5.4.3
4
4
  Summary: Code CIN - 高级语言与运行时 (CIN/PL/ASM 工具链 + Go 原生 VM + ARM64/RISC-V/FP/Vector 指令集)
5
5
  Author: ByUsi Studio, 北啊呢
6
6
  License: MIT
@@ -1,6 +1,7 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
+ setup.py
4
5
  codecin/__init__.py
5
6
  codecin/aot.py
6
7
  codecin/assembler.py
@@ -16,7 +17,6 @@ codecin/disasm.py
16
17
  codecin/errors.py
17
18
  codecin/isa.py
18
19
  codecin/jit.py
19
- codecin/libcodecin_native.so
20
20
  codecin/logger.py
21
21
  codecin/memory.py
22
22
  codecin/native.py
codecin-5.4.3/setup.py ADDED
@@ -0,0 +1,76 @@
1
+ import os
2
+ import platform
3
+ import shutil
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ from setuptools import setup
9
+ from setuptools.command.build_py import build_py
10
+
11
+ ROOT = Path(__file__).resolve().parent
12
+ NATIVE = ROOT / "codecin" / "native"
13
+ PKG = ROOT / "codecin"
14
+
15
+ EXT = {"Windows": ".dll", "Darwin": ".dylib"}.get(platform.system(), ".so")
16
+
17
+ LIB_NAMES = ["libcodecin_native" + EXT, "codecin_native" + EXT]
18
+
19
+
20
+ def _should_skip() -> bool:
21
+
22
+ if os.environ.get("CODECIN_SKIP_NATIVE", "0") == "1":
23
+ return True
24
+ if os.environ.get("CODECIN_NO_GO", "0") == "1":
25
+ return True
26
+ return False
27
+
28
+
29
+ def _go_available() -> bool:
30
+ if shutil.which("go") is None:
31
+ print("[codecin] 'go' not found in PATH — 跳过原生库构建", file=sys.stderr)
32
+ return False
33
+ return True
34
+
35
+
36
+ def build_native_lib() -> None:
37
+ if _should_skip():
38
+ print("[codecin] 环境变量要求跳过原生构建")
39
+ return
40
+
41
+ if os.environ.get("CODECIN_FORCE_REBUILD", "1") != "1":
42
+ if any((PKG / n).exists() for n in LIB_NAMES):
43
+ print("[codecin] 原生库已存在,跳过重建")
44
+ return
45
+
46
+ if not _go_available():
47
+ return
48
+
49
+ system = platform.system()
50
+ if system == "Windows":
51
+ script = NATIVE / "build.ps1"
52
+ cmd = [
53
+ "powershell", "-NoProfile",
54
+ "-ExecutionPolicy", "Bypass",
55
+ "-File", str(script),
56
+ ]
57
+ else:
58
+ script = NATIVE / "build.sh"
59
+ cmd = ["bash", str(script)]
60
+
61
+ if not script.exists():
62
+ print(f"[codecin] 未找到 {script},跳过", file=sys.stderr)
63
+ return
64
+
65
+ print(f"[codecin] 编译原生库: {' '.join(cmd)} (cwd={NATIVE})")
66
+ subprocess.check_call(cmd, cwd=str(NATIVE))
67
+
68
+
69
+ class BuildPyWithNative(build_py):
70
+
71
+ def run(self):
72
+ build_native_lib()
73
+ super().run()
74
+
75
+
76
+ setup(cmdclass={"build_py": BuildPyWithNative})
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes