2015-06-22 22:47:27 +02:00
|
|
|
"""
|
|
|
|
Lemur
|
|
|
|
=====
|
|
|
|
|
2015-09-22 00:16:04 +02:00
|
|
|
Is a TLS management and orchestration tool.
|
2015-06-22 22:47:27 +02:00
|
|
|
|
|
|
|
:copyright: (c) 2015 by Netflix, see AUTHORS for more
|
|
|
|
:license: Apache, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2015-09-19 00:50:59 +02:00
|
|
|
import json
|
2015-06-22 22:47:27 +02:00
|
|
|
import os.path
|
2015-09-19 00:50:59 +02:00
|
|
|
import datetime
|
2015-06-22 22:47:27 +02:00
|
|
|
|
|
|
|
from distutils import log
|
|
|
|
from distutils.core import Command
|
|
|
|
from setuptools.command.develop import develop
|
2015-07-21 01:13:42 +02:00
|
|
|
from setuptools.command.install import install
|
2015-06-22 22:47:27 +02:00
|
|
|
from setuptools.command.sdist import sdist
|
2015-09-08 06:54:23 +02:00
|
|
|
from setuptools import setup, find_packages
|
2015-06-22 22:47:27 +02:00
|
|
|
from subprocess import check_output
|
|
|
|
|
|
|
|
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
|
|
|
|
|
2015-07-23 19:22:16 +02:00
|
|
|
install_requires = [
|
2015-07-30 06:54:29 +02:00
|
|
|
'Flask==0.10.1',
|
2015-11-30 19:10:50 +01:00
|
|
|
'Flask-RESTful==0.3.3',
|
2015-11-23 19:23:23 +01:00
|
|
|
'Flask-SQLAlchemy==2.1',
|
2015-07-30 06:54:29 +02:00
|
|
|
'Flask-Script==2.0.5',
|
2015-11-23 19:23:23 +01:00
|
|
|
'Flask-Migrate==1.6.0',
|
|
|
|
'Flask-Bcrypt==0.7.1',
|
2015-07-30 06:54:29 +02:00
|
|
|
'Flask-Principal==0.4.0',
|
2015-07-23 22:46:54 +02:00
|
|
|
'Flask-Mail==0.9.1',
|
2015-11-23 19:23:23 +01:00
|
|
|
'SQLAlchemy-Utils==0.31.3',
|
|
|
|
'BeautifulSoup4==4.4.1',
|
|
|
|
'requests==2.8.1',
|
2015-07-30 06:54:29 +02:00
|
|
|
'psycopg2==2.6.1',
|
2015-11-23 19:23:23 +01:00
|
|
|
'arrow==0.7.0',
|
2015-07-30 06:54:29 +02:00
|
|
|
'boto==2.38.0', # we might make this optional
|
2015-11-24 00:41:11 +01:00
|
|
|
'six==1.10.0',
|
2015-11-25 23:18:00 +01:00
|
|
|
'gunicorn==19.4.1',
|
2015-07-30 06:54:29 +02:00
|
|
|
'pycrypto==2.6.1',
|
2015-11-23 19:23:23 +01:00
|
|
|
'cryptography==1.1.1',
|
2015-07-30 06:54:29 +02:00
|
|
|
'pyopenssl==0.15.1',
|
2015-11-23 19:23:23 +01:00
|
|
|
'pyjwt==1.4.0',
|
2015-08-02 03:31:38 +02:00
|
|
|
'xmltodict==0.9.2',
|
2015-11-25 23:18:00 +01:00
|
|
|
'lockfile==0.12.2',
|
2015-11-23 19:23:23 +01:00
|
|
|
'future==0.15.2',
|
2015-06-22 22:47:27 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
tests_require = [
|
|
|
|
'pyflakes',
|
2015-11-23 19:23:23 +01:00
|
|
|
'moto==0.4.18',
|
2015-07-23 22:01:45 +02:00
|
|
|
'nose==1.3.7',
|
2015-11-23 19:23:23 +01:00
|
|
|
'pytest==2.8.3',
|
|
|
|
'pytest-flask==0.10.0'
|
2015-06-22 22:47:27 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
docs_require = [
|
|
|
|
'sphinx',
|
|
|
|
'sphinxcontrib-httpdomain'
|
|
|
|
]
|
|
|
|
|
2015-07-21 01:13:42 +02:00
|
|
|
dev_requires = [
|
2015-11-24 00:41:11 +01:00
|
|
|
'flake8>=2.0,<3.0',
|
2015-07-21 01:13:42 +02:00
|
|
|
]
|
|
|
|
|
2015-07-23 19:22:16 +02:00
|
|
|
|
2015-07-21 01:13:42 +02:00
|
|
|
class SmartInstall(install):
|
|
|
|
"""
|
|
|
|
Installs Lemur into the Python environment.
|
|
|
|
If the package indicator is missing, this will also force a run of
|
|
|
|
`build_static` which is required for JavaScript assets and other things.
|
|
|
|
"""
|
|
|
|
def _needs_static(self):
|
2015-08-11 23:53:28 +02:00
|
|
|
return not os.path.exists(os.path.join(ROOT, 'lemur/static/dist'))
|
2015-07-21 01:13:42 +02:00
|
|
|
|
|
|
|
def run(self):
|
|
|
|
if self._needs_static():
|
|
|
|
self.run_command('build_static')
|
|
|
|
install.run(self)
|
|
|
|
|
2015-07-23 19:22:16 +02:00
|
|
|
|
2015-06-22 22:47:27 +02:00
|
|
|
class DevelopWithBuildStatic(develop):
|
|
|
|
def install_for_development(self):
|
|
|
|
self.run_command('build_static')
|
|
|
|
return develop.install_for_development(self)
|
|
|
|
|
|
|
|
|
|
|
|
class SdistWithBuildStatic(sdist):
|
2015-09-19 00:50:59 +02:00
|
|
|
def make_release_tree(self, *a, **kw):
|
|
|
|
dist_path = self.distribution.get_fullname()
|
|
|
|
|
|
|
|
sdist.make_release_tree(self, *a, **kw)
|
|
|
|
|
|
|
|
self.reinitialize_command('build_static', work_path=dist_path)
|
2015-06-22 22:47:27 +02:00
|
|
|
self.run_command('build_static')
|
2015-09-19 00:50:59 +02:00
|
|
|
|
|
|
|
with open(os.path.join(dist_path, 'lemur-package.json'), 'w') as fp:
|
|
|
|
json.dump({
|
|
|
|
'createdAt': datetime.datetime.utcnow().isoformat() + 'Z',
|
|
|
|
}, fp)
|
2015-06-22 22:47:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
class BuildStatic(Command):
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
2015-09-04 01:45:49 +02:00
|
|
|
log.info("running [npm install --quiet] in {0}".format(ROOT))
|
2015-09-19 19:12:12 +02:00
|
|
|
try:
|
|
|
|
check_output(['npm', 'install', '--quiet'], cwd=ROOT)
|
|
|
|
|
|
|
|
log.info("running [gulp build]")
|
|
|
|
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT)
|
|
|
|
log.info("running [gulp package]")
|
|
|
|
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'package'], cwd=ROOT)
|
|
|
|
except Exception as e:
|
2015-09-19 19:24:56 +02:00
|
|
|
log.warn("Unable to build static content")
|
2015-06-22 22:47:27 +02:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name='lemur',
|
2015-10-24 20:18:27 +02:00
|
|
|
version='0.1.5',
|
2015-06-22 22:47:27 +02:00
|
|
|
author='Kevin Glisson',
|
|
|
|
author_email='kglisson@netflix.com',
|
2015-09-19 00:50:59 +02:00
|
|
|
url='https://github.com/netflix/lemur',
|
|
|
|
download_url='https://github.com/Netflix/lemur/archive/0.1.3.tar.gz',
|
|
|
|
description='Certificate management and orchestration service',
|
2015-08-12 00:46:54 +02:00
|
|
|
long_description=open(os.path.join(ROOT, 'README.rst')).read(),
|
2015-09-08 06:54:23 +02:00
|
|
|
packages=find_packages(),
|
2015-06-22 22:47:27 +02:00
|
|
|
include_package_data=True,
|
|
|
|
zip_safe=False,
|
|
|
|
install_requires=install_requires,
|
|
|
|
extras_require={
|
|
|
|
'tests': tests_require,
|
2015-07-21 01:13:42 +02:00
|
|
|
'docs': docs_require,
|
|
|
|
'dev': dev_requires,
|
2015-06-22 22:47:27 +02:00
|
|
|
},
|
|
|
|
cmdclass={
|
|
|
|
'build_static': BuildStatic,
|
2015-07-21 01:13:42 +02:00
|
|
|
'sdist': SdistWithBuildStatic,
|
|
|
|
'install': SmartInstall
|
2015-06-22 22:47:27 +02:00
|
|
|
},
|
|
|
|
entry_points={
|
|
|
|
'console_scripts': [
|
|
|
|
'lemur = lemur.manage:main',
|
|
|
|
],
|
2015-07-04 21:47:57 +02:00
|
|
|
'lemur.plugins': [
|
2015-07-11 02:02:23 +02:00
|
|
|
'verisign_issuer = lemur.plugins.lemur_verisign.plugin:VerisignIssuerPlugin',
|
|
|
|
'aws_destination = lemur.plugins.lemur_aws.plugin:AWSDestinationPlugin',
|
2015-08-03 22:51:27 +02:00
|
|
|
'aws_source = lemur.plugins.lemur_aws.plugin:AWSSourcePlugin',
|
|
|
|
'email_notification = lemur.plugins.lemur_email.plugin:EmailNotificationPlugin',
|
2015-11-25 23:54:08 +01:00
|
|
|
'java_export = lemur.plugins.lemur_java.plugin:JavaExportPlugin'
|
2015-07-04 21:47:57 +02:00
|
|
|
],
|
2015-06-22 22:47:27 +02:00
|
|
|
},
|
|
|
|
classifiers=[
|
|
|
|
'Framework :: Flask',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Intended Audience :: System Administrators',
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Topic :: Software Development'
|
|
|
|
]
|
|
|
|
)
|