diff --git a/.travis.yml b/.travis.yml index d0033b1..7776d62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,12 @@ matrix: - os: osx language: generic env: - - PYTHON_VERSION=3.7.8 + - PYTHON_VERSION=3.7.9 - os: osx language: generic env: - - PYTHON_VERSION=2.7.15 + - PYTHON_VERSION=2.7.18 - os: linux arch: arm64-graviton2 @@ -27,34 +27,33 @@ matrix: env: - PYTHON_VERSION=3.8.5 -before_cache: - # Cleanup to avoid the cache to grow indefinitely as new package versions are released - # see https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci - - brew cleanup - cache: directories: - # Cache downloaded bottles - - $HOME/Library/Caches/Homebrew - # pyenv - - $HOME/.pyenv_cache - - $HOME/.pyenv/versions/3.7.8 - - $HOME/.pyenv/versions/2.7.15 # scikit-ci-addons - $HOME/downloads before_install: - | - # Workaround the following error occuring because python installation is cached but gettext dependency is not - # dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib - # Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python - # Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0 - if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then - brew install gettext + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + # Install official python distribution + curl -fsSLo /tmp/Python.pkg "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg" + sudo installer -pkg /tmp/Python.pkg -target / + PYTHON_VERSION2=${PYTHON_VERSION%.*} + PYTHON_VERSION1=${PYTHON_VERSION2%.*} + python_executable=/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1} + # Install SSL certificates + curl -fsSLo /tmp/install_certifi.py https://github.com/joerick/cibuildwheel/raw/v1.10.0/cibuildwheel/resources/install_certifi.py + sudo ${python_executable} /tmp/install_certifi.py + ${python_executable} scripts/ssl-check.py + # Install packages + ${python_executable} -m pip install --disable-pip-version-check --upgrade pip + ${python_executable} -m pip install virtualenv + # Create and activate virtual environment + ${python_executable} -m virtualenv ${HOME}/.pyenv/versions/${PYTHON_VERSION} + source ${HOME}/.pyenv/versions/${PYTHON_VERSION}/bin/activate fi - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python; python -m pip install --disable-pip-version-check --upgrade pip pip install -U scikit-ci scikit-ci-addons ci_addons --install ../addons diff --git a/pyproject.toml b/pyproject.toml index f130777..4f974fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "scikit-build"] +requires = ["setuptools>=42", "wheel", "scikit-build", "cmake"] +build-backend = "setuptools.build_meta" diff --git a/requirements-dev.txt b/requirements-dev.txt index fa1c5ad..f192dbf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,3 +11,8 @@ twine virtualenv>=15.0.3 wheel>=0.34 wheeltools + +# need to pin cryptography for manylinux1 builds +# cryptography only provides manylinux2010 wheels since 3.4.0 +# because of the lack of a decent rust compiler on manylinux1 +cryptography~=3.3.2 ; sys_platform=="linux" and platform_machine in "i386, i486, i586, i686, x86_64" diff --git a/scikit-ci.yml b/scikit-ci.yml index b640311..bc21737 100644 --- a/scikit-ci.yml +++ b/scikit-ci.yml @@ -19,8 +19,6 @@ before_install: environment: PATH: $/.pyenv/versions/$/bin:$ SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64 - commands: - - python ../addons/travis/install_pyenv.py install: commands: diff --git a/setup.py b/setup.py index 9765214..4a5d711 100755 --- a/setup.py +++ b/setup.py @@ -1,11 +1,17 @@ #!/usr/bin/env python +import os import sys -import versioneer from distutils.text_file import TextFile from skbuild import setup +# Add current folder to path +# This is required to import versioneer in an isolated pip build +sys.path.append(os.path.dirname(os.path.abspath(__file__))) + +import versioneer # noqa: E402 + with open('README.rst', 'r') as fp: readme = fp.read() diff --git a/versioneer.py b/versioneer.py index f250cde..1e28dbf 100644 --- a/versioneer.py +++ b/versioneer.py @@ -1283,7 +1283,22 @@ def render_pep440_post(pieces): if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] + if ".post" in rendered: + # update the existing post tag + start = rendered.index(".post") + 5 + if len(rendered) == start: + rendered += "%d" % pieces["distance"] + else: + end = start + 1 + while end <= len(rendered) and rendered[start:end].isdigit(): + end += 1 + end -= 1 + distance = pieces["distance"] + if start != end: + distance += int(rendered[start:end]) + rendered = rendered[:start] + "%d" % distance + rendered[end:] + else: + rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += plus_or_dot(pieces)