diff --git a/.travis.yml b/.travis.yml index dd39336..291473c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ before_install: - git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels - 'if [[ $GROUP != js* ]]; then COVERAGE=""; fi' install: - - pip install "setuptools>=18.5" - - pip install -f travis-wheels/wheelhouse -e file://$PWD#egg=ipython[test] traitlets + - pip install "setuptools>=18.5" + - pip install -f travis-wheels/wheelhouse -e file://$PWD#egg=ipython[test] - pip install codecov script: - cd /tmp && iptest --coverage xml && cd - diff --git a/setup.py b/setup.py index c5a8bf5..7fcc724 100755 --- a/setup.py +++ b/setup.py @@ -292,13 +292,17 @@ else: setup_args.update(setuptools_extra_args) -# loose as `.dev` is suppose to be invalid -loose_pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d*)?$') def main(): - import IPython.core.release as r - if not loose_pep440re.match(r.version): - raise ValueError("Version number '%s' is not valid (should match [N!]N(.N)*[{a|b|rc}N][.postN][.devN])" % r.version) + try: + # loose as `.dev` is suppose to be invalid + print("check version number") + loose_pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d*)?$') + import IPython.core.release as r + if not loose_pep440re.match(r.version): + raise ValueError("Version number '%s' is not valid (should match [N!]N(.N)*[{a|b|rc}N][.postN][.devN])" % r.version) + except: + pass setup(**setup_args) if __name__ == '__main__': diff --git a/setupbase.py b/setupbase.py index 68b51b2..9d801f4 100644 --- a/setupbase.py +++ b/setupbase.py @@ -14,7 +14,7 @@ This includes: from __future__ import print_function -import errno +import re import os import sys @@ -24,10 +24,7 @@ from distutils.command.build_scripts import build_scripts from distutils.command.install import install from distutils.command.install_scripts import install_scripts from distutils.cmd import Command -from distutils.errors import DistutilsExecError -from fnmatch import fnmatch from glob import glob -from subprocess import Popen, PIPE from setupext import install_data_ext @@ -426,6 +423,14 @@ def git_prebuild(pkg_dir, build_cmd=build_py): class MyBuildPy(build_cmd): ''' Subclass to write commit data into installation tree ''' def run(self): + # loose as `.dev` is suppose to be invalid + print("check version number") + loose_pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d*)?$') + import IPython.core.release as r + if not loose_pep440re.match(r.version): + raise ValueError("Version number '%s' is not valid (should match [N!]N(.N)*[{a|b|rc}N][.postN][.devN])" % r.version) + + build_cmd.run(self) # this one will only fire for build commands if hasattr(self, 'build_lib'):