pytecode 0.1.0__tar.gz → 0.2.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.
Files changed (278) hide show
  1. pytecode-0.2.0/.github/dependabot.yml +26 -0
  2. pytecode-0.2.0/.github/workflows/advisories.yml +27 -0
  3. pytecode-0.2.0/.github/workflows/artifacts.yml +91 -0
  4. pytecode-0.2.0/.github/workflows/ci.yml +172 -0
  5. pytecode-0.2.0/.github/workflows/fuzz.yml +43 -0
  6. pytecode-0.2.0/.github/workflows/release.yml +158 -0
  7. pytecode-0.2.0/.gitignore +148 -0
  8. pytecode-0.2.0/.python-version +1 -0
  9. {pytecode-0.1.0 → pytecode-0.2.0}/Cargo.lock +437 -142
  10. pytecode-0.2.0/Cargo.toml +34 -0
  11. pytecode-0.2.0/MANIFEST.in +1 -0
  12. {pytecode-0.1.0 → pytecode-0.2.0}/PKG-INFO +12 -6
  13. {pytecode-0.1.0/crates/pytecode-engine → pytecode-0.2.0}/README.md +7 -1
  14. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-archive/Cargo.toml +3 -2
  15. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-archive/benches/jar_read.rs +8 -3
  16. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-archive/src/lib.rs +207 -63
  17. pytecode-0.2.0/crates/pytecode-archive/tests/integrity.rs +108 -0
  18. pytecode-0.2.0/crates/pytecode-cli/Cargo.toml +24 -0
  19. pytecode-0.2.0/crates/pytecode-cli/src/deobfuscate.rs +478 -0
  20. pytecode-0.2.0/crates/pytecode-cli/src/jar_patcher.rs +1490 -0
  21. pytecode-0.2.0/crates/pytecode-cli/src/lib.rs +550 -0
  22. pytecode-0.2.0/crates/pytecode-cli/src/main.rs +6 -0
  23. pytecode-0.2.0/crates/pytecode-cli/tests/compat_manifest.rs +62 -0
  24. pytecode-0.2.0/crates/pytecode-cli/tests/deobfuscate.rs +192 -0
  25. pytecode-0.2.0/crates/pytecode-cli/tests/patch_jar.rs +607 -0
  26. pytecode-0.2.0/crates/pytecode-cli/tests/rewrite_smoke.rs +96 -0
  27. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/Cargo.toml +8 -3
  28. pytecode-0.2.0/crates/pytecode-engine/benches/frames.rs +89 -0
  29. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/benches/pipeline.rs +3 -2
  30. pytecode-0.2.0/crates/pytecode-engine/examples/diag_frames.rs +108 -0
  31. pytecode-0.2.0/crates/pytecode-engine/examples/writer_allocations.rs +93 -0
  32. pytecode-0.2.0/crates/pytecode-engine/fixtures/java/FrameRegression.java +72 -0
  33. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/Java25Features.java +4 -0
  34. pytecode-0.2.0/crates/pytecode-engine/fixtures/java/LdcSigns.java +35 -0
  35. pytecode-0.2.0/crates/pytecode-engine/fixtures/java/RuntimeClasses.java +21 -0
  36. pytecode-0.2.0/crates/pytecode-engine/fixtures/java/SurrogateStrings.java +21 -0
  37. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/VerifierHarness.java +13 -2
  38. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/analysis/hierarchy.rs +43 -0
  39. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/analysis/mod.rs +318 -338
  40. pytecode-0.2.0/crates/pytecode-engine/src/analysis/simulation.rs +414 -0
  41. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/analysis/verify.rs +111 -112
  42. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/bytes.rs +7 -4
  43. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/constants.rs +18 -4
  44. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/descriptors.rs +28 -10
  45. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/fixtures.rs +56 -10
  46. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/lib.rs +1 -0
  47. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/model/constant_pool_builder.rs +45 -17
  48. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/model/mod.rs +48 -119
  49. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/model/operands.rs +7 -3
  50. pytecode-0.2.0/crates/pytecode-engine/src/model/stack_map.rs +97 -0
  51. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/modified_utf8.rs +68 -8
  52. pytecode-0.2.0/crates/pytecode-engine/src/names.rs +14 -0
  53. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/constant_pool.rs +16 -6
  54. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/instructions.rs +3 -7
  55. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/reader.rs +54 -13
  56. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/signatures.rs +96 -44
  57. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/transform/transform_spec.rs +1 -1
  58. pytecode-0.2.0/crates/pytecode-engine/src/writer/attributes.rs +879 -0
  59. pytecode-0.2.0/crates/pytecode-engine/src/writer.rs +388 -0
  60. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/analysis.rs +6 -9
  61. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/descriptors.rs +12 -0
  62. pytecode-0.2.0/crates/pytecode-engine/tests/frame_semantics.rs +319 -0
  63. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/model.rs +46 -4
  64. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/modified_utf8.rs +27 -0
  65. pytecode-0.2.0/crates/pytecode-engine/tests/properties.rs +132 -0
  66. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/raw_roundtrip.rs +194 -1
  67. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/raw_unit_coverage.rs +9 -18
  68. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/signatures.rs +17 -0
  69. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/transform.rs +1 -1
  70. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/verifier.rs +1 -1
  71. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/Cargo.toml +2 -2
  72. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/archive.rs +78 -19
  73. pytecode-0.2.0/crates/pytecode-python/src/java_string.rs +30 -0
  74. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/lib.rs +7 -5
  75. pytecode-0.2.0/crates/pytecode-python/src/model/constant_pool.rs +401 -0
  76. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/model.rs +23 -407
  77. pytecode-0.2.0/docs/OVERVIEW.md +49 -0
  78. pytecode-0.2.0/docs/architecture/current-architecture.md +148 -0
  79. pytecode-0.2.0/docs/architecture/target-architecture.md +139 -0
  80. pytecode-0.2.0/docs/benchmarks.md +53 -0
  81. pytecode-0.2.0/docs/design/cfg-validation-research.md +254 -0
  82. pytecode-0.2.0/docs/design/editing-model.md +119 -0
  83. pytecode-0.2.0/docs/design/pytecode-design.md +109 -0
  84. pytecode-0.2.0/docs/design/validation-framework.md +218 -0
  85. pytecode-0.2.0/docs/project/compatibility-and-limits.md +138 -0
  86. pytecode-0.2.0/docs/project/improvement-plan-2026-09.md +352 -0
  87. pytecode-0.2.0/docs/project/performance-2026-09.md +111 -0
  88. pytecode-0.2.0/docs/project/quality-gates.md +68 -0
  89. pytecode-0.2.0/docs/project/roadmap.md +66 -0
  90. pytecode-0.2.0/docs/project/rust-jvms-25-audit.md +37 -0
  91. pytecode-0.2.0/examples/deobfuscate.py +299 -0
  92. pytecode-0.2.0/examples/patch_jar.py +819 -0
  93. pytecode-0.2.0/fuzz/.gitignore +4 -0
  94. pytecode-0.2.0/fuzz/Cargo.lock +312 -0
  95. pytecode-0.2.0/fuzz/Cargo.toml +36 -0
  96. pytecode-0.2.0/fuzz/README.md +50 -0
  97. pytecode-0.2.0/fuzz/fuzz_targets/class_parse.rs +13 -0
  98. pytecode-0.2.0/fuzz/fuzz_targets/model_lift.rs +13 -0
  99. pytecode-0.2.0/fuzz/fuzz_targets/verify_bounded.rs +50 -0
  100. {pytecode-0.1.0 → pytecode-0.2.0}/pyproject.toml +26 -9
  101. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/_rust.pyi +25 -10
  102. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/archive.py +51 -26
  103. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/classfile/__init__.py +6 -3
  104. pytecode-0.2.0/run.py +103 -0
  105. pytecode-0.2.0/rust-toolchain.toml +4 -0
  106. pytecode-0.2.0/tests/helpers.py +154 -0
  107. pytecode-0.2.0/tests/javap_parser.py +832 -0
  108. pytecode-0.2.0/tests/resources/oracle/RecordingAnalyzer.java +395 -0
  109. pytecode-0.2.0/tests/test_api_docs.py +118 -0
  110. pytecode-0.2.0/tests/test_archive_integrity.py +122 -0
  111. pytecode-0.2.0/tests/test_benchmark_jar_pipeline.py +60 -0
  112. pytecode-0.2.0/tests/test_frame_semantics.py +97 -0
  113. pytecode-0.2.0/tests/test_jar.py +748 -0
  114. pytecode-0.2.0/tests/test_java26.py +60 -0
  115. pytecode-0.2.0/tests/test_java_strings.py +41 -0
  116. pytecode-0.2.0/tests/test_javap_parser.py +422 -0
  117. pytecode-0.2.0/tests/test_jvm_verification.py +206 -0
  118. pytecode-0.2.0/tests/test_rust_bindings.py +522 -0
  119. pytecode-0.2.0/tests/test_rust_transforms.py +964 -0
  120. pytecode-0.2.0/tests/test_stub_contract.py +53 -0
  121. pytecode-0.2.0/tests/test_validate_release_tag.py +66 -0
  122. pytecode-0.2.0/tools/artifact_smoke.py +69 -0
  123. pytecode-0.2.0/tools/bench_full_comparison.py +607 -0
  124. pytecode-0.2.0/tools/bench_transform_pipeline.py +224 -0
  125. pytecode-0.2.0/tools/benchmark_jar_pipeline.py +206 -0
  126. pytecode-0.2.0/tools/build-constraints.txt +1 -0
  127. pytecode-0.2.0/tools/check_artifact.py +36 -0
  128. pytecode-0.2.0/tools/check_sdist.py +35 -0
  129. pytecode-0.2.0/tools/compare_rust_python_benchmarks.py +148 -0
  130. pytecode-0.2.0/tools/generate_api_docs.py +122 -0
  131. pytecode-0.2.0/tools/profile_jar_pipeline.py +646 -0
  132. pytecode-0.2.0/tools/profile_rust_flamegraph.py +270 -0
  133. pytecode-0.2.0/tools/seed_fuzz_corpus.py +16 -0
  134. pytecode-0.2.0/tools/validate_release_tag.py +97 -0
  135. pytecode-0.2.0/uv.lock +261 -0
  136. pytecode-0.1.0/Cargo.toml +0 -27
  137. pytecode-0.1.0/README.md +0 -396
  138. pytecode-0.1.0/crates/pytecode-archive/README.md +0 -396
  139. pytecode-0.1.0/crates/pytecode-engine/src/writer.rs +0 -1044
  140. pytecode-0.1.0/crates/pytecode-python/README.md +0 -396
  141. {pytecode-0.1.0 → pytecode-0.2.0}/LICENSE +0 -0
  142. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-archive/examples/rewrite_jar.rs +0 -0
  143. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-archive/tests/jar.rs +0 -0
  144. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/examples/finalize_main.rs +0 -0
  145. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/AbstractShape/AbstractShape.class +0 -0
  146. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/AnnotatedClass/AnnotatedClass.class +0 -0
  147. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/CfgEdgeCaseFixture/CfgEdgeCaseFixture$TrackedResource.class +0 -0
  148. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/CfgEdgeCaseFixture/CfgEdgeCaseFixture.class +0 -0
  149. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/CfgFixture/CfgFixture.class +0 -0
  150. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/Color/Color.class +0 -0
  151. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics$Builder.class +0 -0
  152. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics$ConcreteBuilder.class +0 -0
  153. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics.class +0 -0
  154. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ControlFlowExample/ControlFlowExample.class +0 -0
  155. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$1.class +0 -0
  156. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$2.class +0 -0
  157. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$3.class +0 -0
  158. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced.class +0 -0
  159. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/FieldShowcase/FieldShowcase.class +0 -0
  160. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/GenericClass/GenericClass.class +0 -0
  161. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HelloWorld/HelloWorld.class +0 -0
  162. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Animal.class +0 -0
  163. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/HierarchyFixture.class +0 -0
  164. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Mammal.class +0 -0
  165. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Pet.class +0 -0
  166. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Trainable.class +0 -0
  167. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/InstructionShowcase/InstructionShowcase.class +0 -0
  168. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/Java25Features/Java25Features$Validated.class +0 -0
  169. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/Java25Features/Java25Features.class +0 -0
  170. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase$ThrowingConsumer.class +0 -0
  171. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase$TriFunction.class +0 -0
  172. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase.class +0 -0
  173. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/MethodReferences/MethodReferences.class +0 -0
  174. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/MultiInterface/MultiInterface.class +0 -0
  175. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$1.class +0 -0
  176. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$Inner.class +0 -0
  177. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$StaticNested.class +0 -0
  178. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess.class +0 -0
  179. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/Outer/Outer$Inner.class +0 -0
  180. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/Outer/Outer.class +0 -0
  181. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/InvisibleParam.class +0 -0
  182. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/ParameterAnnotations.class +0 -0
  183. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/VisibleParam.class +0 -0
  184. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Add.class +0 -0
  185. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Expr.class +0 -0
  186. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Lit.class +0 -0
  187. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Mul.class +0 -0
  188. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Neg.class +0 -0
  189. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching.class +0 -0
  190. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Circle.class +0 -0
  191. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Line.class +0 -0
  192. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Measurable.class +0 -0
  193. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$NamedValue.class +0 -0
  194. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Pair.class +0 -0
  195. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Point.class +0 -0
  196. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Range.class +0 -0
  197. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Validated.class +0 -0
  198. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass.class +0 -0
  199. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$BorderedRectangle.class +0 -0
  200. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Circle.class +0 -0
  201. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$FilledRectangle.class +0 -0
  202. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Rectangle.class +0 -0
  203. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Shape.class +0 -0
  204. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Square.class +0 -0
  205. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Triangle.class +0 -0
  206. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy.class +0 -0
  207. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SimpleInterface/SimpleInterface.class +0 -0
  208. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/StaticInit/StaticInit.class +0 -0
  209. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods$Transformer.class +0 -0
  210. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods$Validator.class +0 -0
  211. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods.class +0 -0
  212. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/StringConcat/StringConcat.class +0 -0
  213. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SwitchExpressions/SwitchExpressions$Day.class +0 -0
  214. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/SwitchExpressions/SwitchExpressions.class +0 -0
  215. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/TryCatchExample/TryCatchExample.class +0 -0
  216. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/classes/VarArgs/VarArgs.class +0 -0
  217. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/jars/byte-buddy-1.17.5.jar +0 -0
  218. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/AbstractShape.java +0 -0
  219. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/AnnotatedClass.java +0 -0
  220. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/CfgEdgeCaseFixture.java +0 -0
  221. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/CfgFixture.java +0 -0
  222. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/Color.java +0 -0
  223. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/ComplexGenerics.java +0 -0
  224. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/ControlFlowExample.java +0 -0
  225. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/EnumAdvanced.java +0 -0
  226. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/FieldShowcase.java +0 -0
  227. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/GenericClass.java +0 -0
  228. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/HelloWorld.java +0 -0
  229. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/HierarchyFixture.java +0 -0
  230. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/InstructionShowcase.java +0 -0
  231. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/LambdaShowcase.java +0 -0
  232. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/MethodReferences.java +0 -0
  233. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/MultiInterface.java +0 -0
  234. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/NestAccess.java +0 -0
  235. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/Outer.java +0 -0
  236. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/ParameterAnnotations.java +0 -0
  237. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/PatternMatching.java +0 -0
  238. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/RecordClass.java +0 -0
  239. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/SealedHierarchy.java +0 -0
  240. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/SimpleInterface.java +0 -0
  241. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/StaticInit.java +0 -0
  242. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/StaticInterfaceMethods.java +0 -0
  243. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/StringConcat.java +0 -0
  244. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/SwitchExpressions.java +0 -0
  245. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/TryCatchExample.java +0 -0
  246. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/TypeAnnotationShowcase.java +0 -0
  247. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/fixtures/java/VarArgs.java +0 -0
  248. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/error.rs +0 -0
  249. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/indexes.rs +0 -0
  250. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/model/debug_info.rs +0 -0
  251. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/model/labels.rs +0 -0
  252. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/attributes.rs +0 -0
  253. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/info.rs +0 -0
  254. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/mod.rs +0 -0
  255. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/raw/stub.rs +0 -0
  256. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/stages.rs +0 -0
  257. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/transform/matcher_spec.rs +0 -0
  258. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/transform/mod.rs +0 -0
  259. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/src/transform/pipeline_spec.rs +0 -0
  260. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/attribute_foundation.rs +0 -0
  261. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-engine/tests/fixtures.rs +0 -0
  262. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/analysis.rs +0 -0
  263. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/attributes.rs +0 -0
  264. {pytecode-0.1.0 → pytecode-0.2.0}/crates/pytecode-python/src/transforms.rs +0 -0
  265. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/__init__.py +0 -0
  266. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/_utils.py +0 -0
  267. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/analysis/__init__.py +0 -0
  268. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/analysis/hierarchy.py +0 -0
  269. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/analysis/verify.py +0 -0
  270. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/classfile/attributes.py +0 -0
  271. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/classfile/bytecode.py +0 -0
  272. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/classfile/constants.py +0 -0
  273. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/model.py +0 -0
  274. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/py.typed +0 -0
  275. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/transforms/__init__.py +0 -0
  276. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/transforms/class_transforms.py +0 -0
  277. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/transforms/matchers.py +0 -0
  278. {pytecode-0.1.0 → pytecode-0.2.0}/pytecode/transforms/pipeline.py +0 -0
@@ -0,0 +1,26 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "cargo"
4
+ directories: ["/", "/fuzz"]
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 5
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ open-pull-requests-limit: 5
13
+ groups:
14
+ github-actions:
15
+ patterns:
16
+ - "*"
17
+
18
+ - package-ecosystem: "uv"
19
+ directory: "/"
20
+ schedule:
21
+ interval: "weekly"
22
+ open-pull-requests-limit: 5
23
+ groups:
24
+ python-dependencies:
25
+ patterns:
26
+ - "*"
@@ -0,0 +1,27 @@
1
+ name: Dependency advisories
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ paths: [Cargo.lock, fuzz/Cargo.lock, .github/workflows/advisories.yml]
7
+ pull_request:
8
+ paths: [Cargo.lock, fuzz/Cargo.lock, .github/workflows/advisories.yml]
9
+ schedule:
10
+ - cron: "17 9 * * 1"
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ audit:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+ - uses: dtolnay/rust-toolchain@stable
22
+ with:
23
+ toolchain: "1.98.1"
24
+ - uses: Swatinem/rust-cache@v2
25
+ - run: cargo install cargo-audit --version 0.22.2 --locked
26
+ - run: cargo audit --file Cargo.lock
27
+ - run: cargo audit --file fuzz/Cargo.lock
@@ -0,0 +1,91 @@
1
+ name: Installed artifacts
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+ workflow_call:
9
+ inputs:
10
+ release_ref:
11
+ type: string
12
+ default: ""
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ wheels:
19
+ name: Wheel (${{ matrix.target }})
20
+ runs-on: ${{ matrix.os }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - os: ubuntu-24.04
26
+ target: x86_64-unknown-linux-gnu
27
+ - os: ubuntu-24.04-arm
28
+ target: aarch64-unknown-linux-gnu
29
+ - os: windows-latest
30
+ target: x86_64-pc-windows-msvc
31
+ - os: windows-11-arm
32
+ target: aarch64-pc-windows-msvc
33
+ - os: macos-latest
34
+ target: aarch64-apple-darwin
35
+ - os: macos-15-intel
36
+ target: x86_64-apple-darwin
37
+ steps:
38
+ - uses: actions/checkout@v7
39
+ with:
40
+ ref: ${{ inputs.release_ref || github.ref }}
41
+ - uses: astral-sh/setup-uv@v10.1.0
42
+ with:
43
+ version: "0.12.10"
44
+ python-version: "3.12"
45
+ - uses: dtolnay/rust-toolchain@stable
46
+ with:
47
+ toolchain: "1.98.1"
48
+ - uses: PyO3/maturin-action@v1
49
+ with:
50
+ maturin-version: v1.15.0
51
+ rust-toolchain: "1.98.1"
52
+ target: ${{ matrix.target }}
53
+ args: --release --locked --out dist --compatibility pypi
54
+ manylinux: auto
55
+ - name: Test installed wheel on supported CPython versions
56
+ shell: bash
57
+ run: uv run --no-project --python 3.12 python tools/check_artifact.py dist/*.whl
58
+ - uses: actions/upload-artifact@v7
59
+ with:
60
+ name: python-package-wheel-${{ matrix.target }}
61
+ path: dist/*.whl
62
+ if-no-files-found: error
63
+
64
+ sdist:
65
+ name: Source distribution rebuild
66
+ runs-on: ubuntu-24.04
67
+ steps:
68
+ - uses: actions/checkout@v7
69
+ with:
70
+ ref: ${{ inputs.release_ref || github.ref }}
71
+ - uses: astral-sh/setup-uv@v10.1.0
72
+ with:
73
+ version: "0.12.10"
74
+ python-version: "3.12"
75
+ - uses: dtolnay/rust-toolchain@stable
76
+ with:
77
+ toolchain: "1.98.1"
78
+ - uses: Swatinem/rust-cache@v2
79
+ - name: Build source distribution with pinned backend
80
+ run: uv build --sdist --build-constraints tools/build-constraints.txt
81
+ - name: Check source distribution contents
82
+ run: uv run --no-project --python 3.12 python tools/check_sdist.py dist/*.tar.gz
83
+ - name: Build wheel from source archive in isolation
84
+ run: uv build dist/*.tar.gz --wheel --out-dir rebuilt --build-constraints tools/build-constraints.txt
85
+ - name: Test rebuilt wheel outside checkout
86
+ run: uv run --no-project --python 3.12 python tools/check_artifact.py rebuilt/*.whl
87
+ - uses: actions/upload-artifact@v7
88
+ with:
89
+ name: python-package-sdist
90
+ path: dist/*.tar.gz
91
+ if-no-files-found: error
@@ -0,0 +1,172 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main", "master"]
6
+ pull_request:
7
+ branches: ["main", "master"]
8
+
9
+ env:
10
+ PYTHON_VERSION: "3.12"
11
+ JAVA_VERSION: "25"
12
+ RUST_TOOLCHAIN: "1.98.1"
13
+ PROPTEST_RNG_SEED: "20260904"
14
+
15
+ jobs:
16
+ checks:
17
+ name: Build, lint, and test
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+ - name: Set up uv
22
+ uses: astral-sh/setup-uv@v10.1.0
23
+ with:
24
+ version: "0.12.10"
25
+ python-version: ${{ env.PYTHON_VERSION }}
26
+ enable-cache: true
27
+ cache-python: true
28
+ - name: Set up JDK
29
+ uses: actions/setup-java@v6
30
+ with:
31
+ distribution: temurin
32
+ java-version: ${{ env.JAVA_VERSION }}
33
+ - name: Set up Rust
34
+ uses: dtolnay/rust-toolchain@stable
35
+ with:
36
+ toolchain: ${{ env.RUST_TOOLCHAIN }}
37
+ components: rustfmt, clippy
38
+ - name: Cache Rust build artifacts
39
+ uses: Swatinem/rust-cache@v2
40
+ - name: Check Rust formatting
41
+ run: cargo fmt --all --check
42
+ - name: Lint Rust workspace
43
+ run: cargo clippy --workspace --all-targets --locked -- -D warnings
44
+ - name: Run Rust tests
45
+ run: cargo test --workspace --locked
46
+ - name: Sync dependencies
47
+ run: uv sync --locked --extra dev --python ${{ env.PYTHON_VERSION }}
48
+ - name: Record build provenance
49
+ run: |
50
+ rustc --version
51
+ uv --version
52
+ java -version
53
+ uv run --no-sync python -c "import sys, pytecode._rust; print(sys.version); print(pytecode._rust.__file__)"
54
+ - name: Lint
55
+ run: uv run --no-sync ruff check .
56
+ - name: Check formatting
57
+ run: uv run --no-sync ruff format --check .
58
+ - name: Type-check
59
+ run: uv run --no-sync basedpyright
60
+ - name: Run pytest
61
+ run: uv run --no-sync pytest -q
62
+ - name: Generate API docs
63
+ run: uv run --no-sync python tools/generate_api_docs.py
64
+ - name: Upload API docs artifact
65
+ if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
66
+ uses: actions/upload-artifact@v7
67
+ with:
68
+ name: github-pages-docs
69
+ path: docs/api
70
+ if-no-files-found: error
71
+
72
+ platforms:
73
+ name: Test (${{ matrix.os }}, Python ${{ matrix.python }})
74
+ runs-on: ${{ matrix.os }}
75
+ strategy:
76
+ fail-fast: false
77
+ matrix:
78
+ include:
79
+ - os: ubuntu-latest
80
+ python: "3.13"
81
+ - os: ubuntu-latest
82
+ python: "3.14"
83
+ - os: windows-latest
84
+ python: "3.14"
85
+ - os: macos-latest
86
+ python: "3.14"
87
+ steps:
88
+ - uses: actions/checkout@v7
89
+ - uses: astral-sh/setup-uv@v10.1.0
90
+ with:
91
+ version: "0.12.10"
92
+ python-version: ${{ matrix.python }}
93
+ enable-cache: true
94
+ - uses: actions/setup-java@v6
95
+ with:
96
+ distribution: temurin
97
+ java-version: "25"
98
+ - uses: dtolnay/rust-toolchain@stable
99
+ with:
100
+ toolchain: "1.98.1"
101
+ - uses: Swatinem/rust-cache@v2
102
+ - run: cargo test --workspace --locked
103
+ - run: uv sync --locked --extra dev --python ${{ matrix.python }}
104
+ - run: uv run --no-sync pytest -q
105
+ - run: uv run --no-sync python tools/generate_api_docs.py --check
106
+
107
+ msrv:
108
+ name: Minimum Rust 1.94
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - uses: actions/checkout@v7
112
+ - uses: dtolnay/rust-toolchain@stable
113
+ with:
114
+ toolchain: "1.94.0"
115
+ - uses: astral-sh/setup-uv@v10.1.0
116
+ with:
117
+ version: "0.12.10"
118
+ python-version: "3.12"
119
+ enable-cache: false
120
+ - run: cargo +1.94.0 check --workspace --locked
121
+
122
+ java26:
123
+ name: Java 26 runtime compatibility
124
+ runs-on: ubuntu-latest
125
+ env:
126
+ PYTECODE_TEST_JAVA26: "1"
127
+ steps:
128
+ - uses: actions/checkout@v7
129
+ - uses: astral-sh/setup-uv@v10.1.0
130
+ with:
131
+ version: "0.12.10"
132
+ python-version: "3.14"
133
+ - uses: actions/setup-java@v6
134
+ with:
135
+ distribution: temurin
136
+ java-version: "26"
137
+ - uses: dtolnay/rust-toolchain@stable
138
+ with:
139
+ toolchain: "1.98.1"
140
+ - uses: Swatinem/rust-cache@v2
141
+ - run: uv sync --locked --extra dev --python 3.14
142
+ - run: uv run --no-sync pytest tests/test_java26.py tests/test_frame_semantics.py tests/test_java_strings.py tests/test_jvm_verification.py -q
143
+
144
+ deploy-pages:
145
+ name: Deploy GitHub Pages
146
+ if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
147
+ needs: [checks, platforms, msrv, java26]
148
+ runs-on: ubuntu-latest
149
+ permissions:
150
+ contents: read
151
+ pages: write
152
+ id-token: write
153
+ environment:
154
+ name: github-pages
155
+ url: ${{ steps.deployment.outputs.page_url }}
156
+ steps:
157
+ - name: Configure GitHub Pages
158
+ uses: actions/configure-pages@v6
159
+ - name: Download API docs artifact
160
+ uses: actions/download-artifact@v8
161
+ with:
162
+ name: github-pages-docs
163
+ path: docs/api
164
+ - name: Disable Jekyll processing
165
+ run: touch docs/api/.nojekyll
166
+ - name: Upload GitHub Pages artifact
167
+ uses: actions/upload-pages-artifact@v5.0.0
168
+ with:
169
+ path: docs/api
170
+ - name: Deploy GitHub Pages
171
+ id: deployment
172
+ uses: actions/deploy-pages@v5.0.1
@@ -0,0 +1,43 @@
1
+ name: Fuzz
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, master]
7
+ schedule:
8
+ - cron: "23 5 * * 1"
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ fuzz:
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 30
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ target: [class_parse, model_lift, verify_bounded]
22
+ steps:
23
+ - uses: actions/checkout@v7
24
+ - uses: dtolnay/rust-toolchain@stable
25
+ with:
26
+ toolchain: nightly-2026-09-03
27
+ - uses: Swatinem/rust-cache@v2
28
+ with:
29
+ workspaces: fuzz
30
+ - run: cargo +nightly-2026-09-03 install cargo-fuzz --version 0.13.2 --locked
31
+ - run: python3 tools/seed_fuzz_corpus.py
32
+ - name: Run bounded fuzzing
33
+ env:
34
+ FUZZ_SECONDS: ${{ github.event_name == 'schedule' && '600' || '30' }}
35
+ run: |
36
+ cargo +nightly-2026-09-03 metadata --manifest-path fuzz/Cargo.toml --locked --format-version 1 > /dev/null
37
+ cargo +nightly-2026-09-03 fuzz run ${{ matrix.target }} -- -max_total_time=$FUZZ_SECONDS -timeout=10 -rss_limit_mb=2048 -max_len=262144
38
+ git diff --exit-code -- fuzz/Cargo.lock
39
+ - uses: actions/upload-artifact@v7
40
+ if: failure()
41
+ with:
42
+ name: fuzz-failures-${{ matrix.target }}
43
+ path: fuzz/artifacts
@@ -0,0 +1,158 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: Existing v<version> tag to release
11
+ required: true
12
+ type: string
13
+
14
+ env:
15
+ PYTHON_VERSION: "3.12"
16
+ JAVA_VERSION: "25"
17
+ RUST_TOOLCHAIN: "1.98.1"
18
+
19
+ jobs:
20
+ prepare:
21
+ name: Resolve release tag
22
+ runs-on: ubuntu-latest
23
+ outputs:
24
+ release_ref: ${{ steps.resolve.outputs.release_ref }}
25
+ release_tag: ${{ steps.resolve.outputs.release_tag }}
26
+ steps:
27
+ - name: Resolve release ref
28
+ id: resolve
29
+ env:
30
+ EVENT_NAME: ${{ github.event_name }}
31
+ INPUT_TAG: ${{ github.event.inputs.tag }}
32
+ REF_NAME: ${{ github.ref_name }}
33
+ run: |
34
+ if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
35
+ TAG="$INPUT_TAG"
36
+ else
37
+ TAG="$REF_NAME"
38
+ fi
39
+
40
+ if [ -z "$TAG" ]; then
41
+ echo "Release tag is required." >&2
42
+ exit 1
43
+ fi
44
+
45
+ case "$TAG" in
46
+ v*) ;;
47
+ *)
48
+ echo "Release tag must start with 'v': $TAG" >&2
49
+ exit 1
50
+ ;;
51
+ esac
52
+
53
+ echo "release_tag=$TAG" >> "$GITHUB_OUTPUT"
54
+ echo "release_ref=refs/tags/$TAG" >> "$GITHUB_OUTPUT"
55
+
56
+ validate:
57
+ name: Validate release
58
+ needs: prepare
59
+ runs-on: ubuntu-latest
60
+ permissions:
61
+ contents: read
62
+ steps:
63
+ - uses: actions/checkout@v7
64
+ with:
65
+ ref: ${{ needs.prepare.outputs.release_ref }}
66
+ - name: Set up uv
67
+ uses: astral-sh/setup-uv@v10.1.0
68
+ with:
69
+ version: "0.12.10"
70
+ python-version: ${{ env.PYTHON_VERSION }}
71
+ enable-cache: true
72
+ cache-python: true
73
+ - name: Set up JDK
74
+ uses: actions/setup-java@v6
75
+ with:
76
+ distribution: temurin
77
+ java-version: ${{ env.JAVA_VERSION }}
78
+ - name: Set up Rust
79
+ uses: dtolnay/rust-toolchain@stable
80
+ with:
81
+ toolchain: ${{ env.RUST_TOOLCHAIN }}
82
+ components: rustfmt, clippy
83
+ - name: Check Rust formatting
84
+ run: cargo fmt --all --check
85
+ - name: Lint Rust workspace
86
+ run: cargo clippy --workspace --all-targets --locked -- -D warnings
87
+ - name: Run Rust tests
88
+ run: cargo test --workspace --locked
89
+ - name: Sync dependencies
90
+ run: uv sync --locked --extra dev --python ${{ env.PYTHON_VERSION }}
91
+ - name: Validate release tag
92
+ env:
93
+ RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
94
+ run: uv run --no-sync python tools/validate_release_tag.py --tag "$RELEASE_TAG"
95
+ - name: Lint
96
+ run: uv run --no-sync ruff check .
97
+ - name: Check formatting
98
+ run: uv run --no-sync ruff format --check .
99
+ - name: Type-check
100
+ run: uv run --no-sync basedpyright
101
+ - name: Run tests
102
+ run: uv run --no-sync pytest -q
103
+ - name: Validate API docs coverage
104
+ run: uv run --no-sync python tools/generate_api_docs.py --check
105
+
106
+ artifacts:
107
+ name: Build and test distributions
108
+ needs: [prepare, validate]
109
+ uses: ./.github/workflows/artifacts.yml
110
+ with:
111
+ release_ref: ${{ needs.prepare.outputs.release_ref }}
112
+
113
+ publish:
114
+ name: Publish to PyPI
115
+ needs: [artifacts]
116
+ runs-on: ubuntu-latest
117
+ permissions:
118
+ contents: read
119
+ id-token: write
120
+ environment:
121
+ name: pypi
122
+ url: https://pypi.org/p/pytecode
123
+ steps:
124
+ - name: Download distributions
125
+ uses: actions/download-artifact@v8
126
+ with:
127
+ pattern: python-package-*
128
+ path: dist/
129
+ merge-multiple: true
130
+ - name: Publish package distributions to PyPI
131
+ uses: pypa/gh-action-pypi-publish@release/v1
132
+ with:
133
+ skip-existing: true
134
+
135
+ github-release:
136
+ name: Create GitHub Release
137
+ needs: [prepare, publish]
138
+ runs-on: ubuntu-latest
139
+ permissions:
140
+ contents: write
141
+ steps:
142
+ - name: Download distributions
143
+ uses: actions/download-artifact@v8
144
+ with:
145
+ pattern: python-package-*
146
+ path: dist/
147
+ merge-multiple: true
148
+ - name: Create or update GitHub Release
149
+ env:
150
+ GH_TOKEN: ${{ github.token }}
151
+ REPO: ${{ github.repository }}
152
+ TAG: ${{ needs.prepare.outputs.release_tag }}
153
+ run: |
154
+ if gh release view "$TAG" --repo "$REPO" > /dev/null 2>&1; then
155
+ gh release upload "$TAG" dist/* --repo "$REPO" --clobber
156
+ else
157
+ gh release create "$TAG" dist/* --repo "$REPO" --generate-notes --verify-tag
158
+ fi
@@ -0,0 +1,148 @@
1
+ # Ignore output dir and jars
2
+ output
3
+ *.jar
4
+ !crates/pytecode-engine/fixtures/jars/*.jar
5
+
6
+ # Cython compiled extensions (orphaned, replaced by Rust)
7
+ *_cy.*.pyd
8
+ *_cy.*.so
9
+
10
+ # Byte-compiled / optimized / DLL files
11
+ __pycache__/
12
+ *.py[cod]
13
+ *$py.class
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib/
24
+ lib64/
25
+ parts/
26
+ sdist/
27
+ var/
28
+ wheels/
29
+ pip-wheel-metadata/
30
+ share/python-wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+ MANIFEST
35
+
36
+ # PyInstaller
37
+ # Usually these files are written by a python script from a template
38
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
39
+ *.manifest
40
+ *.spec
41
+
42
+ # Installer logs
43
+ pip-log.txt
44
+ pip-delete-this-directory.txt
45
+
46
+ # Unit test / coverage reports
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+ .coverage
51
+ .coverage.*
52
+ .cache
53
+ nosetests.xml
54
+ coverage.xml
55
+ *.cover
56
+ *.py,cover
57
+ .hypothesis/
58
+ .pytest_cache/
59
+
60
+ # Translations
61
+ *.mo
62
+ *.pot
63
+
64
+ # Django stuff:
65
+ *.log
66
+ local_settings.py
67
+ db.sqlite3
68
+ db.sqlite3-journal
69
+
70
+ # Flask stuff:
71
+ instance/
72
+ .webassets-cache
73
+
74
+ # Scrapy stuff:
75
+ .scrapy
76
+
77
+ # Sphinx documentation
78
+ docs/_build/
79
+
80
+ # Generated API reference
81
+ docs/api/
82
+
83
+ # PyBuilder
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # .python-version is tracked to pin the development interpreter.
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
103
+ __pypackages__/
104
+
105
+ # Celery stuff
106
+ celerybeat-schedule
107
+ celerybeat.pid
108
+
109
+ # SageMath parsed files
110
+ *.sage.py
111
+
112
+ # Environments
113
+ .env
114
+ .venv
115
+ env/
116
+ venv/
117
+ ENV/
118
+ env.bak/
119
+ venv.bak/
120
+
121
+ # Spyder project settings
122
+ .spyderproject
123
+ .spyproject
124
+
125
+ # Rope project settings
126
+ .ropeproject
127
+
128
+ # mkdocs documentation
129
+ /site
130
+
131
+ # mypy
132
+ .mypy_cache/
133
+ .dmypy.json
134
+ dmypy.json
135
+
136
+ # Pyre type checker
137
+ .pyre/
138
+
139
+ # VS Code
140
+ .vscode
141
+ .ruff_cache/
142
+ .basedpyright/
143
+
144
+ # Ruff
145
+ .ruff_cache/
146
+
147
+ # uv.lock is tracked to reproduce development and CI dependencies.
148
+ pytecode/_rust.pdb
@@ -0,0 +1 @@
1
+ 3.14.7