-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·105 lines (92 loc) · 2.59 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
#import setuptools
import subprocess
from setuptools import setup
from setuptools import find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.egg_info import egg_info
with open("Readme.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
# helper functions to make it easier to list dependencies not as a python list, but vertically w/ optional built-in comments to why a certain version of the dependency is listed
def cleanup(x):
return re.sub(r" *#.*", "", x.strip()) # comments
def to_list(buffer):
return list(filter(None, map(cleanup, buffer.splitlines())))
# normal dependencies ###
#
# these get resolved and installed via either of these two:
#
# pip install alternat
# pip install -e .
#
# IMPORTANT: when updating these, please make sure to sync conda/meta.yaml
dep_groups = {
"core": to_list(
"""
pillow
torch==1.4.0
torchvision==0.5.0
google-cloud-vision==1.0.0
tldextract
easyocr
pyyaml
treelib
uvicorn
fastapi==0.62.0
typer==0.3.2
idna<3,>=2.5
gdown
"""
)
}
__version__ = None # Explicitly set version.
# TODO use os.path instead of front slash
exec(open('alternat/version.py').read()) # loads __version__
requirements = [y for x in dep_groups.values() for y in x]
setup_requirements = to_list(
"""
pytest-runner
setuptools>=36.2
"""
)
# test dependencies ###
test_requirements = to_list(
"""
pytest
"""
)
#mkdir my-project
#cd my-project
#npm install bitcoinjs-lib
setup(
name="alternat",
version=__version__,
author="keplerlab",
author_email="keplerwaasi@gmail.com",
description="Alternat is a tool that automates alt text generation.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/keplerlab/alternat.git",
packages=find_packages(),
install_requires=requirements,
setup_requires=setup_requirements,
tests_require=test_requirements,
python_requires=">=3.6",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
project_urls={
"Documentation": "https://alternat.readthedocs.io",
"Source": "https://github.com/keplerlab/alternat",
"Tracker": "https://github.com/keplerlab/alternat/issues",
},
include_package_data=True,
zip_safe=False,
)