forked from pystiche/pystiche
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
85 lines (73 loc) · 2.17 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
from importlib.util import module_from_spec, spec_from_file_location
from os import path
from setuptools import find_packages, setup
PROJECT_ROOT = path.abspath(path.dirname(__file__))
PACKAGE_NAME = "pystiche"
PACKAGE_ROOT = path.join(PROJECT_ROOT, PACKAGE_NAME)
def load_git_module():
spec = spec_from_file_location(PACKAGE_NAME, path.join(PACKAGE_ROOT, "_git.py"),)
git = module_from_spec(spec)
spec.loader.exec_module(git)
return git
git = load_git_module()
about = {"git": git, "_PROJECT_ROOT": PROJECT_ROOT}
with open(path.join(PACKAGE_ROOT, "__about__.py"), "r") as fh:
exec(fh.read(), about)
with open(path.join(PROJECT_ROOT, "README.rst"), "r") as fh:
long_description = fh.read()
install_requires = (
"torch>=1.4.0",
"torchvision>=0.5.0",
"pillow",
"numpy",
"requests",
"typing_extensions",
)
test_requires = ("pytest", "pyimagetest", "pillow_affine", "dill", "pytest-subtests")
doc_requires = (
"sphinx < 3.0.0",
"sphinxcontrib-bibtex",
"sphinx_autodoc_typehints",
"sphinx-gallery>=0.7.0",
# Install additional sphinx-gallery dependencies
# https://sphinx-gallery.github.io/stable/index.html#install-via-pip
"matplotlib",
"sphinx_rtd_theme",
)
dev_requires = (
*test_requires,
*doc_requires,
"isort",
"black",
"flake8",
"mypy",
"pre-commit",
"pyyaml",
)
extras_require = {
"test": test_requires,
"doc": doc_requires,
"dev": dev_requires,
}
classifiers = (
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
)
setup(
name=about["__name__"],
description=about["__description__"],
version=about["__version__"],
url=about["__url__"],
license=about["__license__"],
author=about["__author__"],
author_email=about["__author_email__"],
long_description=long_description,
long_description_content_type="text/x-rst",
packages=find_packages(where=PROJECT_ROOT, exclude=("docs", "examples", "tests")),
install_requires=install_requires,
extras_require=extras_require,
python_requires=">=3.6",
classifiers=classifiers,
)