-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
69 lines (63 loc) · 2.22 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
from setuptools import setup, find_packages
from os import remove
from pathlib import Path
from json import dump
from ravenml.utils.git import is_repo, git_sha, git_patch_tracked, git_patch_untracked
pkg_name = 'ravenml'
rml_dir = Path(__file__).resolve().parent
with open(rml_dir / 'README.md', encoding='utf-8') as f:
long_description = f.read()
# attempt to write git data to file
# NOTE: does NOT work in the GitHub tarball installation case
# this will work in 3/4 install cases:
# 1. PyPI
# 2. GitHub clone
# 3. Local (editable), however NOTE in this case there is no need
# for the file, as ravenml will find git information at runtime
# in order to include patch data
repo_root = is_repo(rml_dir)
if repo_root:
info = {
'ravenml_git_sha': git_sha(repo_root),
'ravenml_tracked_git_patch': git_patch_tracked(repo_root),
'ravenml_untracked_git_patch': git_patch_untracked(repo_root)
}
with open(rml_dir / pkg_name / 'git_info.json', 'w') as f:
dump(info, f, indent=2)
setup(
name=pkg_name,
version='1.2',
description='ML Training CLI Tool',
long_description = long_description,
long_description_content_type = 'text/markdown',
license='MIT',
author='Carson Schubert, Abhi Dhir, Pratyush Singh',
author_email='[email protected]',
keywords= ['machine learning', 'data science'],
download_url = 'https://github.com/autognc/ravenML/archive/v1.2.tar.gz',
packages=find_packages(),
package_data={pkg_name: ['git_info.json']},
install_requires=[
'Click>=7.0',
'questionary>=1.0.2',
'boto3>=1.9.86',
'shortuuid>=0.5.0',
'halo>=0.0.26',
'colorama>=0.3.9',
'pyaml>=19.4.1',
],
tests_require=[
'pytest',
'moto'
],
entry_points={
'console_scripts': [f'{pkg_name}={pkg_name}.cli:cli'],
}
)
# destroy git file after install
# NOTE: this is pointless for GitHub clone case, since the clone is deleted
# after install. It is necessary for local (editable) installs to prevent
# the file from corrupting the git repo, and when creating a dist for PyPI
# for the same reason.
if repo_root:
remove(rml_dir / pkg_name / 'git_info.json')