diff --git a/eth-requirements.txt b/eth-requirements.txt index 6e1269b2..125498ee 100644 --- a/eth-requirements.txt +++ b/eth-requirements.txt @@ -1,4 +1,5 @@ -semantic-version -pysha3 +# Install with --no-deps. Otherwise, many unneeded dependencies will be +# installed. + py_ecc==1.6.0 mypy_extensions==0.4.1 diff --git a/pyproject.toml b/pyproject.toml index b1bf2118..490d2731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools>=57", - "wheel>=0.37.0", - "build>=0.7.0", + "wheel>=0.36.0", + "build>=0.5.1", ] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index c3ea4294..d3bd7f74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,17 +21,23 @@ classifiers = [options] python_requires = >=3.7 include_package_data = True + +# pysha3 is used by XMR and ETH for the keccak hash function only. If the +# module is not available, the native Python implementation in mmgen.keccak +# will be used instead. install_requires = + importlib-resources; python_version < "3.9" gmpy2 cryptography pynacl ecdsa requests - aiohttp - pysocks + pysocks # xmrwallet.py pexpect - importlib-resources; python_version < "3.9" scrypt + semantic-version # scripts/create-token.py + aiohttp; platform_system != "Windows" + pysha3; platform_system != "Windows" packages = mmgen diff --git a/setup.py b/setup.py index 9c75eb29..5ad04fd3 100755 --- a/setup.py +++ b/setup.py @@ -14,9 +14,22 @@ def build_libsecp256k1(): if not os.path.exists(ext_path): run(['git','clone','https://github.com/bitcoin-core/secp256k1.git'],check=True,cwd=cache_path) if not os.path.exists(os.path.join(ext_path,'.libs/libsecp256k1.a')): - run(['./autogen.sh'],check=True,cwd=ext_path) - run(['./configure','CFLAGS=-g -O2 -fPIC'],check=True,cwd=ext_path) - run(['make','-j4'],check=True,cwd=ext_path) + import platform + cmds = { + 'Windows': ( + ['sh','./autogen.sh'], + ['sh','./configure','CFLAGS=-g -O2 -fPIC','--disable-dependency-tracking'], + ['mingw32-make','MAKE=mingw32-make','LIBTOOL=/mingw64/bin/libtool'] + ), + 'Linux': ( + ['./autogen.sh'], + ['./configure','CFLAGS=-g -O2 -fPIC'], + ['make','-j4'] + ), + }[platform.system()] + for cmd in cmds: + print('Executing {}'.format(' '.join(cmd))) + run(cmd,check=True,cwd=ext_path) have_msys2 = run(['uname','-s'],stdout=PIPE,check=True).stdout.startswith(b'MSYS_NT') if have_msys2: