diff --git a/.travis/install.sh b/.travis/install.sh index a8ea2733..439039bd 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -6,7 +6,6 @@ python setup.py -q install pip install -r extra_requirements.txt pip install coverage pytest-cov coveralls pip install codecov -npm install if [ "$WR_TEST" = "yes" ]; then git clone https://github.com/webrecorder/webrecorder-tests.git diff --git a/package.json b/package.json deleted file mode 100644 index 241a71ba..00000000 --- a/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "pywb", - "version": "1.0.0", - "description": "Web archival replay tools", - "main": "index.js", - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ikreymer/pywb.git" - }, - "author": "", - "license": "GPL-3.0", - "bugs": { - "url": "https://github.com/ikreymer/pywb/issues" - }, - "homepage": "https://github.com/ikreymer/pywb#readme", - "devDependencies": { - "chai": "^3.4.1", - "karma": "^0.13.15", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^0.2.1", - "karma-firefox-launcher": "^0.1.7", - "karma-html2js-preprocessor": "^0.1.0", - "karma-mocha": "^0.2.1", - "karma-sauce-launcher": "^0.3.0", - "mocha": "^2.3.4" - } -} diff --git a/setup.py b/setup.py index 19c973c3..bf4b5569 100755 --- a/setup.py +++ b/setup.py @@ -18,12 +18,14 @@ def get_ldecription(): class PyTest(TestCommand): user_options = [] + def finalize_options(self): TestCommand.finalize_options(self) self.test_suite = ' ' def run_tests(self): - from gevent.monkey import patch_all; patch_all() + from gevent.monkey import patch_all + patch_all() import pytest import os @@ -36,7 +38,6 @@ class PyTest(TestCommand): sys.exit(errcode) - def get_git_short_hash(): import subprocess try: @@ -45,19 +46,19 @@ def get_git_short_hash(): hash_id = hash_id.decode('utf-8') return hash_id - except: + except Exception: 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: + except Exception: pass - def load_requirements(filename): with open(filename, 'rt') as fh: requirements = fh.read().rstrip().split('\n') @@ -67,6 +68,7 @@ def load_requirements(filename): requirements.append("pyAMF") return requirements + def get_package_data(): pkgs = ['static/*.*', 'templates/*', @@ -79,10 +81,8 @@ def get_package_data(): return pkgs - generate_git_hash_py('pywb') - setup( name='pywb', version=__version__, @@ -96,7 +96,7 @@ setup( zip_safe=True, package_data={ 'pywb': get_package_data(), - }, + }, data_files=[ ('sample_archive/cdx', glob.glob('sample_archive/cdx/*')), ('sample_archive/cdxj', glob.glob('sample_archive/cdxj/*')), @@ -104,8 +104,8 @@ setup( ('sample_archive/zipcdx', glob.glob('sample_archive/zipcdx/*')), ('sample_archive/warcs', glob.glob('sample_archive/warcs/*')), ('sample_archive/text_content', - glob.glob('sample_archive/text_content/*')), - ], + glob.glob('sample_archive/text_content/*')), + ], install_requires=load_requirements('requirements.txt'), tests_require=[ 'pytest', @@ -116,9 +116,9 @@ setup( 'urllib3', 'werkzeug', 'httpbin==0.5.0', - 'ujson' - 'lxml', - ], + 'ujson', + 'lxml' + ], cmdclass={'test': PyTest}, test_suite='', entry_points="""