started setting up install option for pip, but will likely remove as it may not be possible to generalize that easily...
Browse files- requirements.txt +0 -0
- setup.py +27 -2
requirements.txt
CHANGED
|
Binary files a/requirements.txt and b/requirements.txt differ
|
|
|
setup.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
import
|
|
|
|
|
|
|
| 2 |
|
| 3 |
with open("README.md", "r") as f:
|
| 4 |
long_description = f.read()
|
|
@@ -6,7 +8,29 @@ with open("README.md", "r") as f:
|
|
| 6 |
with open('requirements.txt', 'r', encoding='utf-16') as ff:
|
| 7 |
required = ff.read().splitlines()
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
name='livermask',
|
| 11 |
version='1.2.0',
|
| 12 |
author="André Pedersen",
|
|
@@ -32,4 +56,5 @@ setuptools.setup(
|
|
| 32 |
"Operating System :: OS Independent",
|
| 33 |
],
|
| 34 |
python_requires='>=3.6',
|
|
|
|
| 35 |
)
|
|
|
|
| 1 |
+
from setuptools import setup
|
| 2 |
+
from setuptools.command.install import install
|
| 3 |
+
|
| 4 |
|
| 5 |
with open("README.md", "r") as f:
|
| 6 |
long_description = f.read()
|
|
|
|
| 8 |
with open('requirements.txt', 'r', encoding='utf-16') as ff:
|
| 9 |
required = ff.read().splitlines()
|
| 10 |
|
| 11 |
+
# install additional dependencies (CuPy)
|
| 12 |
+
#required.append(cupy-cuda110==9.6.0)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class InstallCommand(install):
|
| 16 |
+
user_option = install.user_options 0 [
|
| 17 |
+
('gpu=', None, 'enable flag to install package with GPU support'),
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
def initialize_options(self):
|
| 21 |
+
install.initialize_options(self)
|
| 22 |
+
self.gpu = False
|
| 23 |
+
|
| 24 |
+
def finalize_options(self):
|
| 25 |
+
print("value of gpu is ", self.gpu)
|
| 26 |
+
install.finalize_options(self)
|
| 27 |
+
|
| 28 |
+
def run(self):
|
| 29 |
+
if (self.)
|
| 30 |
+
install.run(self)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
setup(
|
| 34 |
name='livermask',
|
| 35 |
version='1.2.0',
|
| 36 |
author="André Pedersen",
|
|
|
|
| 56 |
"Operating System :: OS Independent",
|
| 57 |
],
|
| 58 |
python_requires='>=3.6',
|
| 59 |
+
cmdclass={'install': InstallCommand},
|
| 60 |
)
|