From f3a88278c0183d8a778a573214f2a2adf989e6fe Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Fri, 28 Mar 2025 16:59:44 -0700 Subject: [PATCH 1/2] Migrate setup.py to pyproject.toml --- pyproject.toml | 18 ++++++++++++++++++ setup.py | 30 ------------------------------ 2 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index fed528d..8bd8645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,21 @@ [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" + +[project] +name = "rex" +version = "0.02" +dependencies = [ + "angr", + "archr", + "angrop", + "jinja2", + "tracer", + "povsim", + "compilerex", + "pwntools", + "flaky", +] + +[tool.setuptools.package-data] +"rex.scripter.templates" = ["*.j2"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 27cc053..0000000 --- a/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -import os -import subprocess - -try: - from setuptools import setup - from setuptools import find_packages - packages = find_packages() -except ImportError: - from distutils.core import setup - packages = [x.strip('./').replace('/', '.') for x in os.popen('find -name "__init__.py" | xargs -n1 dirname').read().strip().split('\n')] - -setup( - name='rex', - version='0.02', - packages=packages, - install_requires=[ - 'angr', - 'archr', - 'angrop', - 'jinja2', - 'tracer', - 'povsim', - 'compilerex', - 'pwntools', - 'flaky', - ], - package_data={ - 'rex.scripter.templates': ['*.j2'] - }, -) From aeb9657aae69989518c7f5ecc6654301150cd291 Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Fri, 28 Mar 2025 17:09:43 -0700 Subject: [PATCH 2/2] Add uv-based CI --- .github/workflows/ci.yml | 25 +++++++++++++++++++++---- .gitignore | 1 + pyproject.toml | 16 +++++++++++++++- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4153aa2..6f0d922 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,29 @@ -name: CI +name: Test on: push: branches: - - "master" + - master pull_request: workflow_dispatch: jobs: - ci: - uses: angr/ci-settings/.github/workflows/angr-ci.yml@master + test: + strategy: + matrix: + python-version: ["3.10", "3.13"] + fail-fast: false + name: Test Python ${{ matrix.python-version }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - run: uv sync --dev + - run: uv run pytest diff --git a/.gitignore b/.gitignore index bb66f84..37432ed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.egg-info dist build +uv.lock diff --git a/pyproject.toml b/pyproject.toml index 8bd8645..eef9f31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,22 @@ dependencies = [ "povsim", "compilerex", "pwntools", - "flaky", ] [tool.setuptools.package-data] "rex.scripter.templates" = ["*.j2"] + +[dependency-groups] +dev = [ + "flaky", + "pytest", + "pytest-xdist", +] + +[tool.uv.sources] +angr = { git = "https://github.com/angr/angr.git" } +archr = { git = "https://github.com/angr/archr.git" } +angrop = { git = "https://github.com/angr/angrop.git" } +tracer = { git = "https://github.com/angr/tracer.git" } +povsim = { git = "https://github.com/mechaphish/povsim.git" } +compilerex = { git = "https://github.com/mechaphish/compilerex.git" }