From 44611ab186d624b697f6081c2a1af712ee177731 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 15 Jan 2023 16:12:18 -0500 Subject: [PATCH 1/2] Use pyproject toml file instead of setup.py --- pyproject.toml | 77 ++++++++++++++++++++++++++++++++++++++++- setup.py | 93 -------------------------------------------------- 2 files changed, 76 insertions(+), 94 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index f4bca6c70..f9b4eaf69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,80 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "manticore" +version = "0.3.7" +description = "Manticore is a symbolic execution tool for analysis of binaries and smart contracts." +readme = "README.md" +license = { file = "LICENSE" } +authors = [ + { name = "Trail of Bits", email = "opensource@trailofbits.com" } +] +classifiers = [ + "License :: OSI Approved :: GNU Affero General Public License v3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Development Status :: 7 - Inactive", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Topic :: Security", +] +dependencies = [ + "pyyaml", + "pysha3", + "protobuf~=3.20", + "prettytable", + "ply", + "rlp", + "intervaltree", + "crytic-compile>=0.2.2", + "wasm-tob @ git+https://github.com/trailofbits/wasm-tob.git", + "pyevmasm>=0.2.3", + "z3-solver", +] +requires-python = "<3.11,>=3.7" + +[project.urls] +Homepage = "https://pypi.org/project/manticore/" +Issues = "https://github.com/trailofbits/manticore/issues" +Source = "https://github.com/trailofbits/manticore" + +[project.scripts] +manticore = "manticore.__main__:main" +manticore-verifier = "manticore.ethereum.verifier:main" + +[project.optional-dependencies] +native = [ + "capstone==5.0.0rc2", + "pyelftools", + "unicorn~=2.0", +] +redis = ["redis"] +lint = [ + "black~=22.0", + "mypy==0.790", +] +dev-noks = [ + "build", + "manticore[native,lint]", + "coverage", + "py-evm", + "Sphinx", + "pytest>=5.3.0", + "pytest-xdist>=1.30.0", + "pytest-cov>=2.8.1", + "jinja2" +] +dev = [ + "manticore[dev-noks]", + "keystone-engine", +] + [tool.black] -target-version = ['py36'] line-length = 100 extend-exclude = ''' ( diff --git a/setup.py b/setup.py deleted file mode 100644 index 246db3e40..000000000 --- a/setup.py +++ /dev/null @@ -1,93 +0,0 @@ -import os -import sys -from setuptools import setup, find_packages -from datetime import date - -on_rtd = os.environ.get("READTHEDOCS") == "True" - - -def rtd_dependent_deps(): - # RTD tries to build z3, ooms, and fails to build. - if on_rtd: - return native_deps - else: - return ["z3-solver"] - - -# If you update native_deps please update the `REQUIREMENTS_TO_IMPORTS` dict in `utils/install_helper.py` -# (we need to know how to import a given native dependency so we can check if native dependencies are installed) -native_deps = [ - "capstone==5.0.0rc2", - "pyelftools", - "unicorn~=2.0", -] - -lint_deps = ["black~=22.0", "mypy==0.790"] - -auto_test_deps = ["py-evm"] - -# Development dependencies without keystone -dev_noks = ( - native_deps - + ["coverage", "Sphinx", "pytest>=5.3.0", "pytest-xdist>=1.30.0", "pytest-cov>=2.8.1", "jinja2"] - + lint_deps - + auto_test_deps -) - -extra_require = { - "native": native_deps, - # noks - no keystone - "dev-noks": dev_noks, - "dev": native_deps + dev_noks + ["keystone-engine"], - "redis": ["redis"], - "lint": lint_deps, -} - -this_directory = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: - long_description = f.read() - - -# https://stackoverflow.com/a/4792601 grumble grumble -version = "0.3.7" -if "--dev_release" in sys.argv: - major, minor, point = tuple(int(t) for t in version.split(".")) - dev_extension = f"dev{date.today().strftime('%y%m%d')}" - version = f"{major}.{minor}.{point + 1}.{dev_extension}" - sys.argv.remove("--dev_release") - -setup( - name="manticore", - description="Manticore is a symbolic execution tool for analysis of binaries and smart contracts.", - long_description_content_type="text/markdown", - long_description=long_description, - url="https://github.com/trailofbits/manticore", - author="Trail of Bits", - version=version, - packages=find_packages(exclude=["tests", "tests.*"]), - python_requires="<3.11,>=3.7", - install_requires=[ - "pyyaml", - "protobuf~=3.20", - # evm dependencies - "pysha3", - "prettytable", - "ply", - "rlp", - "intervaltree", - "crytic-compile>=0.2.2", - # TODO: Change this when a release is published - "wasm-tob @ git+https://github.com/trailofbits/wasm-tob.git", - "dataclasses; python_version < '3.7'", - "pyevmasm>=0.2.3", - ] - + rtd_dependent_deps(), - extras_require=extra_require, - entry_points={ - "console_scripts": [ - "manticore = manticore.__main__:main", - "manticore-verifier = manticore.ethereum.verifier:main", - ] - }, - classifiers=["License :: OSI Approved :: GNU Affero General Public License v3"], -) From d9108b252d01fdc2bc705a4d23920c7d67a6fca2 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 15 Jan 2023 19:20:20 -0500 Subject: [PATCH 2/2] Use crytic-compile <0.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f9b4eaf69..8a02902ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ "ply", "rlp", "intervaltree", - "crytic-compile>=0.2.2", + "crytic-compile<0.3,>=0.2.2", "wasm-tob @ git+https://github.com/trailofbits/wasm-tob.git", "pyevmasm>=0.2.3", "z3-solver",