Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix builds #43

Merged
merged 4 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "scikit-build"]
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake"]
build-backend = "setuptools.build_meta"
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 0 additions & 2 deletions scikit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ before_install:
environment:
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
commands:
- python ../addons/travis/install_pyenv.py

install:
commands:
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
17 changes: 16 additions & 1 deletion versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down