Prepare for 0.0.1 release

This commit is contained in:
Duncan Ogilvie
2023-08-13 01:25:03 +02:00
parent b891d07dba
commit 6ca7351b5c
7 changed files with 37 additions and 44 deletions
+19 -27
View File
@@ -30,6 +30,7 @@ jobs:
shell: bash shell: bash
run: | run: |
pip install -r requirements.txt pip install -r requirements.txt
python setup.py sdist
python setup.py bdist_wheel --py-limited-api=cp37 python setup.py bdist_wheel --py-limited-api=cp37
pip install --force-reinstall dist/*.whl pip install --force-reinstall dist/*.whl
python -c "import icicle" python -c "import icicle"
@@ -97,7 +98,8 @@ jobs:
linux: linux:
# Skip building pull requests from the same repository # Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: macos-latest runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
env: env:
# Disable output buffering in an attempt to get readable errors # Disable output buffering in an attempt to get readable errors
PYTHONUNBUFFERED: '1' PYTHONUNBUFFERED: '1'
@@ -107,26 +109,21 @@ jobs:
with: with:
submodules: 'true' submodules: 'true'
- name: Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Build - name: Build
shell: bash shell: bash
run: | run: |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel
export PATH="$PATH:$HOME/.cargo/bin"
export PATH="/opt/python/cp38-cp38/bin:$PATH"
pip install -r requirements.txt pip install -r requirements.txt
python setup.py bdist_wheel --py-limited-api=cp37 python setup.py bdist_wheel --py-limited-api=cp37 --plat-name manylinux2014_x86_64
auditwheel show dist/*.whl
pip install --force-reinstall dist/*.whl pip install --force-reinstall dist/*.whl
python -c "import icicle" python -c "import icicle"
- name: Test - name: Test
run: | run: |
export PATH="/opt/python/cp38-cp38/bin:$PATH"
pip install -r tests/requirements.txt pip install -r tests/requirements.txt
python tests/example.py python tests/example.py
python tests/invalid.py python tests/invalid.py
@@ -138,34 +135,29 @@ jobs:
path: dist path: dist
release: release:
if: ${{ startsWith(github.ref, 'refs/tags/v') }} if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs: [windows, macos, linux]
- windows permissions:
- macos contents: write
- linux discussions: write
steps: steps:
- uses: actions/download-artifact@v3 - name: Download wheels
uses: actions/download-artifact@v3
with: with:
name: wheels name: wheels
path: dist
- name: Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Source distribution
run: |
python setup.py sdist
- name: Publish to PyPI - name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
with: with:
password: ${{ secrets.PYPI_API_TOKEN }} password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist/
- name: Release - name: Release
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-03-26 uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-03-26
with: with:
generate_release_notes: true generate_release_notes: true
files: dist/*
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Generated
+1 -1
View File
@@ -351,7 +351,7 @@ dependencies = [
[[package]] [[package]]
name = "icicle-python" name = "icicle-python"
version = "0.1.0" version = "0.0.1"
dependencies = [ dependencies = [
"icicle-cpu", "icicle-cpu",
"icicle-vm", "icicle-vm",
+1 -1
View File
@@ -2,7 +2,7 @@
[package] [package]
name = "icicle-python" name = "icicle-python"
version = "0.1.0" version = "0.0.1"
edition = "2021" edition = "2021"
[lib] [lib]
+2 -5
View File
@@ -1,12 +1,9 @@
include Cargo.lock include Cargo.lock
include Cargo.toml include Cargo.toml
include README.md
include build.rs include build.rs
include requirements.txt include requirements.txt
include copy-ghidra.py include copy-ghidra.py
recursive-include src * recursive-include src *
recursive-include icicle-emu * recursive-include icicle-emu *
recursive-include python *.py recursive-include python/icicle/Ghidra *
recursive-include python *.pyi recursive-include tests *
recursive-include python py.typed
recursive-include python/icicle/Ghidra *
+9 -8
View File
@@ -2,16 +2,17 @@
This project is an easy to use Python wrapper around [icicle-emu](https://github.com/icicle-emu/icicle-emu). You can read more about Icicle in the paper: [Icicle: A Re-designed Emulator for Grey-Box Firmware Fuzzing](https://arxiv.org/pdf/2301.13346.pdf) This project is an easy to use Python wrapper around [icicle-emu](https://github.com/icicle-emu/icicle-emu). You can read more about Icicle in the paper: [Icicle: A Re-designed Emulator for Grey-Box Firmware Fuzzing](https://arxiv.org/pdf/2301.13346.pdf)
## Requirements ## Installation
- [Python 3.7+](https://www.python.org/downloads/) You can install the [latest release](https://github.com/mrexodia/icicle-python/releases) from [PyPI](https://pypi.org/project/icicle-emu):
- [Rust 1.48](https://rustup.rs/)
## Building ```
pip -m install icicle-emu
```
TODO: talk about the submodule ## Development
TODO: clone ghidra and set `GHIDRA_SRC` environment variable _Note_: You need to install [Rust 1.48](https://rustup.rs) or later to build from source.
Set up a virtual environment: Set up a virtual environment:
@@ -27,5 +28,5 @@ Get the dependencies and build:
```shell ```shell
pip install -r requirements.txt pip install -r requirements.txt
maturin develop python setup.py develop
``` ```
+4 -1
View File
@@ -27,4 +27,7 @@ package_dir =
zip_safe = False zip_safe = False
setup_requires = setuptools-rust >= 0.12.1; setup_requires = setuptools-rust >= 0.12.1;
python_requires = >=3.7 python_requires = >=3.7
include_package_data = True
# Reference: https://stackoverflow.com/a/64789489/1806760
[options.package_data]
icicle = Ghidra/**/*
+1 -1
View File
@@ -11,7 +11,7 @@ if __name__ == "__main__":
raise FileNotFoundError(f"Rust not found, visit https://rustup.rs for installation instructions") raise FileNotFoundError(f"Rust not found, visit https://rustup.rs for installation instructions")
ref_name = getenv("GITHUB_REF_NAME") ref_name = getenv("GITHUB_REF_NAME")
if ref_name: if getenv("GITHUB_REF", "").startswith("refs/tags/") and ref_name:
from pkg_resources import parse_version from pkg_resources import parse_version
try: try:
parse_version(ref_name) parse_version(ref_name)