forked from anthbapt/triaction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
93 lines (81 loc) · 2.85 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: UTF-8 -*-
__author__ = "Anthony Baptista"
__copyright__ = "Copyright 2023, Anthony Baptista"
__email__ = "[email protected]"
__license__ = "MIT"
import codecs
import configparser
from setuptools import setup
from setuptools import find_packages
import os
import sys
config = configparser.RawConfigParser()
config.read(os.path.join('.', 'setup.cfg'))
author = config['metadata']['author']
email = config['metadata']['email']
license = config['metadata']['license']
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
if sys.version_info < (3, 6):
print("At least Python 3.6 is required.\n", file=sys.stderr)
exit(1)
try:
from setuptools import setup, find_packages
except ImportError:
print("Please install setuptools before installing triaction.",
file=sys.stderr)
exit(1)
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as fin:
long_description = fin.read()
CLASSIFIERS = """\
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Scientific/Engineering :: Mathematics
Topic :: Scientific/Engineering :: Physics
Topic :: Scientific/Engineering :: Network theory
"""
# Create list of package data files
def data_files_to_list(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
data_example_file_list = data_files_to_list('triaction/data')
setup(
name='triaction',
version=get_version("triaction/__init__.py"),
description="",
author=author,
author_email=email,
license=license,
long_description=long_description,
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
packages=find_packages(),
package_dir={'triaction': 'triaction'},
package_data={'triaction': data_example_file_list},
install_requires=['networkx', 'numpy', 'pandas', 'matplotlib', 'seaborn', 'scipy', 'scikit-learn', 'pyitlib'],
entry_points={},
)