-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·112 lines (90 loc) · 3.19 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
try:
from setuptools.command.test import test as TestCommand
_supports_test_command = True
except ImportError:
_supports_test_command = False
import passpie_keepass
__version__ = passpie_keepass.__version__
setup_kwargs = {}
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', '')
requirements = []
dependency_links = []
with open('requirements.txt') as _f:
for _line in _f.readlines():
_line = _line.strip()
if _line.startswith('#'):
pass
elif _line.startswith('-e') or '://' in _line:
dependency_links.append(_line.replace('-e', '').strip())
else:
requirements.append(_line)
with open('dev_requirements.txt') as _f:
dev_requirements = [l for l in (l.strip() for l in _f.readlines()) if l]
if _supports_test_command:
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
if 'pytest' not in dev_requirements:
dev_requirements.append('pytest')
setup_kwargs.setdefault('cmdclass', {}).update(test=PyTest)
setup(
name='passpie-keepass',
version=__version__,
description="Keepass database importer for passpie using kppy",
long_description=readme + '\n\n' + history,
author="Constantin Petrisor",
author_email='costy.petrisor@gmail.com',
url='https://github.com/costypetrisor/passpie_keepass',
packages=find_packages(),
include_package_data=True,
install_requires=requirements,
dependency_links=dependency_links,
license="MIT",
keywords='passpie_keepass',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
# 'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python',
'Topic :: Security :: Cryptography',
],
test_suite='tests',
tests_require=dev_requirements,
entry_points={
'passpie_importers': [
'keepass=passpie_keepass.passpie_keepass:KppyImporter',
],
},
**setup_kwargs
)