-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
88 lines (67 loc) · 2.26 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
import os
import shutil
import subprocess
import sys
from distutils.cmd import Command
from runpy import run_path
from setuptools import find_packages, setup
# read the program version from version.py (without loading the module)
__version__ = run_path('src/false_labels_effect/version.py')['__version__']
def read(fname):
"""Utility function to read the README file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class DistCommand(Command):
description = "build the distribution packages (in the 'dist' folder)"
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
if os.path.exists('build'):
shutil.rmtree('build')
subprocess.run(["python", "setup.py", "sdist", "bdist_wheel"])
class TestCommand(Command):
description = "run all tests with pytest"
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
sys.path.append('src')
import pytest
return pytest.main(['tests', '--no-cov'])
class TestCovCommand(Command):
description = "run all tests with pytest and write a test coverage report"
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
sys.path.append('src')
params = "tests --doctest-modules --junitxml=junit/test-results.xml " \
"--cov=src --cov-report=xml --cov-report=html"
import pytest
return pytest.main(params.split(' '))
setup(
name="false-labels-effect",
version=__version__,
author="Daniel Czwalinna",
author_email="[email protected]",
description="Measuring the effect of false labels within training data on model performance",
license="proprietary",
url="",
packages=find_packages("src"),
package_dir={"": "src"},
package_data={'false_labels_effect': ['res/*']},
long_description=read('README.md'),
install_requires=[],
tests_require=[
'pytest',
'pytest-cov',
'pre-commit',
],
cmdclass={
'dist': DistCommand,
'test': TestCommand,
'testcov': TestCovCommand,
},
platforms='any',
python_requires='>=3.7',
)