-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import ast | ||
import codecs | ||
import os | ||
import re | ||
import sys | ||
from setuptools import setup, find_packages | ||
|
||
|
||
_version_re = re.compile(r'__version__\s+=\s+(.*)') | ||
_source_dir = os.path.split(os.path.abspath(__file__))[0] | ||
|
||
if sys.version_info[0] == 2: | ||
def read_file(path): | ||
with open(path, 'rb') as f: | ||
return f.read() | ||
else: | ||
def read_file(path): | ||
with codecs.open(path, 'rb', 'utf-8') as f: | ||
return f.read() | ||
|
||
version = str(ast.literal_eval(_version_re.search( | ||
read_file(os.path.join(_source_dir, 'tensorkit/__init__.py'))).group(1))) | ||
|
||
requirements_list = list(filter( | ||
lambda v: v and not v.startswith('#'), | ||
(s.strip() for s in read_file( | ||
os.path.join(_source_dir, 'requirements.txt')).split('\n')) | ||
)) | ||
dependency_links = [s for s in requirements_list if s.startswith('git+')] | ||
install_requires = [s for s in requirements_list if not s.startswith('git+')] | ||
|
||
|
||
setup( | ||
name='tensorkit', | ||
version=version, | ||
url='https://github.com/haowen-xu/tensorkit/', | ||
license='MIT', | ||
author='Haowen Xu', | ||
author_email='haowen.xu@outlook.com', | ||
description='A set of utilities for writing neural network models.', | ||
long_description=__doc__, | ||
packages=find_packages('.', include=['tensorkit', 'tensorkit.*']), | ||
zip_safe=False, | ||
platforms='any', | ||
setup_requires=['setuptools'], | ||
install_requires=install_requires, | ||
dependency_links=dependency_links, | ||
classifiers=[ | ||
'Development Status :: 2 - Alpha', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Topic :: Scientific/Engineering :: Artificial Intelligence', | ||
'Topic :: Software Development :: Libraries :: Python Modules' | ||
] | ||
) |