setup.py
98 lines
| 3.0 KiB
| text/x-python
|
PythonLexer
/ backend / setup.py
r0 | import os | |||
import re | ||||
from setuptools import setup, find_packages | ||||
here = os.path.abspath(os.path.dirname(__file__)) | ||||
r161 | README = open(os.path.join(here, "README.md")).read() | |||
CHANGES = open(os.path.join(here, "CHANGELOG.md")).read() | ||||
r0 | ||||
r153 | REQUIREMENTS = open(os.path.join(here, "requirements.txt")).readlines() | |||
r0 | ||||
r153 | compiled = re.compile("([^=><]*).*") | |||
r0 | ||||
def parse_req(req): | ||||
return compiled.search(req).group(1).strip() | ||||
r188 | if "APPENLIGHT_DEVELOP" in os.environ: | |||
requires = [_f for _f in map(parse_req, REQUIREMENTS) if _f] | ||||
else: | ||||
requires = REQUIREMENTS | ||||
r0 | ||||
r29 | ||||
def _get_meta_var(name, data, callback_handler=None): | ||||
import re | ||||
r153 | ||||
matches = re.compile(r"(?:%s)\s*=\s*(.*)" % name).search(data) | ||||
r29 | if matches: | |||
if not callable(callback_handler): | ||||
callback_handler = lambda v: v | ||||
return callback_handler(eval(matches.groups()[0])) | ||||
r137 | ||||
r153 | with open(os.path.join(here, "src", "appenlight", "__init__.py"), "r") as _meta: | |||
r29 | _metadata = _meta.read() | |||
r153 | __license__ = _get_meta_var("__license__", _metadata) | |||
__author__ = _get_meta_var("__author__", _metadata) | ||||
__url__ = _get_meta_var("__url__", _metadata) | ||||
found_packages = find_packages("src") | ||||
found_packages.append("appenlight.migrations.versions") | ||||
setup( | ||||
name="appenlight", | ||||
description="appenlight", | ||||
r186 | long_description=README, | |||
r153 | classifiers=[ | |||
r187 | "Framework :: Pyramid", | |||
"License :: OSI Approved :: Apache Software License", | ||||
r153 | "Programming Language :: Python", | |||
r187 | "Programming Language :: Python :: 3 :: Only", | |||
"Programming Language :: Python :: 3.6", | ||||
"Topic :: System :: Monitoring", | ||||
"Topic :: Software Development", | ||||
"Topic :: Software Development :: Bug Tracking", | ||||
"Topic :: Internet :: Log Analysis", | ||||
r153 | "Topic :: Internet :: WWW/HTTP", | |||
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application", | ||||
], | ||||
r187 | version="2.0.0rc1", | |||
r153 | license=__license__, | |||
author=__author__, | ||||
url=__url__, | ||||
r186 | keywords="web wsgi bfg pylons pyramid flask django monitoring apm instrumentation appenlight", | |||
python_requires=">=3.5", | ||||
long_description_content_type="text/markdown", | ||||
r153 | package_dir={"": "src"}, | |||
packages=found_packages, | ||||
include_package_data=True, | ||||
zip_safe=False, | ||||
test_suite="appenlight", | ||||
install_requires=requires, | ||||
extras_require={ | ||||
"dev": [ | ||||
"coverage", | ||||
"pytest", | ||||
"pyramid", | ||||
"tox", | ||||
"mock", | ||||
"pytest-mock", | ||||
"webtest", | ||||
], | ||||
"lint": ["black"], | ||||
}, | ||||
entry_points={ | ||||
"paste.app_factory": ["main = appenlight:main"], | ||||
"console_scripts": [ | ||||
"appenlight-cleanup = appenlight.scripts.cleanup:main", | ||||
"appenlight-initializedb = appenlight.scripts.initialize_db:main", | ||||
"appenlight-migratedb = appenlight.scripts.migratedb:main", | ||||
"appenlight-reindex-elasticsearch = appenlight.scripts.reindex_elasticsearch:main", | ||||
"appenlight-static = appenlight.scripts.static:main", | ||||
"appenlight-make-config = appenlight.scripts.make_config:main", | ||||
], | ||||
}, | ||||
) | ||||