-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (40 loc) · 2.23 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
import os
import setuptools
from typing import AnyStr
GITHUB_PERSONAL_ACCESS_TOKEN = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN')
def private_dependency(personal_access_token: AnyStr,
repo_user: AnyStr, repo_name: AnyStr,
package_name: AnyStr, package_version: AnyStr):
"""Defines a dependency from a private Github repository
:param personal_access_token: Github Personal Access Token
:param repo_user: Dependency repository user
:param repo_name: Dependency repository name
:param package_name: Dependency package name
:param package_version: Dependency repository release (tag)
:return: The dependency specification for the install_requires field
"""
return f'{package_name} @ ' \
f'git+https://{personal_access_token}@github.com/' \
f'{repo_user}/{repo_name}.git/@{package_version}#egg={package_name}-0'
with open('version', 'r') as version:
setuptools.setup(
name='dispatch_stream',
version=version.readline(),
author='Alessio Vierti',
packages=setuptools.find_packages(exclude=['tests']),
install_requires=[
private_dependency(personal_access_token=GITHUB_PERSONAL_ACCESS_TOKEN,
repo_user='reloc8', repo_name='lib-lambda-handler',
package_name='lambda_handler', package_version='1.0.0'),
private_dependency(personal_access_token=GITHUB_PERSONAL_ACCESS_TOKEN,
repo_user='reloc8', repo_name='lib-sqs-utils',
package_name='sqs_utils', package_version='1.0.0'),
private_dependency(personal_access_token=GITHUB_PERSONAL_ACCESS_TOKEN,
repo_user='reloc8', repo_name='lib-sns-utils',
package_name='sns_utils', package_version='1.0.0'),
private_dependency(personal_access_token=GITHUB_PERSONAL_ACCESS_TOKEN,
repo_user='reloc8', repo_name='lib-dynamodb-utils',
package_name='dynamodb_utils', package_version='1.0.0')
],
python_requires='>=3.6'
)