From ed20b91fe576f29909250154214690d86384aed0 Mon Sep 17 00:00:00 2001 From: Zen <46526140+master-of-zen@users.noreply.github.com> Date: Thu, 13 May 2021 08:56:14 +0300 Subject: [PATCH] requirements fix --- requirements.txt | 1 + setup.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index a7760d6..8cdeb26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ tqdm psutil scipy matplotlib +setuptools_rust diff --git a/setup.py b/setup.py index 2f0f412..dc1df19 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,19 @@ #!/usr/bin/env python3 import setuptools -from setuptools_rust import Binding, RustExtension +import sys + +try: + from setuptools_rust import Binding, RustExtension +except ImportError: + import subprocess + + errno = subprocess.call([sys.executable, "-m", "pip", "install", "setuptools-rust"]) + if errno: + print("Please install setuptools-rust package") + raise SystemExit(errno) + else: + from setuptools_rust import Binding, RustExtension -# TODO: rewrite it in rust REQUIRES = [ "numpy",