1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2013 LEAP
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 setup file for leap.common
21 from setuptools import setup, find_packages
24 parsed_reqs = utils.parse_requirements()
27 versioneer.versionfile_source = 'src/leap/common/_version.py'
28 versioneer.versionfile_build = 'leap/common/_version.py'
29 versioneer.tag_prefix = '' # tags are like 1.2.0
30 versioneer.parentdir_prefix = 'leap.common-'
32 tests_requirements = [
37 "Development Status :: 3 - Alpha",
38 "Intended Audience :: Developers",
39 ("License :: OSI Approved :: GNU General "
40 "Public License v3 or later (GPLv3+)"),
41 "Operating System :: OS Independent",
42 "Programming Language :: Python",
43 "Programming Language :: Python :: 2.6",
44 "Programming Language :: Python :: 2.7",
45 "Topic :: Communications",
50 DOWNLOAD_BASE = ('https://github.com/leapcode/leap_pycommon/'
52 _versions = versioneer.get_versions()
53 VERSION = _versions['version']
54 VERSION_FULL = _versions['full']
57 # get the short version for the download url
58 _version_short = re.findall('\d+\.\d+\.\d+', VERSION)
59 if len(_version_short) > 0:
60 VERSION_SHORT = _version_short[0]
61 DOWNLOAD_URL = DOWNLOAD_BASE % VERSION_SHORT
63 cmdclass = versioneer.get_cmdclass()
64 from setuptools import Command
67 class freeze_debianver(Command):
69 Freezes the version in a debian branch.
70 To be used after merging the development branch onto the debian one.
74 def initialize_options(self):
77 def finalize_options(self):
81 proceed = str(raw_input(
82 "This will overwrite the file _version.py. Continue? [y/N] "))
84 print("He. You scared. Aborting.")
87 # This file was generated by the `freeze_debianver` command in setup.py
88 # Using 'versioneer.py' (0.7+) from
89 # revision-control system data, or from the parent directory name of an
90 # unpacked source archive. Distribution tarballs contain a pre-generated copy
93 version_version = '{version}'
94 version_full = '{version_full}'
98 def get_versions(default={}, verbose=False):
99 return {'version': version_version, 'full': version_full}
101 subst_template = template.format(
102 version=VERSION_SHORT,
103 version_full=VERSION_FULL) + templatefun
104 with open(versioneer.versionfile_source, 'w') as f:
105 f.write(subst_template)
108 long_description = open('README.rst').read() + '\n\n\n' + \
109 open('CHANGELOG').read()
111 long_description = ""
113 cmdclass["freeze_debianver"] = freeze_debianver
118 url='https://leap.se/',
119 download_url=DOWNLOAD_URL,
121 author='The LEAP Encryption Access Project',
122 author_email='info@leap.se',
123 maintainer='Kali Kaneko',
124 maintainer_email='kali@leap.se',
125 description='Common files used by the LEAP project.',
126 long_description=long_description,
127 classifiers=trove_classifiers,
128 namespace_packages=["leap"],
129 package_dir={'': 'src'},
130 package_data={'': ['*.pem']},
131 # For now, we do not exclude tests because of the circular dependency
132 # between leap.common and leap.soledad.
133 #packages=find_packages('src', exclude=['leap.common.tests']),
134 packages=find_packages('src'),
135 test_suite='leap.common.tests',
136 install_requires=parsed_reqs,
137 #dependency_links=dependency_links,
138 tests_require=tests_requirements,
139 include_package_data=True,
143 # needed for leap.common.http
144 # service_identity needed for propper hostname identification,
145 # see http://twistedmatrix.com/documents/current/core/howto/ssl.html
146 'Twisted': ["Twisted>=14.0.2", "service_identity", "zope.insterface"]