-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·68 lines (55 loc) · 1.46 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
#!/usr/bin/env python
import os.path
import shutil
import urllib.request
import setuptools
PROJECT_DIR_NAME = 'yandex_disk_rsync'
def __project_directory():
"""
:rtype: str
"""
return os.path.join(os.path.dirname(__file__), PROJECT_DIR_NAME)
def __pre_install():
ydcmd_host = 'raw.githubusercontent.com'
slug = 'abbat/ydcmd'
file = 'ydcmd.py'
ydcmd_commit_hash = '96e5700e3d8adf143d51fa6e7e40f88da890078e'
ydcmd_url = 'https://%s/%s/%s/%s' % (
ydcmd_host,
slug,
ydcmd_commit_hash,
file,
)
with open(
os.path.join(__project_directory(), 'ydcmd.py'),
'wb',
) as py_file, \
urllib.request.urlopen(ydcmd_url) as response:
fp = response.fp
shutil.copyfileobj(fp, py_file)
def __get_requirements():
"""
:rtype:
"""
with open(
os.path.join(os.path.dirname(__file__), 'requirements.txt'),
'rt',
encoding='UTF-8',
newline='\n'
) as file:
return [
s.strip()
for s in file.read().split('\n')
if s.strip()
]
__pre_install()
setuptools.setup(
name='YandexDisk RSync',
version='0.2',
description='YDCMD wrapper with some misc improvements',
author='Anatolii Titov',
author_email='a@toliak.ru',
url='https://github.com/Toliak/YandexDiskRSync',
packages=[PROJECT_DIR_NAME],
install_requires=__get_requirements(),
)