-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
130 lines (100 loc) · 3.74 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
try:
from setuptools import setup
from setuptools import find_packages
except ImportError:
from distutils.core import setup
from distutils.core import find_packages
def get_requires (requirements_filename):
'''
What packages are required for this module to be executed?
Parameters
----------
requirements_filename : str
filename of requirements (e.g requirements.txt)
Returns
-------
requirements : list
list of required packages
'''
with open(requirements_filename, 'r') as fp:
requirements = fp.read()
return list(filter(lambda x: x != '', requirements.split()))
def read_description (readme_filename):
'''
Description package from filename
Parameters
----------
readme_filename : str
filename with readme information (e.g README.md)
Returns
-------
description : str
str with description
'''
try:
with open(readme_filename, 'r') as fp:
description = '\n'
description += fp.read()
return description
except IOError:
return ''
here = os.path.abspath(os.path.dirname(__file__))
# Package meta-data.
NAME = 'NumPyNet'
DESCRIPTION = 'Neural Networks Library in pure Numpy'
URL = 'https://github.com/Nico-Curti/NumPyNet'
EMAIL = ['mattia.ceccarelli3@studio.unibo.it', 'nico.curti2@unibo.it']
AUTHOR = ['Mattia Ceccarelli', 'Nico Curti']
REQUIRES_PYTHON = '>=2.7'
VERSION = None
KEYWORDS = 'neural-networks deep-neural-networks deep-learning image-classification super-resolution'
README_FILENAME = os.path.join(here, 'README.md')
REQUIREMENTS_FILENAME = os.path.join(here, 'requirements.txt')
VERSION_FILENAME = os.path.join(here, 'NumPyNet', '__version__.py')
# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
LONG_DESCRIPTION = read_description(README_FILENAME)
except IOError:
LONG_DESCRIPTION = DESCRIPTION
# Load the package's __version__.py module as a dictionary.
about = {}
if not VERSION:
with open(VERSION_FILENAME) as fp:
exec(fp.read(), about)
else:
about['__version__'] = VERSION
# parse version variables and add them to command line as definitions
Version = about['__version__'].split('.')
setup(
name = NAME,
version = about['__version__'],
description = DESCRIPTION,
long_description = LONG_DESCRIPTION,
long_description_content_type = 'text/markdown',
author = AUTHOR,
author_email = EMAIL,
maintainer = AUTHOR,
maintainer_email = EMAIL,
python_requires = REQUIRES_PYTHON,
install_requires = get_requires(REQUIREMENTS_FILENAME),
url = URL,
download_url = URL,
keywords = KEYWORDS,
packages = find_packages(include=['NumPyNet', 'NumPyNet.*'], exclude=('test', 'testing')),
include_package_data = True, # no absolute paths are allowed
platforms = 'any',
classifiers =[
#'License :: OSI Approved :: GPL License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
license = 'MIT'
)