pytecode 0.0.3__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.
- pytecode-0.2.0/.github/dependabot.yml +26 -0
- pytecode-0.2.0/.github/workflows/advisories.yml +27 -0
- pytecode-0.2.0/.github/workflows/artifacts.yml +91 -0
- pytecode-0.2.0/.github/workflows/ci.yml +172 -0
- pytecode-0.2.0/.github/workflows/fuzz.yml +43 -0
- pytecode-0.2.0/.github/workflows/release.yml +158 -0
- pytecode-0.2.0/.gitignore +148 -0
- pytecode-0.2.0/.python-version +1 -0
- pytecode-0.2.0/Cargo.lock +1260 -0
- pytecode-0.2.0/Cargo.toml +34 -0
- pytecode-0.2.0/PKG-INFO +435 -0
- pytecode-0.2.0/README.md +402 -0
- pytecode-0.2.0/crates/pytecode-archive/Cargo.toml +26 -0
- pytecode-0.2.0/crates/pytecode-archive/benches/jar_read.rs +40 -0
- pytecode-0.2.0/crates/pytecode-archive/examples/rewrite_jar.rs +41 -0
- pytecode-0.2.0/crates/pytecode-archive/src/lib.rs +673 -0
- pytecode-0.2.0/crates/pytecode-archive/tests/integrity.rs +108 -0
- pytecode-0.2.0/crates/pytecode-archive/tests/jar.rs +281 -0
- pytecode-0.2.0/crates/pytecode-cli/Cargo.toml +24 -0
- pytecode-0.2.0/crates/pytecode-cli/src/deobfuscate.rs +478 -0
- pytecode-0.2.0/crates/pytecode-cli/src/jar_patcher.rs +1490 -0
- pytecode-0.2.0/crates/pytecode-cli/src/lib.rs +550 -0
- pytecode-0.2.0/crates/pytecode-cli/src/main.rs +6 -0
- pytecode-0.2.0/crates/pytecode-cli/tests/compat_manifest.rs +62 -0
- pytecode-0.2.0/crates/pytecode-cli/tests/deobfuscate.rs +192 -0
- pytecode-0.2.0/crates/pytecode-cli/tests/patch_jar.rs +607 -0
- pytecode-0.2.0/crates/pytecode-cli/tests/rewrite_smoke.rs +96 -0
- pytecode-0.2.0/crates/pytecode-engine/Cargo.toml +38 -0
- pytecode-0.2.0/crates/pytecode-engine/benches/frames.rs +89 -0
- pytecode-0.2.0/crates/pytecode-engine/benches/pipeline.rs +169 -0
- pytecode-0.2.0/crates/pytecode-engine/examples/diag_frames.rs +108 -0
- pytecode-0.2.0/crates/pytecode-engine/examples/finalize_main.rs +33 -0
- pytecode-0.2.0/crates/pytecode-engine/examples/writer_allocations.rs +93 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/AbstractShape/AbstractShape.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/AnnotatedClass/AnnotatedClass.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/CfgEdgeCaseFixture/CfgEdgeCaseFixture$TrackedResource.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/CfgEdgeCaseFixture/CfgEdgeCaseFixture.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/CfgFixture/CfgFixture.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/Color/Color.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics$Builder.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics$ConcreteBuilder.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ComplexGenerics/ComplexGenerics.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ControlFlowExample/ControlFlowExample.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$1.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$2.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced$3.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/EnumAdvanced/EnumAdvanced.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/FieldShowcase/FieldShowcase.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/GenericClass/GenericClass.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HelloWorld/HelloWorld.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Animal.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/HierarchyFixture.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Mammal.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Pet.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/HierarchyFixture/fixture/hierarchy/Trainable.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/InstructionShowcase/InstructionShowcase.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/Java25Features/Java25Features$Validated.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/Java25Features/Java25Features.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase$ThrowingConsumer.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase$TriFunction.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/LambdaShowcase/LambdaShowcase.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/MethodReferences/MethodReferences.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/MultiInterface/MultiInterface.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$1.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$Inner.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess$StaticNested.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/NestAccess/NestAccess.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/Outer/Outer$Inner.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/Outer/Outer.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/InvisibleParam.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/ParameterAnnotations.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/ParameterAnnotations/VisibleParam.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Add.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Expr.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Lit.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Mul.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching$Neg.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/PatternMatching/PatternMatching.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Circle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Line.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Measurable.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$NamedValue.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Pair.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Point.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Range.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass$Validated.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/RecordClass/RecordClass.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$BorderedRectangle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Circle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$FilledRectangle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Rectangle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Shape.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Square.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy$Triangle.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SealedHierarchy/SealedHierarchy.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SimpleInterface/SimpleInterface.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/StaticInit/StaticInit.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods$Transformer.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods$Validator.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/StaticInterfaceMethods/StaticInterfaceMethods.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/StringConcat/StringConcat.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SwitchExpressions/SwitchExpressions$Day.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/SwitchExpressions/SwitchExpressions.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/TryCatchExample/TryCatchExample.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/classes/VarArgs/VarArgs.class +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/jars/byte-buddy-1.17.5.jar +0 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/AbstractShape.java +16 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/AnnotatedClass.java +15 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/CfgEdgeCaseFixture.java +179 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/CfgFixture.java +267 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/Color.java +7 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/ComplexGenerics.java +100 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/ControlFlowExample.java +42 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/EnumAdvanced.java +47 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/FieldShowcase.java +11 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/FrameRegression.java +72 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/GenericClass.java +11 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/HelloWorld.java +10 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/HierarchyFixture.java +27 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/InstructionShowcase.java +156 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/Java25Features.java +74 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/LambdaShowcase.java +115 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/LdcSigns.java +35 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/MethodReferences.java +55 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/MultiInterface.java +14 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/NestAccess.java +81 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/Outer.java +11 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/ParameterAnnotations.java +19 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/PatternMatching.java +103 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/RecordClass.java +96 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/RuntimeClasses.java +21 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/SealedHierarchy.java +120 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/SimpleInterface.java +11 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/StaticInit.java +15 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/StaticInterfaceMethods.java +63 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/StringConcat.java +64 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/SurrogateStrings.java +21 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/SwitchExpressions.java +99 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/TryCatchExample.java +22 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/TypeAnnotationShowcase.java +34 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/VarArgs.java +37 -0
- pytecode-0.2.0/crates/pytecode-engine/fixtures/java/VerifierHarness.java +279 -0
- pytecode-0.2.0/crates/pytecode-engine/src/analysis/hierarchy.rs +448 -0
- pytecode-0.2.0/crates/pytecode-engine/src/analysis/mod.rs +1203 -0
- pytecode-0.2.0/crates/pytecode-engine/src/analysis/simulation.rs +414 -0
- pytecode-0.2.0/crates/pytecode-engine/src/analysis/verify.rs +2175 -0
- pytecode-0.2.0/crates/pytecode-engine/src/bytes.rs +132 -0
- pytecode-0.2.0/crates/pytecode-engine/src/constants.rs +346 -0
- pytecode-0.2.0/crates/pytecode-engine/src/descriptors.rs +236 -0
- pytecode-0.2.0/crates/pytecode-engine/src/error.rs +52 -0
- pytecode-0.2.0/crates/pytecode-engine/src/fixtures.rs +638 -0
- pytecode-0.2.0/crates/pytecode-engine/src/indexes.rs +197 -0
- pytecode-0.2.0/crates/pytecode-engine/src/lib.rs +26 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/constant_pool_builder.rs +773 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/debug_info.rs +18 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/labels.rs +122 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/mod.rs +2213 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/operands.rs +201 -0
- pytecode-0.2.0/crates/pytecode-engine/src/model/stack_map.rs +97 -0
- pytecode-0.2.0/crates/pytecode-engine/src/modified_utf8.rs +187 -0
- pytecode-0.2.0/crates/pytecode-engine/src/names.rs +14 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/attributes.rs +643 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/constant_pool.rs +203 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/info.rs +35 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/instructions.rs +253 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/mod.rs +34 -0
- pytecode-0.2.0/crates/pytecode-engine/src/raw/stub.rs +11 -0
- pytecode-0.2.0/crates/pytecode-engine/src/reader.rs +1299 -0
- pytecode-0.2.0/crates/pytecode-engine/src/signatures.rs +487 -0
- pytecode-0.2.0/crates/pytecode-engine/src/stages.rs +45 -0
- pytecode-0.2.0/crates/pytecode-engine/src/transform/matcher_spec.rs +1480 -0
- pytecode-0.2.0/crates/pytecode-engine/src/transform/mod.rs +847 -0
- pytecode-0.2.0/crates/pytecode-engine/src/transform/pipeline_spec.rs +484 -0
- pytecode-0.2.0/crates/pytecode-engine/src/transform/transform_spec.rs +706 -0
- pytecode-0.2.0/crates/pytecode-engine/src/writer/attributes.rs +879 -0
- pytecode-0.2.0/crates/pytecode-engine/src/writer.rs +388 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/analysis.rs +292 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/attribute_foundation.rs +111 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/descriptors.rs +91 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/fixtures.rs +37 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/frame_semantics.rs +319 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/model.rs +573 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/modified_utf8.rs +62 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/properties.rs +132 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/raw_roundtrip.rs +1208 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/raw_unit_coverage.rs +1927 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/signatures.rs +158 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/transform.rs +284 -0
- pytecode-0.2.0/crates/pytecode-engine/tests/verifier.rs +651 -0
- pytecode-0.2.0/crates/pytecode-python/Cargo.toml +27 -0
- pytecode-0.2.0/crates/pytecode-python/src/analysis.rs +315 -0
- pytecode-0.2.0/crates/pytecode-python/src/archive.rs +608 -0
- pytecode-0.2.0/crates/pytecode-python/src/attributes.rs +2367 -0
- pytecode-0.2.0/crates/pytecode-python/src/java_string.rs +30 -0
- pytecode-0.2.0/crates/pytecode-python/src/lib.rs +2435 -0
- pytecode-0.2.0/crates/pytecode-python/src/model/constant_pool.rs +401 -0
- pytecode-0.2.0/crates/pytecode-python/src/model.rs +3030 -0
- pytecode-0.2.0/crates/pytecode-python/src/transforms.rs +1406 -0
- pytecode-0.2.0/docs/OVERVIEW.md +49 -0
- pytecode-0.2.0/docs/architecture/current-architecture.md +148 -0
- pytecode-0.2.0/docs/architecture/target-architecture.md +139 -0
- pytecode-0.2.0/docs/benchmarks.md +53 -0
- pytecode-0.2.0/docs/design/cfg-validation-research.md +254 -0
- pytecode-0.2.0/docs/design/editing-model.md +119 -0
- pytecode-0.2.0/docs/design/pytecode-design.md +109 -0
- pytecode-0.2.0/docs/design/validation-framework.md +218 -0
- pytecode-0.2.0/docs/project/compatibility-and-limits.md +138 -0
- pytecode-0.2.0/docs/project/improvement-plan-2026-09.md +352 -0
- pytecode-0.2.0/docs/project/performance-2026-09.md +111 -0
- pytecode-0.2.0/docs/project/quality-gates.md +68 -0
- pytecode-0.2.0/docs/project/roadmap.md +66 -0
- pytecode-0.2.0/docs/project/rust-jvms-25-audit.md +37 -0
- pytecode-0.2.0/examples/deobfuscate.py +299 -0
- pytecode-0.2.0/examples/patch_jar.py +819 -0
- pytecode-0.2.0/fuzz/.gitignore +4 -0
- pytecode-0.2.0/fuzz/Cargo.lock +312 -0
- pytecode-0.2.0/fuzz/Cargo.toml +36 -0
- pytecode-0.2.0/fuzz/README.md +50 -0
- pytecode-0.2.0/fuzz/fuzz_targets/class_parse.rs +13 -0
- pytecode-0.2.0/fuzz/fuzz_targets/model_lift.rs +13 -0
- pytecode-0.2.0/fuzz/fuzz_targets/verify_bounded.rs +50 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/pyproject.toml +41 -24
- pytecode-0.2.0/pytecode/__init__.py +24 -0
- pytecode-0.2.0/pytecode/_rust.pyi +2352 -0
- pytecode-0.2.0/pytecode/_utils.py +37 -0
- pytecode-0.2.0/pytecode/analysis/__init__.py +50 -0
- pytecode-0.2.0/pytecode/analysis/hierarchy.py +233 -0
- pytecode-0.2.0/pytecode/analysis/verify.py +54 -0
- pytecode-0.2.0/pytecode/archive.py +374 -0
- pytecode-0.2.0/pytecode/classfile/__init__.py +76 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/pytecode/classfile/attributes.py +99 -101
- pytecode-0.2.0/pytecode/classfile/bytecode.py +239 -0
- pytecode-0.2.0/pytecode/model.py +238 -0
- pytecode-0.2.0/pytecode/transforms/__init__.py +188 -0
- pytecode-0.2.0/pytecode/transforms/class_transforms.py +85 -0
- pytecode-0.2.0/pytecode/transforms/matchers.py +310 -0
- pytecode-0.2.0/pytecode/transforms/pipeline.py +167 -0
- pytecode-0.2.0/run.py +103 -0
- pytecode-0.2.0/rust-toolchain.toml +4 -0
- pytecode-0.2.0/tests/helpers.py +154 -0
- pytecode-0.2.0/tests/javap_parser.py +832 -0
- pytecode-0.2.0/tests/resources/oracle/RecordingAnalyzer.java +395 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/tests/test_api_docs.py +31 -28
- pytecode-0.2.0/tests/test_archive_integrity.py +122 -0
- pytecode-0.2.0/tests/test_benchmark_jar_pipeline.py +60 -0
- pytecode-0.2.0/tests/test_frame_semantics.py +97 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/tests/test_jar.py +318 -36
- pytecode-0.2.0/tests/test_java26.py +60 -0
- pytecode-0.2.0/tests/test_java_strings.py +41 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/tests/test_javap_parser.py +0 -4
- pytecode-0.2.0/tests/test_jvm_verification.py +206 -0
- pytecode-0.2.0/tests/test_rust_bindings.py +522 -0
- pytecode-0.2.0/tests/test_rust_transforms.py +964 -0
- pytecode-0.2.0/tests/test_stub_contract.py +53 -0
- pytecode-0.2.0/tools/artifact_smoke.py +69 -0
- pytecode-0.2.0/tools/bench_full_comparison.py +607 -0
- pytecode-0.2.0/tools/bench_transform_pipeline.py +224 -0
- pytecode-0.2.0/tools/benchmark_jar_pipeline.py +206 -0
- pytecode-0.2.0/tools/build-constraints.txt +1 -0
- pytecode-0.2.0/tools/check_artifact.py +36 -0
- pytecode-0.2.0/tools/check_sdist.py +35 -0
- pytecode-0.2.0/tools/compare_rust_python_benchmarks.py +148 -0
- pytecode-0.2.0/tools/generate_api_docs.py +122 -0
- pytecode-0.2.0/tools/profile_jar_pipeline.py +646 -0
- pytecode-0.2.0/tools/profile_rust_flamegraph.py +270 -0
- pytecode-0.2.0/tools/seed_fuzz_corpus.py +16 -0
- pytecode-0.2.0/tools/validate_release_tag.py +97 -0
- pytecode-0.2.0/uv.lock +261 -0
- pytecode-0.0.3/PKG-INFO +0 -228
- pytecode-0.0.3/README.md +0 -202
- pytecode-0.0.3/pytecode/__init__.py +0 -22
- pytecode-0.0.3/pytecode/_internal/__init__.py +0 -1
- pytecode-0.0.3/pytecode/_internal/bytes_utils.py +0 -208
- pytecode-0.0.3/pytecode/analysis/__init__.py +0 -2402
- pytecode-0.0.3/pytecode/analysis/hierarchy.py +0 -561
- pytecode-0.0.3/pytecode/analysis/verify.py +0 -1400
- pytecode-0.0.3/pytecode/archive/__init__.py +0 -271
- pytecode-0.0.3/pytecode/classfile/__init__.py +0 -14
- pytecode-0.0.3/pytecode/classfile/constant_pool.py +0 -196
- pytecode-0.0.3/pytecode/classfile/descriptors.py +0 -791
- pytecode-0.0.3/pytecode/classfile/info.py +0 -123
- pytecode-0.0.3/pytecode/classfile/instructions.py +0 -495
- pytecode-0.0.3/pytecode/classfile/modified_utf8.py +0 -145
- pytecode-0.0.3/pytecode/classfile/reader.py +0 -810
- pytecode-0.0.3/pytecode/classfile/writer.py +0 -630
- pytecode-0.0.3/pytecode/edit/__init__.py +0 -12
- pytecode-0.0.3/pytecode/edit/_attribute_clone.py +0 -546
- pytecode-0.0.3/pytecode/edit/constant_pool_builder.py +0 -1246
- pytecode-0.0.3/pytecode/edit/debug_info.py +0 -319
- pytecode-0.0.3/pytecode/edit/labels.py +0 -1237
- pytecode-0.0.3/pytecode/edit/model.py +0 -980
- pytecode-0.0.3/pytecode/edit/operands.py +0 -683
- pytecode-0.0.3/pytecode/transforms/__init__.py +0 -954
- pytecode-0.0.3/pytecode.egg-info/PKG-INFO +0 -228
- pytecode-0.0.3/pytecode.egg-info/SOURCES.txt +0 -59
- pytecode-0.0.3/pytecode.egg-info/dependency_links.txt +0 -1
- pytecode-0.0.3/pytecode.egg-info/requires.txt +0 -6
- pytecode-0.0.3/pytecode.egg-info/top_level.txt +0 -1
- pytecode-0.0.3/setup.cfg +0 -4
- pytecode-0.0.3/tests/test_analysis.py +0 -2963
- pytecode-0.0.3/tests/test_attributes.py +0 -1118
- pytecode-0.0.3/tests/test_bytes_utils.py +0 -610
- pytecode-0.0.3/tests/test_cfg_oracle.py +0 -241
- pytecode-0.0.3/tests/test_class_reader.py +0 -441
- pytecode-0.0.3/tests/test_class_writer.py +0 -135
- pytecode-0.0.3/tests/test_constant_pool.py +0 -411
- pytecode-0.0.3/tests/test_constant_pool_builder.py +0 -1165
- pytecode-0.0.3/tests/test_debug_info.py +0 -337
- pytecode-0.0.3/tests/test_descriptors.py +0 -586
- pytecode-0.0.3/tests/test_helpers.py +0 -318
- pytecode-0.0.3/tests/test_hierarchy.py +0 -290
- pytecode-0.0.3/tests/test_instructions.py +0 -724
- pytecode-0.0.3/tests/test_labels.py +0 -860
- pytecode-0.0.3/tests/test_model.py +0 -1281
- pytecode-0.0.3/tests/test_modified_utf8.py +0 -33
- pytecode-0.0.3/tests/test_operands.py +0 -855
- pytecode-0.0.3/tests/test_transforms.py +0 -1064
- pytecode-0.0.3/tests/test_validation.py +0 -146
- pytecode-0.0.3/tests/test_verify.py +0 -2111
- {pytecode-0.0.3 → pytecode-0.2.0}/LICENSE +0 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/MANIFEST.in +0 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/pytecode/classfile/constants.py +0 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/pytecode/py.typed +0 -0
- {pytecode-0.0.3 → pytecode-0.2.0}/tests/test_validate_release_tag.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
|