This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
executable file
·53 lines (44 loc) · 1.52 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
#!/usr/bin/env python3
from os import getenv
from setuptools import setup
dependencies = []
try:
import enum
except ImportError:
dependencies.append('enum34')
teamcity_build = getenv('TEAMCITY_PROJECT_NAME', False)
version = '0.2.1' # Base version
dev = False # Final or not
version_ui = version # Compact version name without build metadata for TeamCity UI
if dev:
if teamcity_build:
version += '-dev.{}+{}'.format(getenv('BUILD_NUMBER'), getenv('BUILD_VCS_NUMBER'))
version_ui += '-dev.{}'.format(getenv('BUILD_NUMBER'))
print(version, file=open('.version', mode='w'))
else:
try:
with open('.version') as f:
version = f.readline().rstrip()
except IOError:
version += '-alpha' # Unknown revision, so assuming this is the earliest
if teamcity_build:
print("##teamcity[buildNumber '" + version_ui + "']")
setup(
name='protobuf3',
version=version,
author='Pr0Ger',
author_email='[email protected]',
url='https://github.com/Pr0Ger/protobuf3',
license='MIT',
description='Protocol buffers library for Python 3',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
packages=['protobuf3', 'protobuf3.compiler', 'protobuf3.fields'],
scripts=['bin/protoc-gen-python3'],
install_requires=dependencies,
)