Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Fix building wheels on OSX #21

Merged
merged 25 commits into from
Apr 16, 2020
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
149 changes: 77 additions & 72 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
env:
global:
- REPO_DIR=gensim
- BUILD_COMMIT=3.8.2
- BUILD_COMMIT=a2ec4c3417717f65c6d7eae5c1fcdc6db8a54159
- UNICODE_WIDTH=32
- GLOBAL_DEPENDS="six smart_open"
- TEST_COMMON="pytest pytest-rerunfailures mock cython testfixtures scikit-learn"
- TEST_COMMON="pytest pytest-rerunfailures mock cython testfixtures python-Levenshtein>=0.10.2 Morfessor==2.0.2a4"
- BUILD_DEPENDS="numpy==1.11.3 scipy==1.0.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="${BUILD_DEPENDS} ${TEST_COMMON}"
- MACOSX_DEPLOYMENT_TARGET=10.7
- TEST_DEPENDS="${BUILD_DEPENDS} ${TEST_COMMON} scikit-learn"
- MACOSX_DEPLOYMENT_TARGET=10.9

language: python
# The travis Python version is unrelated to the version we build and test
# with. This is set with the MB_PYTHON_VERSION variable.
python: 3.5
sudo: required
os: linux
dist: trusty
services: docker

matrix:
include:

# Linux
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=x86_64
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=i686
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=x86_64

- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON}"
- MB_PYTHON_VERSION=3.7
- PLAT=x86_64
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON}"
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- SKIP_NETWORK_TESTS=1

# MacOS
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.5
- SKIP_NETWORK_TESTS=1

- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.6
- SKIP_NETWORK_TESTS=1

- os: osx
language: generic
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON}"
- MB_PYTHON_VERSION=3.7
- SKIP_NETWORK_TESTS=1
jobs:
# Linux
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=x86_64
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=i686
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=x86_64

- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON} scikit-learn"
- MB_PYTHON_VERSION=3.7
- PLAT=x86_64
- SKIP_NETWORK_TESTS=1

- os: linux
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON} scikit-learn"
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- SKIP_NETWORK_TESTS=1

# MacOS
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.5
- SKIP_NETWORK_TESTS=1

- os: osx
language: generic
osx_image: xcode10.1
env:
- MB_PYTHON_VERSION=3.6
- SKIP_NETWORK_TESTS=1
# Attempt to fix 'incompatibility' between sklearn & our base numpy (by pinning sklearn to older version)
- TEST_DEPENDS="${BUILD_DEPENDS} ${TEST_COMMON} scikit-learn==0.21.3"

- os: osx
language: generic
env:
- BUILD_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS}"
- TEST_DEPENDS="numpy==1.14.5 scipy==1.1.0 ${GLOBAL_DEPENDS} ${TEST_COMMON} scikit-learn"
- MB_PYTHON_VERSION=3.7
- SKIP_NETWORK_TESTS=1


before_install:
Expand All @@ -94,15 +95,19 @@ install:
script:
- install_run $PLAT


# Upload wheels at the end of process (no matters, success or fail)
after_success:
- ls -laht ${TRAVIS_BUILD_DIR}/wheelhouse/
- pip install wheelhouse-uploader
- echo ${TRAVIS_BUILD_DIR}/wheelhouse/
- python -m wheelhouse_uploader upload --local-folder ${TRAVIS_BUILD_DIR}/wheelhouse/ --no-ssl-check gensim-wheels --provider S3

after_failure:
- ls -laht ${TRAVIS_BUILD_DIR}/wheelhouse/
# This uploads the wheels to a Rackspace container owned by the
# scikit-learn team, available at http://wheels.scipy.org. See above
# for information on using this account or choosing another.
- pip install wheelhouse-uploader
- python -m wheelhouse_uploader upload --local-folder ${TRAVIS_BUILD_DIR}/wheelhouse/ --no-ssl-check gensim-wheels --provider S3


notifications:
email:
- penkov+gensimwheels@pm.me
Expand Down
44 changes: 13 additions & 31 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
environment:
global:
BUILD_COMMIT: 3.8.2
BUILD_COMMIT: a2ec4c3417717f65c6d7eae5c1fcdc6db8a54159
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
Expand Down Expand Up @@ -66,37 +66,19 @@ install:

build: false


test_script:
# Upload the generated wheel package to Rackspace
#
# We do this _before_ we run tests to prevent test failures from blocking a
# release. This is a good idea because at this stage, because we have
# already done sufficient testing prior to making the release. Furthermore,
# failures at this point may be caused by AppVeyor weirdness like running out
# of memory. Finally, even if the failures are caused by a bug in the new
# release, we've already committed to making the release, and it's too late
# to turn back. Even if the release is broken, we're better off building
# wheels for it and dealing with the problem in a subsequent bugfix release.
#
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
# disable the ssl checks.
- "cd dist"
- "ls"
- "python -m wheelhouse_uploader upload --no-ssl-check --local-folder=. gensim-wheels --provider S3"
# Change to a non-source folder to make sure we run the tests on the
# installed library.
# - "cd .."
# - "mkdir empty_folder"
# - "cd empty_folder"
# - "SET PYTHONHASHSEED=1"
# - "pytest -rfxEXs --durations=20 --disable-warnings --showlocals --reruns 3 --reruns-delay 1 --pyargs gensim"


artifacts:
# Archive the generated wheel package in the ci.appveyor.com build report.
- path: "gensim\\dist\\*"

- "cd .."
- "mkdir empty_folder"
- "cd empty_folder"
- "SET PYTHONHASHSEED=1"
- "python -c \"from gensim.models.word2vec import FAST_VERSION as FV_W2V; from gensim.models.fasttext import FAST_VERSION as FV_FT; print('FAST_VERSION (word2vec): {}, FAST_VERSION (fasttext): {}'.format(FV_W2V, FV_FT)); assert FV_W2V >= 0, FV_W2V; assert FV_FT >= 0, FV_FT\""
- "pytest -rfxEXs --durations=20 --disable-warnings --showlocals --reruns 3 --reruns-delay 1 --pyargs gensim"


# Upload wheels at the end of process (no matters, success or fail)
on_finish:
- "ls -laht ../gensim/dist/"
- "python -m wheelhouse_uploader upload --no-ssl-check --local-folder=../gensim/dist/ gensim-wheels --provider S3"

notifications:
- provider: Email
Expand Down
12 changes: 10 additions & 2 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ function run_tests {
fi

if [[ "$IS_OSX" -eq 0 ]]; then
pip install annoy python-Levenshtein>=0.10.2 Morfessor==2.0.2a4
pip install annoy
fi

python -c 'import gensim; print(gensim.__file__, gensim.models.word2vec.FAST_VERSION)'
python -c \
"""
from gensim.models.word2vec import FAST_VERSION as FV_W2V
from gensim.models.fasttext import FAST_VERSION as FV_FT
print('FAST_VERSION (word2vec): {}, FAST_VERSION (fasttext): {}'.format(FV_W2V, FV_FT))

assert FV_W2V >= 0, FV_W2V
assert FV_FT >= 0, FV_FT
"""
pip freeze
pytest -rfxEXs --durations=20 --disable-warnings --showlocals --reruns 3 --reruns-delay 1 --pyargs gensim
}
2 changes: 1 addition & 1 deletion gensim
Submodule gensim updated 282 files