-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·84 lines (73 loc) · 2.57 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
79
80
81
82
83
84
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from io import open
try:
from setuptools import setup, find_packages, Command
except ImportError:
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup
from galileo import __version__
class CheckVersion(Command):
""" Check that the version in the docs is the correct one """
description = "Check the version consistency"
user_options = []
def initialize_options(self):
"""init options"""
def finalize_options(self):
"""finalize options"""
def run(self):
readme_re = re.compile(r'^:version:\s+' + __version__ + r'\s*$',
re.MULTILINE | re.IGNORECASE)
man_re = re.compile(r'^\.TH.+[\s"]+' + __version__ + r'[\s"]+',
re.MULTILINE | re.IGNORECASE)
for filename, regex in (
('README.txt', readme_re),
('doc/galileo.1', man_re),
('doc/galileorc.5', man_re)):
with open(filename) as f:
content = f.read()
if regex.search(content) is None:
raise ValueError('file %s mention the wrong version' % filename)
with open('README.txt', encoding='utf8') as file:
long_description = file.read()
setup(
name="galileo",
version=__version__,
description="Utility to securely synchronize a Fitbit tracker with the"
" Fitbit server",
long_description=long_description,
author="Benoît Allard",
author_email="[email protected]",
url="https://github.com/benallard/galileo",
platforms=['any'],
keywords=['fitbit', 'synchronize', 'health', 'tracker'],
license="LGPL",
install_requires=[
"requests",
"pyusb>=1a"], # version 1a doesn't exists, but is smaller than 1.0.0a2
test_suite="tests",
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU Lesser General Public License v3 or'
' later (LGPLv3+)',
'Environment :: Console',
'Topic :: Utilities',
'Topic :: Internet',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
packages=find_packages(exclude=["tests"]),
entry_points={
'console_scripts': [
'galileo = galileo.main:main'
],
},
cmdclass={
'checkversion': CheckVersion,
},
)