-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
116 lines (102 loc) · 3.93 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
import os
import subprocess
import sys
from setuptools import Command, find_packages, setup
__version__ = '1.0.0'
class PylintCommand(Command):
"""
Custom command to run pylint and get a report as html.
"""
description = "Runs pylint and outputs the report as html."
user_options = []
def initialize_options(self):
from pylint.reporters.json_reporter import JSONReporter
from pylint.reporters.text import ParseableTextReporter, TextReporter
from pylint_json2html import JsonExtendedReporter
self.lint_modules = ["memilio/"]
self.out_format = "extendedjson"
self.REPORTERS = {
"parseable": (ParseableTextReporter, "build_pylint/pylint_parseable.txt"),
"text": (TextReporter, "build_pylint/pylint.txt"),
"json": (JSONReporter, "build_pylint/pylint.json"),
"extendedjson": (JsonExtendedReporter, "build_pylint/pylint_extended.json")
}
def finalize_options(self):
self.reporter, self.out_file = self.REPORTERS.get(
self.out_format) # , self.REPORTERS.get("parseable"))
def run(self):
os.makedirs("build_pylint", exist_ok=True)
# Run pylint
from pylint import lint
with open(self.out_file, "w", encoding="utf-8") as report_file:
options = ["--rcfile=../pylintrc", *self.lint_modules]
lint.Run(options, reporter=self.reporter(
report_file), do_exit=False)
# Python-magic needs DLLs for libmagic. They have to be installed only on windows.
if sys.platform == 'win32':
pymagic = 'python-magic-bin'
else:
pymagic = 'python-magic'
setup(
name='memilio-epidata',
version=__version__,
author='DLR-SC',
author_email='[email protected]',
maintainer_email='[email protected]',
url='https://github.com/SciCompMod/memilio',
description='Part of MEmilio project, reads epidemiological data from different official and unofficial sources.',
entry_points={
'console_scripts': [
'getcasedata=memilio.epidata.getCaseData:main',
'getpopuldata=memilio.epidata.getPopulationData:main',
'getjhdata = memilio.epidata.getJHData:main',
'getdividata = memilio.epidata.getDIVIData:main',
'getsimdata = memilio.epidata.getSimulationData:main',
'cleandata = memilio.epidata.cleanData:main',
'getcommutermobility = memilio.epidata.getCommuterMobility:main',
'getvaccinationdata = memilio.epidata.getVaccinationData:main',
'gethospitalizationdata = memilio.epidata.getHospitalizationData:main'
],
},
packages=find_packages(where=os.path.dirname(os.path.abspath(__file__))),
long_description='',
test_suite='memilio.epidata_test',
install_requires=[
# pandas 2.0 is minimum for CoW
'pandas>=2.0.0',
# FutureWarning of pandas that pyarrow will be required in a future release
'pyarrow',
'matplotlib',
'tables',
# smaller numpy versions cause a security issue, 1.25 breaks testing with pyfakefs
'numpy>=1.22,<1.25',
'openpyxl',
'xlrd',
'xlsxwriter',
'requests',
'pyxlsb',
'wget',
'twill==3.1',
# set PyQt6-sip version as the one pulled by PyQt6 in Epidata-CI (using manylinux_2_28_x86_64) req. python 3.9
'PyQt6-sip<13.9',
'PyQt6',
'python-calamine',
pymagic
],
extras_require={
'dev': [
# first support of python 3.11 4.6
# 5.3.4 has conflicts with openpyxl
# 5.3.3 broken
'pyfakefs>=4.6,<5.3.3',
# coverage 7.0.0 can't find .whl files and breaks CI
'coverage>=7.0.1',
# pylint 2.16 creates problem with wrapt package version
'pylint>=2.13.0,<2.16',
'pylint_json2html==0.4.0',
],
},
cmdclass={
'pylint': PylintCommand
},
)