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.keymanager
21 from setuptools import setup
22 from setuptools import find_packages
23 from setuptools import Command
30 'Development Status :: 4 - Beta',
31 'Intended Audience :: Developers',
32 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
33 'Operating System :: OS Independent',
34 'Programming Language :: Python',
35 'Programming Language :: Python :: 2.6',
36 'Programming Language :: Python :: 2.7',
37 'Topic :: Communications :: Email',
39 'Topic :: Security :: Cryptography',
40 'Topic :: Software Development :: Libraries',
43 DOWNLOAD_BASE = ('https://github.com/leapcode/bitmask_client/'
45 _versions = versioneer.get_versions()
46 VERSION = _versions['version']
47 VERSION_REVISION = _versions['full-revisionid']
50 # get the short version for the download url
51 _version_short = re.findall('\d+\.\d+\.\d+', VERSION)
52 if len(_version_short) > 0:
53 VERSION_SHORT = _version_short[0]
54 DOWNLOAD_URL = DOWNLOAD_BASE % VERSION_SHORT
57 class freeze_debianver(Command):
60 Freezes the version in a debian branch.
61 To be used after merging the development branch onto the debian one.
65 # This file was generated by the `freeze_debianver` command in setup.py
66 # Using 'versioneer.py' (0.16) from
67 # revision-control system data, or from the parent directory name of an
68 # unpacked source archive. Distribution tarballs contain a pre-generated copy
71 version_version = '{version}'
72 full_revisionid = '{full_revisionid}'
76 def get_versions(default={}, verbose=False):
77 return {'version': version_version,
78 'full-revisionid': full_revisionid}
81 def initialize_options(self):
84 def finalize_options(self):
88 proceed = str(raw_input(
89 "This will overwrite the file _version.py. Continue? [y/N] "))
91 print("He. You scared. Aborting.")
93 subst_template = self.template.format(
94 version=VERSION_SHORT,
95 full_revisionid=VERSION_REVISION) + self.templatefun
96 versioneer_cfg = versioneer.get_config_from_root('.')
97 with open(versioneer_cfg.versionfile_source, 'w') as f:
98 f.write(subst_template)
101 cmdclass = versioneer.get_cmdclass()
102 cmdclass["freeze_debianver"] = freeze_debianver
104 # XXX add ref to docs
106 requirements = utils.parse_requirements()
108 if utils.is_develop_mode():
110 print ("[WARNING] Skipping leap-specific dependencies "
111 "because development mode is detected.")
112 print ("[WARNING] You can install "
113 "the latest published versions with "
114 "'pip install -r pkg/requirements-leap.pip'")
115 print ("[WARNING] Or you can instead do 'python setup.py develop' "
116 "from the parent folder of each one of them.")
119 requirements += utils.parse_requirements(
120 reqfiles=["pkg/requirements-leap.pip"])
123 name='leap.keymanager',
126 url='https://leap.se/',
127 download_url=DOWNLOAD_URL,
129 description='LEAP\'s Key Manager',
130 author='The LEAP Encryption Access Project',
131 author_email='info@leap.se',
132 maintainer='Kali Kaneko',
133 maintainer_email='kali@leap.se',
135 "The Key Manager handles all types of keys to allow for "
136 "point-to-point encryption between parties communicating through "
137 "LEAP infrastructure."
139 classifiers=trove_classifiers,
140 namespace_packages=["leap"],
141 packages=find_packages('src', exclude=['leap.keymanager.tests']),
142 package_dir={'': 'src'},
143 test_suite='leap.keymanager.tests',
144 install_requires=requirements,
145 tests_require=utils.parse_requirements(
146 reqfiles=['pkg/requirements-testing.pip']),