From be1d3da159d443d369b2517a3a212bca79c044ad Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Tue, 9 May 2023 04:23:28 -0700 Subject: [PATCH] Add pyproject.toml to python bindings (#1239) * Add pyproject.toml to python bindings * Improve pyproject.toml * Update CI pipeline to use pip to install python bindings --- .github/workflows/build_and_test.yml | 2 +- bindings/pylibafl/.gitignore | 1 + bindings/pylibafl/pyproject.toml | 26 ++++++++++++++++++++++++++ bindings/pylibafl/rust-toolchain | 1 - 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 bindings/pylibafl/.gitignore create mode 100644 bindings/pylibafl/pyproject.toml delete mode 100644 bindings/pylibafl/rust-toolchain diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e3b8011974..3dd6fff2a0 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -163,7 +163,7 @@ jobs: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - name: Run a maturin build - run: cd ./bindings/pylibafl && python3 -m venv .env && . .env/bin/activate && maturin develop && ./test.sh + run: cd ./bindings/pylibafl && python3 -m venv .env && . .env/bin/activate && pip install . && ./test.sh - name: Run python test run: . ./bindings/pylibafl/.env/bin/activate && cd ./fuzzers/baby_fuzzer && python3 baby_fuzzer.py 2>&1 | grep "Bye" diff --git a/bindings/pylibafl/.gitignore b/bindings/pylibafl/.gitignore new file mode 100644 index 0000000000..849ddff3b7 --- /dev/null +++ b/bindings/pylibafl/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/bindings/pylibafl/pyproject.toml b/bindings/pylibafl/pyproject.toml new file mode 100644 index 0000000000..ada2464bb5 --- /dev/null +++ b/bindings/pylibafl/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["maturin[patchelf]>=0.14.10,<0.15"] +build-backend = "maturin" + +[project] +name = "PyLibAFL" +version = "0.10.0" +description = "Advanced Fuzzing Library for Python" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "Apache-2.0"} +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: MIT License", + "Programming Language :: Rust", + "Topic :: Security", +] + +[project.urls] +repository = "https://github.com/AFLplusplus/LibAFL.git" + +[tool.maturin] +bindings = "pylibafl" +manifest-path = "Cargo.toml" +python-source = "python" +all-features = true diff --git a/bindings/pylibafl/rust-toolchain b/bindings/pylibafl/rust-toolchain deleted file mode 100644 index bf867e0ae5..0000000000 --- a/bindings/pylibafl/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly