-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
139 lines (111 loc) · 3.71 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
131
132
133
134
135
136
137
138
139
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Module to setup HaTeMiLe for Django.
"""
import os
from setuptools import find_packages
from setuptools import setup
BASE_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
def get_long_description():
"""
Returns the long description of HaTeMiLe for Django.
:return: The long description of HaTeMiLe for Django.
:rtype: str
"""
with open(
os.path.join(BASE_DIRECTORY, 'README.md'),
'r',
encoding='utf-8'
) as readme_file:
return readme_file.read()
def get_packages():
"""
Returns the packages used for HaTeMiLe for Django.
:return: The packages used for HaTeMiLe for Django.
:rtype: list(str)
"""
packages = find_packages(exclude=['tests'])
packages.append('hatemile_for_django.static.hatemile_for_django.css')
packages.append('hatemile_for_django.static.hatemile_for_django.js')
return packages
def get_package_data():
"""
Returns the packages with static files of HaTeMiLe for Django.
:return: The packages with static files of HaTeMiLe for Django.
:rtype: dict(str, list(str))
"""
package_data = {
'hatemile_for_django.static.hatemile_for_django.css': ['*.css'],
'hatemile_for_django.static.hatemile_for_django.js': ['*.js']
}
return package_data
def get_requirements():
"""
Returns the content of 'requirements.txt' in a list.
:return: The content of 'requirements.txt'.
:rtype: list(str)
"""
requirements = []
with open(
os.path.join(BASE_DIRECTORY, 'requirements.txt'),
'r',
encoding='utf-8'
) as requirements_file:
lines = requirements_file.readlines()
for line in lines:
requirements.append(line.strip())
return requirements
def get_requirements_dev():
"""
Returns the content of 'requirements-dev.txt' in a list.
:return: The content of 'requirements-dev.txt'.
:rtype: list(str)
"""
requirements = []
with open(
os.path.join(BASE_DIRECTORY, 'requirements-dev.txt'),
'r',
encoding='utf-8'
) as requirements_file:
lines = requirements_file.readlines()
for line in lines:
requirements.append(line.strip())
return requirements
setup(
name='hatemile-for-django',
description=(
'HaTeMiLe for Django improve accessibility of web pages that uses the '
+ 'Django framework, converting pages with HTML code into pages with '
+ 'a more accessible code.'
),
long_description=get_long_description(),
long_description_content_type='text/markdown',
version='1.0.0',
url='https://github.com/hatemile/hatemile-for-django',
author='Carlson Santana Cruz',
license='Apache2',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Natural Language :: English'
],
packages=get_packages(),
package_data=get_package_data(),
install_requires=get_requirements(),
extras_require={
'dev': get_requirements_dev()
}
)