Skip to content

Commit

Permalink
BLD: Small cleanup for travis
Browse files Browse the repository at this point in the history
Fix small merge issues on travis
  • Loading branch information
bashtage committed Sep 12, 2018
1 parent 223ea8d commit cc9e5d6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ before_install:
if [ ${COVERAGE} = true ]; then
pip install codecov coverage coveralls pytest-cov
export COVERAGE_OPTS="--cov-config=.travis_coveragerc --cov=statsmodels"
export CYTHON_COVERAGE=1
else
export COVERAGE_OPTS=""
fi
- echo "Cython coverage:" ${CYTHON_COVERAGE}
- if [ ${DOCBUILD} = true ]; then source tools/ci/docbuild_install.sh; fi;
- pip install flake8
- export SRCDIR=$PWD
Expand All @@ -136,8 +138,8 @@ script:
# docbuild and exit, if required
- if [ ${DOCBUILD} = true ]; then cd ${SRCDIR}/docs; source ${SRCDIR}/tools/ci/docbuild.sh; exit 0; fi;
# Run tests
- echo pytest -n 2 ${COVERAGE_OPTS} statsmodels --skip-examples
- pytest ${COVERAGE_OPTS} --skip-slow --skip-examples statsmodels/tsa/statespace statsmodels/tsa/kalmanf statsmodels/tsa/regime_switching statsmodels/tsa/tests/test_holtwinters.py statsmodels/nonparametric
- echo pytest -r a ${COVERAGE_OPTS} --skip-slow --skip-examples statsmodels/tsa/statespace statsmodels/tsa/kalmanf statsmodels/tsa/regime_switching statsmodels/tsa/tests/test_holtwinters.py statsmodels/nonparametric
- pytest -r a ${COVERAGE_OPTS} --skip-slow --skip-examples statsmodels/tsa/statespace statsmodels/tsa/kalmanf statsmodels/tsa/regime_switching statsmodels/tsa/tests/test_holtwinters.py statsmodels/nonparametric
- ./lint.sh

after_success:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ environment:
- PY_MAJOR_VER: 2
PYTHON_ARCH: "x86_64"
SCIPY: "0.18"
NUMPY: "1.11"
- PY_MAJOR_VER: 3
PYTHON_ARCH: "x86_64"
TEST_INSTALL: "true"
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import sys

from warnings import simplefilter
from ._version import get_versions
from statsmodels.tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
IterationLimitWarning, InvalidTestWarning)

Expand Down Expand Up @@ -54,5 +53,6 @@ def __call__(self, extra_args=None, exit=False):

test = PytestTester()

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
3 changes: 2 additions & 1 deletion statsmodels/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from ._version import get_versions
from . import iolib
from . import datasets
from . import tools
Expand Down Expand Up @@ -30,6 +29,7 @@
from .nonparametric import api as nonparametric
from . import distributions
from .__init__ import test

from .graphics.gofplots import qqplot, qqplot_2samples, qqline, ProbPlot
from .graphics import api as graphics
from .stats import api as stats
Expand Down Expand Up @@ -59,5 +59,6 @@ def open_help(chmpath=chmpath):
del os
del chmpath

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
1 change: 0 additions & 1 deletion statsmodels/tools/print_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,5 @@ def show_versions(show_dirs=True):

print("\n")


if __name__ == "__main__":
show_versions()
11 changes: 10 additions & 1 deletion tools/cythonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
except NameError:
WindowsError = None


#
# Rules
#
Expand Down Expand Up @@ -82,6 +83,7 @@ def process_pyx(fromfile, tofile):
except OSError:
raise OSError('Cython needs to be installed')


def process_tempita_pyx(fromfile, tofile):
try:
try:
Expand All @@ -107,6 +109,7 @@ def process_tempita_pyx(fromfile, tofile):
'.pyx.in' : process_tempita_pyx
}


#
# Hash db
#
Expand All @@ -122,17 +125,20 @@ def load_hashes(filename):
hashes = {}
return hashes


def save_hashes(hash_db, filename):
with open(filename, 'w') as f:
for key, value in sorted(hash_db.items()):
f.write("%s %s %s\n" % (key, value[0], value[1]))


def sha1_of_file(filename):
h = hashlib.sha1()
with open(filename, "rb") as f:
h.update(f.read())
return h.hexdigest()


#
# Exclusions
#
Expand All @@ -156,11 +162,13 @@ def normpath(path):
path = path[2:]
return path


def get_hash(frompath, topath):
from_hash = sha1_of_file(frompath)
to_hash = sha1_of_file(topath) if os.path.exists(topath) else None
return (from_hash, to_hash)


def process(path, fromfile, tofile, processor_function, hash_db):
fullfrompath = os.path.join(path, fromfile)
fulltopath = os.path.join(path, tofile)
Expand Down Expand Up @@ -197,14 +205,15 @@ def find_process_files(root_dir):
toext = ".c"
with open(os.path.join(cur_dir, filename), 'rb') as f:
data = f.read()
m = re.search(br"^\s*#\s*distutils:\s*language\s*=\s*c\+\+\s*$", data, re.I|re.M)
m = re.search(br"^\s*#\s*distutils:\s*language\s*=\s*c\+\+\s*$", data, re.I | re.M)
if m:
toext = ".cxx"
fromfile = filename
tofile = filename[:-len(fromext)] + toext
process(cur_dir, fromfile, tofile, function, hash_db)
save_hashes(hash_db, HASH_FILE)


def main():
try:
root_dir = sys.argv[1]
Expand Down

0 comments on commit cc9e5d6

Please sign in to comment.