2013-12-09 11:58:50 -08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# vim: set sw=4 et:
|
|
|
|
|
2014-02-19 23:37:44 +00:00
|
|
|
from setuptools import setup, find_packages
|
2014-03-05 11:19:26 -08:00
|
|
|
from setuptools.command.test import test as TestCommand
|
2014-02-09 12:06:35 -08:00
|
|
|
import glob
|
2017-03-28 10:31:43 -07:00
|
|
|
import os
|
|
|
|
import sys
|
2013-12-09 11:58:50 -08:00
|
|
|
|
2015-03-23 11:04:41 -07:00
|
|
|
from pywb import __version__
|
|
|
|
|
2014-03-05 11:19:26 -08:00
|
|
|
|
2014-03-10 19:11:19 -07:00
|
|
|
long_description = open('README.rst').read()
|
2014-03-05 11:19:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
class PyTest(TestCommand):
|
2015-11-04 16:16:10 -08:00
|
|
|
user_options = []
|
2014-03-05 11:19:26 -08:00
|
|
|
def finalize_options(self):
|
2015-11-04 16:33:19 -08:00
|
|
|
TestCommand.finalize_options(self)
|
2015-11-26 00:59:57 -08:00
|
|
|
self.test_suite = ' '
|
2014-03-05 11:19:26 -08:00
|
|
|
|
|
|
|
def run_tests(self):
|
2017-01-26 00:37:35 -08:00
|
|
|
from gevent.monkey import patch_all; patch_all()
|
|
|
|
|
2014-03-05 11:19:26 -08:00
|
|
|
import pytest
|
2014-03-27 21:43:30 -07:00
|
|
|
import os
|
|
|
|
os.environ.pop('PYWB_CONFIG_FILE', None)
|
2017-04-29 13:47:54 -07:00
|
|
|
cmdline = '--cov-config .coveragerc --cov pywb'
|
2014-03-14 18:17:22 -07:00
|
|
|
cmdline += ' -v --doctest-module ./pywb/ tests/'
|
2015-11-04 16:16:10 -08:00
|
|
|
|
2017-04-29 13:47:54 -07:00
|
|
|
errcode = pytest.main(cmdline.split(' '))
|
2015-11-04 16:16:10 -08:00
|
|
|
|
2014-03-05 11:19:26 -08:00
|
|
|
sys.exit(errcode)
|
|
|
|
|
2017-03-08 17:03:52 -08:00
|
|
|
|
2017-03-28 10:31:43 -07:00
|
|
|
|
|
|
|
def get_git_short_hash():
|
|
|
|
import subprocess
|
|
|
|
try:
|
|
|
|
hash_id = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).rstrip()
|
|
|
|
if sys.version_info >= (3, 0):
|
|
|
|
hash_id = hash_id.decode('utf-8')
|
|
|
|
|
|
|
|
return hash_id
|
|
|
|
except:
|
|
|
|
return ''
|
|
|
|
|
|
|
|
def generate_git_hash_py(pkg, filename='git_hash.py'):
|
|
|
|
try:
|
|
|
|
git_hash = get_git_short_hash()
|
|
|
|
with open(os.path.join(pkg, filename), 'wt') as fh:
|
|
|
|
fh.write('git_hash = "{0}"\n'.format(git_hash))
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-08 17:03:52 -08:00
|
|
|
def load_requirements(filename):
|
|
|
|
with open(filename, 'rt') as fh:
|
|
|
|
return fh.read().rstrip().split('\n')
|
|
|
|
|
|
|
|
|
2017-03-28 10:31:43 -07:00
|
|
|
generate_git_hash_py('pywb')
|
|
|
|
|
|
|
|
|
2014-02-19 23:37:44 +00:00
|
|
|
setup(
|
|
|
|
name='pywb',
|
2015-03-23 11:04:41 -07:00
|
|
|
version=__version__,
|
2014-02-19 23:37:44 +00:00
|
|
|
url='https://github.com/ikreymer/pywb',
|
|
|
|
author='Ilya Kreymer',
|
2014-03-12 17:57:54 -07:00
|
|
|
author_email='ikreymer@gmail.com',
|
2017-08-10 10:24:53 -07:00
|
|
|
description='Pywb Webrecorder web archive replay and capture tools',
|
2014-03-05 11:19:26 -08:00
|
|
|
long_description=long_description,
|
2014-02-19 23:37:44 +00:00
|
|
|
license='GPL',
|
|
|
|
packages=find_packages(),
|
2016-04-30 15:15:35 -07:00
|
|
|
zip_safe=True,
|
2014-02-19 23:37:44 +00:00
|
|
|
provides=[
|
2014-03-02 00:26:29 -08:00
|
|
|
'pywb',
|
|
|
|
'pywb.utils',
|
2017-08-10 10:24:53 -07:00
|
|
|
'pywb.warcserver',
|
|
|
|
'pywb.warcserver.index',
|
|
|
|
'pywb.warcserver.resource',
|
|
|
|
'pywb.recorder',
|
2014-03-02 00:26:29 -08:00
|
|
|
'pywb.rewrite',
|
2017-08-10 10:24:53 -07:00
|
|
|
'pywb.indexer',
|
2015-03-13 19:53:50 -07:00
|
|
|
'pywb.manager',
|
2016-11-08 14:30:09 -08:00
|
|
|
'pywb.apps',
|
2014-02-19 23:37:44 +00:00
|
|
|
],
|
|
|
|
package_data={
|
2015-03-16 18:48:09 -07:00
|
|
|
'pywb': ['static/flowplayer/*', 'static/*.*', 'templates/*', '*.yaml'],
|
2014-02-19 23:37:44 +00:00
|
|
|
},
|
2014-03-05 11:19:26 -08:00
|
|
|
data_files=[
|
2015-01-10 14:06:15 -08:00
|
|
|
('sample_archive/cdx', glob.glob('sample_archive/cdx/*')),
|
2015-03-19 11:20:40 -07:00
|
|
|
('sample_archive/cdxj', glob.glob('sample_archive/cdxj/*')),
|
|
|
|
('sample_archive/non-surt-cdx', glob.glob('sample_archive/non-surt-cdx/*')),
|
2015-01-10 14:06:15 -08:00
|
|
|
('sample_archive/zipcdx', glob.glob('sample_archive/zipcdx/*')),
|
|
|
|
('sample_archive/warcs', glob.glob('sample_archive/warcs/*')),
|
|
|
|
('sample_archive/text_content',
|
2014-03-05 11:19:26 -08:00
|
|
|
glob.glob('sample_archive/text_content/*')),
|
2014-02-19 23:37:44 +00:00
|
|
|
],
|
2017-03-08 17:03:52 -08:00
|
|
|
install_requires=load_requirements('requirements.txt'),
|
2016-12-21 16:11:48 -08:00
|
|
|
dependency_links=[
|
2016-12-21 17:15:41 -08:00
|
|
|
#'git+https://github.com/t0m/pyamf.git@python3#egg=pyamf-0.8.0'
|
2016-12-21 16:11:48 -08:00
|
|
|
],
|
2014-03-05 11:19:26 -08:00
|
|
|
tests_require=[
|
2014-02-19 23:37:44 +00:00
|
|
|
'pytest',
|
2017-03-10 11:19:27 -08:00
|
|
|
'WebTest',
|
2014-03-05 11:19:26 -08:00
|
|
|
'pytest-cov',
|
2014-03-25 11:02:32 -07:00
|
|
|
'fakeredis',
|
|
|
|
'mock',
|
2016-11-11 11:03:16 -08:00
|
|
|
'urllib3',
|
|
|
|
'werkzeug',
|
2014-03-05 11:19:26 -08:00
|
|
|
],
|
|
|
|
cmdclass={'test': PyTest},
|
|
|
|
test_suite='',
|
2014-03-08 15:09:53 -08:00
|
|
|
entry_points="""
|
|
|
|
[console_scripts]
|
2015-03-22 21:50:56 -07:00
|
|
|
wayback = pywb.apps.cli:wayback
|
2015-03-23 09:08:09 -07:00
|
|
|
cdx-server = pywb.apps.cli:cdx_server
|
|
|
|
live-rewrite-server = pywb.apps.cli:live_rewrite_server
|
2017-06-20 20:41:13 -04:00
|
|
|
cdx-indexer = pywb.indexer.cdxindexer:main
|
2015-03-17 19:05:39 -07:00
|
|
|
wb-manager = pywb.manager.manager:main_wrap_exc
|
2017-08-10 10:24:53 -07:00
|
|
|
warcserver = pywb.apps.cli:warcserver
|
2014-03-10 19:19:41 -07:00
|
|
|
""",
|
2014-03-10 19:11:19 -07:00
|
|
|
classifiers=[
|
2017-02-16 15:12:22 -08:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
2014-03-10 19:11:19 -07:00
|
|
|
'Environment :: Web Environment',
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
2017-02-16 15:12:22 -08:00
|
|
|
'Programming Language :: Python :: 2',
|
2014-03-10 19:11:19 -07:00
|
|
|
'Programming Language :: Python :: 2.6',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
2017-02-16 15:12:22 -08:00
|
|
|
'Programming Language :: Python :: 3',
|
2017-02-16 11:02:53 -08:00
|
|
|
'Programming Language :: Python :: 3.3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
2014-03-10 19:11:19 -07:00
|
|
|
'Topic :: Internet :: Proxy Servers',
|
|
|
|
'Topic :: Internet :: WWW/HTTP',
|
|
|
|
'Topic :: Internet :: WWW/HTTP :: WSGI',
|
|
|
|
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
|
|
|
|
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
|
|
|
|
'Topic :: Internet :: WWW/HTTP :: WSGI :: Server',
|
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
|
|
'Topic :: System :: Archiving',
|
|
|
|
'Topic :: System :: Archiving :: Backup',
|
|
|
|
'Topic :: Utilities',
|
|
|
|
])
|