tox (and travis ci?) were hiding the fact that the gdbm dependency was the problem

This commit is contained in:
Noah Levitt 2013-12-07 00:27:59 -08:00
parent b6774da603
commit e9e152ca7d
4 changed files with 22 additions and 8 deletions

View File

@ -6,6 +6,9 @@ python:
- "2.7"
- "3.2"
- "3.3"
before_install:
- sudo apt-get update
- sudo apt-get -y install python-gdbm python3-gdbm
install: python setup.py install
script: python setup.py test

View File

@ -8,19 +8,31 @@ module can read. Included with warcprox because it's useful for inspecting a
deduplication database or a playback index database, but it is a generic tool.
"""
import anydbm
try:
import dbm
whichdb = dbm.whichdb
except:
import anydbm
dbm = anydbm
from whichdb import whichdb
import sys
import os.path
if __name__ == "__main__":
if len(sys.argv) != 2:
sys.stderr.write("usage: {} DBM_FILE\n".format(sys.argv[0]))
exit(1)
# import whichdb
# which = whichdb.whichdb(sys.argv[1])
# print('{} is a {} db'.format(sys.argv[1], which))
if not os.path.exists(sys.argv[1]):
sys.stderr.write('No such file {}\n\n'.format(sys.argv[1]))
sys.stderr.write("usage: {} DBM_FILE\n".format(sys.argv[0]))
exit(1)
db = anydbm.open(sys.argv[1])
which = whichdb(sys.argv[1])
print('{} is a {} db'.format(sys.argv[1], which))
db = dbm.open(sys.argv[1], 'r')
for key in db.keys():
print("{}:{}".format(key, db[key]))

View File

@ -12,7 +12,7 @@ setuptools.setup(name='warcprox',
long_description=open('README.rst').read(),
license='GPL',
packages=['warcprox'],
install_requires=['pyopenssl', 'warctools>=4.8.3'], # gdbm/dbhash?
install_requires=['gdbm', 'pyopenssl', 'warctools>=4.8.3'],
dependency_links=['git+https://github.com/nlevitt/warctools.git@python3#egg=warctools-4.8.3'],
tests_require=['requests>=2.0.1'], # >=2.0.1 for https://github.com/kennethreitz/requests/pull/1636
test_suite='warcprox.tests',

View File

@ -7,7 +7,6 @@
envlist = py27, py32, py33
[testenv]
sitepackages = True
commands = {envpython} setup.py test
# commands = {envpython} -m unittest discover
# deps = requests>=2.0.1