-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
37 lines (27 loc) · 1.25 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
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='object_compressor',
version=version.readline(),
author='Alessio Vierti',
packages=setuptools.find_packages(exclude=['tests']),
install_requires=[],
python_requires='>=3.6'
)