-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
78 lines (65 loc) · 2.7 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
import os
from setuptools import setup, find_packages
def strip_comments(l):
return l.split('#', 1)[0].strip()
def _pip_requirement(req):
if req.startswith('-r '):
_, path = req.split()
return reqs(*path.split('/'))
return [req]
def _reqs(*f):
return [
_pip_requirement(r) for r in (
strip_comments(l) for l in open(
os.path.join(os.getcwd(), 'requirements', *f)).readlines()
) if r]
def reqs(*f):
return [req for subreq in _reqs(*f) for req in subreq]
def get_requirements(*requirements_file):
"""Get the contents of a file listing the requirements"""
lines = open(os.path.join(os.getcwd(), 'requirements', *requirements_file)).readlines()
dependencies = []
for line in lines:
maybe_dep = line.strip()
if maybe_dep.startswith('#'):
# Skip pure comment lines
continue
if maybe_dep.startswith('git+'):
# VCS reference for dev purposes, expect a trailing comment
# with the normal requirement
__, __, maybe_dep = maybe_dep.rpartition('#')
else:
# Ignore any trailing comment
maybe_dep, __, __ = maybe_dep.partition('#')
# Remove any whitespace and assume non-empty results are dependencies
maybe_dep = maybe_dep.strip()
if maybe_dep:
dependencies.append(maybe_dep)
return dependencies
setup(name='gcloud-connectors',
version='0.2.4b1',
url='https://github.com/pualien/py-gcloud-connector',
# download_url='https://github.com/pualien/py-gcloud-connectors/archive/0.1.23.tar.gz',
license='MIT',
author='Matteo Senardi',
author_email='[email protected]',
description='Python utilities to simplify connection with Google APIs',
packages=find_packages(exclude=['tests']),
install_requires=get_requirements('default.txt') + get_requirements('constraint.txt'),
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
python_requires='~=3.6',
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
],
zip_safe=False)