##// END OF EJS Templates
setup: require pytest-mock
ergo -
Show More
@@ -1,81 +1,81 b''
1 import os
1 import os
2 import re
2 import re
3
3
4 from setuptools import setup, find_packages
4 from setuptools import setup, find_packages
5
5
6 here = os.path.abspath(os.path.dirname(__file__))
6 here = os.path.abspath(os.path.dirname(__file__))
7 README = open(os.path.join(here, 'README.rst')).read()
7 README = open(os.path.join(here, 'README.rst')).read()
8 CHANGES = open(os.path.join(here, 'CHANGELOG.rst')).read()
8 CHANGES = open(os.path.join(here, 'CHANGELOG.rst')).read()
9
9
10 REQUIREMENTS = open(os.path.join(here, 'requirements.txt')).readlines()
10 REQUIREMENTS = open(os.path.join(here, 'requirements.txt')).readlines()
11
11
12 compiled = re.compile('([^=><]*).*')
12 compiled = re.compile('([^=><]*).*')
13
13
14
14
15 def parse_req(req):
15 def parse_req(req):
16 return compiled.search(req).group(1).strip()
16 return compiled.search(req).group(1).strip()
17
17
18
18
19 requires = [_f for _f in map(parse_req, REQUIREMENTS) if _f]
19 requires = [_f for _f in map(parse_req, REQUIREMENTS) if _f]
20
20
21
21
22 def _get_meta_var(name, data, callback_handler=None):
22 def _get_meta_var(name, data, callback_handler=None):
23 import re
23 import re
24 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
24 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
25 if matches:
25 if matches:
26 if not callable(callback_handler):
26 if not callable(callback_handler):
27 callback_handler = lambda v: v
27 callback_handler = lambda v: v
28
28
29 return callback_handler(eval(matches.groups()[0]))
29 return callback_handler(eval(matches.groups()[0]))
30
30
31
31
32 with open(os.path.join(here, 'src', 'appenlight', '__init__.py'), 'r') as _meta:
32 with open(os.path.join(here, 'src', 'appenlight', '__init__.py'), 'r') as _meta:
33 _metadata = _meta.read()
33 _metadata = _meta.read()
34
34
35 with open(os.path.join(here, 'VERSION'), 'r') as _meta_version:
35 with open(os.path.join(here, 'VERSION'), 'r') as _meta_version:
36 __version__ = _meta_version.read().strip()
36 __version__ = _meta_version.read().strip()
37
37
38 __license__ = _get_meta_var('__license__', _metadata)
38 __license__ = _get_meta_var('__license__', _metadata)
39 __author__ = _get_meta_var('__author__', _metadata)
39 __author__ = _get_meta_var('__author__', _metadata)
40 __url__ = _get_meta_var('__url__', _metadata)
40 __url__ = _get_meta_var('__url__', _metadata)
41
41
42 found_packages = find_packages('src')
42 found_packages = find_packages('src')
43 found_packages.append('appenlight.migrations.versions')
43 found_packages.append('appenlight.migrations.versions')
44 setup(name='appenlight',
44 setup(name='appenlight',
45 description='appenlight',
45 description='appenlight',
46 long_description=README + '\n\n' + CHANGES,
46 long_description=README + '\n\n' + CHANGES,
47 classifiers=[
47 classifiers=[
48 "Programming Language :: Python",
48 "Programming Language :: Python",
49 "Framework :: Pylons",
49 "Framework :: Pylons",
50 "Topic :: Internet :: WWW/HTTP",
50 "Topic :: Internet :: WWW/HTTP",
51 "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
51 "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
52 ],
52 ],
53 version=__version__,
53 version=__version__,
54 license=__license__,
54 license=__license__,
55 author=__author__,
55 author=__author__,
56 url=__url__,
56 url=__url__,
57 keywords='web wsgi bfg pylons pyramid',
57 keywords='web wsgi bfg pylons pyramid',
58 package_dir={'': 'src'},
58 package_dir={'': 'src'},
59 packages=found_packages,
59 packages=found_packages,
60 include_package_data=True,
60 include_package_data=True,
61 zip_safe=False,
61 zip_safe=False,
62 test_suite='appenlight',
62 test_suite='appenlight',
63 install_requires=requires,
63 install_requires=requires,
64 extras_require={
64 extras_require={
65 "dev": ["coverage", "pytest", "pyramid", "tox", "mock", "webtest"],
65 "dev": ["coverage", "pytest", "pyramid", "tox", "mock", "pytest-mock", "webtest"],
66 "lint": ["black"],
66 "lint": ["black"],
67 },
67 },
68 entry_points={
68 entry_points={
69 'paste.app_factory': [
69 'paste.app_factory': [
70 'main = appenlight:main'
70 'main = appenlight:main'
71 ],
71 ],
72 'console_scripts': [
72 'console_scripts': [
73 'appenlight-cleanup = appenlight.scripts.cleanup:main',
73 'appenlight-cleanup = appenlight.scripts.cleanup:main',
74 'appenlight-initializedb = appenlight.scripts.initialize_db:main',
74 'appenlight-initializedb = appenlight.scripts.initialize_db:main',
75 'appenlight-migratedb = appenlight.scripts.migratedb:main',
75 'appenlight-migratedb = appenlight.scripts.migratedb:main',
76 'appenlight-reindex-elasticsearch = appenlight.scripts.reindex_elasticsearch:main',
76 'appenlight-reindex-elasticsearch = appenlight.scripts.reindex_elasticsearch:main',
77 'appenlight-static = appenlight.scripts.static:main',
77 'appenlight-static = appenlight.scripts.static:main',
78 'appenlight-make-config = appenlight.scripts.make_config:main',
78 'appenlight-make-config = appenlight.scripts.make_config:main',
79 ]
79 ]
80 }
80 }
81 )
81 )
General Comments 0
You need to be logged in to leave comments. Login now