From bb443ba27f1150e30a345b739cd1b7481c1c5ebd Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Wed, 27 Oct 2021 18:18:50 +0800 Subject: [PATCH] only depends on cpuid on x86 --- pyproject.toml | 2 +- setup.py | 5 ++++- tests/requirements.txt | 2 +- tox.ini | 9 +++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d401e58..e956307 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools>=42", "wheel", "pybind11>=2.8", "cpuid"] +requires = ["setuptools>=42", "wheel", "pybind11>=2.8"] diff --git a/setup.py b/setup.py index 7810d42..f707b85 100644 --- a/setup.py +++ b/setup.py @@ -267,6 +267,9 @@ def cpu_features(): 'Topic :: Utilities' ], keywords='hash hashing fasthash', - setup_requires=['cpuid', 'pybind11'], + setup_requires=list(filter(None, [ + 'cpuid' if IS_X86 else None, + 'pybind11', + ])), tests_require=['pytest', 'pytest-runner', 'pytest-benchmark'], ) diff --git a/tests/requirements.txt b/tests/requirements.txt index 4360410..3f8bd75 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,4 +2,4 @@ pytest >= 4.6 pytest-benchmark >= 3.4 pytest-cov >= 2.12 codecov >= 2.1 -cpuid +cpuid ; platform_machine == "x86_64" diff --git a/tox.ini b/tox.ini index 73a8bb2..1a2f1d9 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,12 @@ envlist = py{27,39},pypy{,3} [testenv] +commands = pytest --benchmark-disable --cov=./ -v + +[testenv:{py27,pypy}] +deps = pytest-runner + pytest-benchmark + +[testenv:{py39,pypy3}] deps = -r{toxinidir}/requirements.txt -r{toxinidir}/tests/requirements.txt - -commands = pytest --benchmark-disable --cov=./ -v