-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
73 lines (63 loc) · 2.24 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import platform
import sys
from os import chdir, getcwd, makedirs, rmdir
from shutil import rmtree
from subprocess import check_call
from tempfile import TemporaryDirectory
import setuptools
from setuptools.command.develop import develop
from setuptools.command.install import install
with open('requirements.txt') as f:
required = f.read().splitlines()
def do_post_install_tasks():
check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
if platform.system() == "Darwin" and platform.processor() == "arm":
check_call([sys.executable, "-m", "pip", "install", "tensorflow-macos"])
check_call([sys.executable, "-m", "pip", "install", "tensorflow-metal"])
try:
import transformers
except:
check_call(["brew", "install", "rust"])
check_call([sys.executable, "-m", "pip", "install", "transformers"])
else:
check_call([sys.executable, "-m", "pip", "install", "tensorflow", "torch", "transformers"])
# download nltk stuff
import nltk
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('omw-1.4')
class PostDevelopmentCommand(develop):
"""Post-instalation for development? mode."""
def run(self):
develop.run(self)
do_post_install_tasks()
class PostInstallCommand(install):
"""Post-instalation for install mode."""
def run(self):
install.run(self)
do_post_install_tasks()
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='rbpy-rb',
version='0.12.3',
python_requires='>=3.6',
author='Woodcarver',
author_email='[email protected]',
description='ReaderBench library written in python',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/readerbench/ReaderBench',
packages=setuptools.find_packages(),
include_package_data=True,
install_requires=required,
cmdclass={
'develop': PostDevelopmentCommand,
'install': PostInstallCommand,
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent"
],
)