mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
README tweaks
update setup.py to support setup.py test! .travis.yml uses python setup.py test
This commit is contained in:
parent
25a8514352
commit
daf868fd61
@ -13,7 +13,8 @@ install:
|
|||||||
#script: py.test run-tests.py ./pywb/ --doctest-modules --ignore=setup.py
|
#script: py.test run-tests.py ./pywb/ --doctest-modules --ignore=setup.py
|
||||||
#script: py.test -v --doctest-module ./tests/*.py ./pywb/
|
#script: py.test -v --doctest-module ./tests/*.py ./pywb/
|
||||||
script:
|
script:
|
||||||
py.test --cov-config .coveragerc --cov pywb -v --doctest-module ./pywb/ tests/
|
#py.test --cov-config .coveragerc --cov pywb -v --doctest-module ./pywb/ tests/
|
||||||
|
python setup.py test
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
coveralls
|
coveralls
|
||||||
|
36
README.md
36
README.md
@ -10,12 +10,13 @@ At its core, it provides a web app which 'replays' archived web data stored in A
|
|||||||
captures.
|
captures.
|
||||||
|
|
||||||
|
|
||||||
|
### Latest Changes ###
|
||||||
|
|
||||||
The basic feature set of web replay is nearly complete.
|
The basic feature set of web replay is nearly complete.
|
||||||
|
|
||||||
pywb features new domain specific rules which can be applied to certain difficult and dynamic content in order to make
|
pywb now features new [domain-specific rules](pywb/rules.yaml) which are applied to certain difficult and dynamic content in order to make web replay work.
|
||||||
web replay work.
|
|
||||||
|
|
||||||
The rules set will be under constant iteration to deal with new challenges as the web evoles.
|
This rules set will be under constant iteration to deal with new challenges as the web evoles.
|
||||||
|
|
||||||
|
|
||||||
### Wayback Machine
|
### Wayback Machine
|
||||||
@ -55,11 +56,20 @@ Support for Python 3 is planned.
|
|||||||
|
|
||||||
pywb comes with a a set of sample archived content, also used by the test suite.
|
pywb comes with a a set of sample archived content, also used by the test suite.
|
||||||
|
|
||||||
The data can be found in `sample_archive` and contains
|
The data can be found in `sample_archive` and contains `warc` and `cdx` files.
|
||||||
`warc` and `cdx` files. The sample archive contains
|
|
||||||
recent captures from `http://example.com` and `http://iana.org`
|
|
||||||
|
|
||||||
### Installation
|
The sample archive contains recent captures from `http://example.com` and `http://iana.org`
|
||||||
|
|
||||||
|
### Runnable Apps
|
||||||
|
|
||||||
|
The pywb tool suite currently includes two runnable applications in the `pywb.apps` package:
|
||||||
|
|
||||||
|
* `python -m pywb.apps.wayback` -- start the full wayback on port 8080
|
||||||
|
|
||||||
|
* `python -m pywb.apps.cdx_server` -- start standalone cdx server on port 8090
|
||||||
|
|
||||||
|
|
||||||
|
### Step-By-Step Installation
|
||||||
|
|
||||||
To start a pywb with sample data:
|
To start a pywb with sample data:
|
||||||
|
|
||||||
@ -114,9 +124,9 @@ spawned uWSGI worker 1 (and the only) (pid: 123, cores: 1)
|
|||||||
At this point, you can open a web browser and navigate to the examples above for testing.
|
At this point, you can open a web browser and navigate to the examples above for testing.
|
||||||
|
|
||||||
|
|
||||||
### Automated Tests
|
### Test Suite
|
||||||
|
|
||||||
Currently pywb includes a full (and growing) suite of tests.
|
Currently pywb includes a full (and growing) suite of unit doctest and integration tests.
|
||||||
|
|
||||||
Top level integration tests can be found in the `tests/` directory,
|
Top level integration tests can be found in the `tests/` directory,
|
||||||
and each subpackage also contains doctests and unit tests.
|
and each subpackage also contains doctests and unit tests.
|
||||||
@ -124,10 +134,12 @@ and each subpackage also contains doctests and unit tests.
|
|||||||
|
|
||||||
The full set of tests can be run by executing:
|
The full set of tests can be run by executing:
|
||||||
|
|
||||||
`python run-tests.py`
|
`python setup.py test`
|
||||||
|
|
||||||
which will run the tests using py.test.
|
which will run the tests using py.test.
|
||||||
|
|
||||||
|
The py.test coverage plugin is used to keep track of test coverage.
|
||||||
|
|
||||||
|
|
||||||
### Sample Setup
|
### Sample Setup
|
||||||
|
|
||||||
@ -157,8 +169,8 @@ For more advanced use, the pywb init path can be customized further:
|
|||||||
|
|
||||||
* The `PYWB_CONFIG_FILE` env can be used to set a different yaml file.
|
* The `PYWB_CONFIG_FILE` env can be used to set a different yaml file.
|
||||||
|
|
||||||
* Custom init app (with or without yaml) can be created. See [bin/wayback.py] and [pywb/core/pywb_init.py] for examples
|
* Custom init app (with or without yaml) can be created. See [wayback.py](pywb/apps/wayback.py) and [pywb_init.py](pywb/core/pywb_init.py) for examples
|
||||||
of boot strapping.
|
of existing initialization paths.
|
||||||
|
|
||||||
|
|
||||||
### Configuring PyWb With Archived Data
|
### Configuring PyWb With Archived Data
|
||||||
|
42
setup.py
42
setup.py
@ -2,15 +2,41 @@
|
|||||||
# vim: set sw=4 et:
|
# vim: set sw=4 et:
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from setuptools.command.test import test as TestCommand
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
|
|
||||||
|
# Fix for TypeError: 'NoneType' object is not callable" error
|
||||||
|
# when running 'python setup.py test'
|
||||||
|
try:
|
||||||
|
import multiprocessing
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
long_description = open('README.md').read()
|
||||||
|
|
||||||
|
|
||||||
|
class PyTest(TestCommand):
|
||||||
|
def finalize_options(self):
|
||||||
|
TestCommand.finalize_options(self)
|
||||||
|
self.test_suite = True
|
||||||
|
|
||||||
|
def run_tests(self):
|
||||||
|
import pytest
|
||||||
|
import sys
|
||||||
|
cmdline = ' --cov-config .coveragerc --cov pywb'
|
||||||
|
cmdline += ' -v --doctest-module ./pywb/ tests/'
|
||||||
|
errcode = pytest.main(cmdline)
|
||||||
|
sys.exit(errcode)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pywb',
|
name='pywb',
|
||||||
version='0.2',
|
version='0.2',
|
||||||
url='https://github.com/ikreymer/pywb',
|
url='https://github.com/ikreymer/pywb',
|
||||||
author='Ilya Kreymer',
|
author='Ilya Kreymer',
|
||||||
author_email='ilya@archive.org',
|
author_email='ilya@archive.org',
|
||||||
long_description=open('README.md').read(),
|
long_description=long_description,
|
||||||
license='GPL',
|
license='GPL',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
provides=[
|
provides=[
|
||||||
@ -27,11 +53,12 @@ setup(
|
|||||||
package_data={
|
package_data={
|
||||||
'pywb': ['ui/*', 'static/*', '*.yaml'],
|
'pywb': ['ui/*', 'static/*', '*.yaml'],
|
||||||
},
|
},
|
||||||
data_files = [
|
data_files=[
|
||||||
('sample_archive/cdx/', glob.glob('sample_archive/cdx/*')),
|
('sample_archive/cdx/', glob.glob('sample_archive/cdx/*')),
|
||||||
('sample_archive/zipcdx/', glob.glob('sample_archive/zipcdx/*')),
|
('sample_archive/zipcdx/', glob.glob('sample_archive/zipcdx/*')),
|
||||||
('sample_archive/warcs/', glob.glob('sample_archive/warcs/*')),
|
('sample_archive/warcs/', glob.glob('sample_archive/warcs/*')),
|
||||||
('sample_archive/text_content/', glob.glob('sample_archive/text_content/*')),
|
('sample_archive/text_content/',
|
||||||
|
glob.glob('sample_archive/text_content/*')),
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'rfc3987',
|
'rfc3987',
|
||||||
@ -40,9 +67,12 @@ setup(
|
|||||||
'jinja2',
|
'jinja2',
|
||||||
'surt',
|
'surt',
|
||||||
'pyyaml',
|
'pyyaml',
|
||||||
|
],
|
||||||
|
tests_require=[
|
||||||
'WebTest',
|
'WebTest',
|
||||||
'pytest',
|
'pytest',
|
||||||
],
|
'pytest-cov',
|
||||||
# tests_require=['WebTest', 'pytest'],
|
],
|
||||||
zip_safe=False
|
cmdclass={'test': PyTest},
|
||||||
|
test_suite='',
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user