Skip to content

Commit

Permalink
Added tox script.
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenthompson committed Jun 6, 2016
1 parent f37b9f7 commit 970e350
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build
cppimport.egg-info
dist
.cache
.tox
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include tox.ini
include README.md
recursive-include tests *
11 changes: 10 additions & 1 deletion cppimport/checksum.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
import pickle
import hashlib
import traceback

import cppimport.find
import cppimport.config

# I use .${filename}.cppimporthash as the checksum file for each module.
def get_checksum_filepath(filepath):
Expand All @@ -24,7 +26,14 @@ def is_checksum_current(module_data):
if not os.path.exists(checksum_filepath):
return False

deps, old_checksum = pickle.load(open(checksum_filepath, 'rb'))
try:
deps, old_checksum = pickle.load(open(checksum_filepath, 'rb'))
except ValueError as e:
cppimport.config.quiet_print(
"Failed to load checksum due to exception" + traceback.format_exc()
)
return False

cur_checksum = calc_cur_checksum(deps, module_data)
if old_checksum != cur_checksum:
return False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
packages = ['cppimport'],

install_requires = [
'mako', 'pybind11', 'pytest'
'mako', 'pybind11'
],
zip_safe = False,
entry_points = {
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
envlist = py27, py35

[testenv]
deps =
pytest
mako
pybind11
commands =
py.test

0 comments on commit 970e350

Please sign in to comment.