From 93cc87ec9279495da664b14b910e929fc23f96ec Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 17 Aug 2023 05:31:46 +0100 Subject: [PATCH] Use recent cytoolz and move cython installation to setup.py (#1794) * use recent cytoolz * use recent cytoolz * use recent cytoolz --- requirements.txt | 3 +-- setup.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index be244a75d..7180de1ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ blake2b-py coloredlogs>=10.0 coincurve>=13.0.0 -cython -cytoolz<0.12.0 +cytoolz>=0.12.0 asn1crypto>=0.22.0 configparser>=3.5.0 coverage<7.0,>6.0 diff --git a/setup.py b/setup.py index 8df3550ca..815239554 100755 --- a/setup.py +++ b/setup.py @@ -8,11 +8,20 @@ 2) #> twine upload dist/* #; #optional --repository or --repository-url """ from setuptools import setup, find_packages -from setuptools.command.install import install +from setuptools.command.install import install as _install +from subprocess import check_call + import sys import os import io + +class InstallCommand(_install): + def run(self): + check_call([sys.executable, "-m", "pip", "install", "cython"]) + _install.run(self) + + # Package meta-data. NAME = "mythril" DESCRIPTION = "Security analysis tool for Ethereum smart contracts" @@ -80,7 +89,7 @@ def get_requirements(): # Package version (vX.Y.Z). It must match git tag being used for CircleCI # deployment; otherwise the build will failed. -class VerifyVersionCommand(install): +class VerifyVersionCommand(_install): """Custom command to verify that the git tag matches our version.""" description = "verify that the git tag matches our version" @@ -126,5 +135,5 @@ def run(self): package_data={"mythril.analysis.templates": ["*"], "mythril.support.assets": ["*"]}, include_package_data=True, entry_points={"console_scripts": ["myth=mythril.interfaces.cli:main"]}, - cmdclass={"verify": VerifyVersionCommand}, + cmdclass={"install": InstallCommand, "verify": VerifyVersionCommand}, )