From df4bfcdc5c4ff5ddce4ce87feb4fff6405cc4608 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sat, 21 Dec 2019 12:59:48 +0900 Subject: [PATCH 1/9] move install_wheels script --- .travis.yml | 2 +- appveyor.yml | 2 +- {ci => continuous_integration}/install_wheels.py | 0 tox.ini | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename {ci => continuous_integration}/install_wheels.py (100%) diff --git a/.travis.yml b/.travis.yml index 946a192856..b68b1fa7ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,5 +33,5 @@ matrix: install: - pip install tox - - python ci/install_wheels.py + - python continuous_integration/install_wheels.py script: tox -vv diff --git a/appveyor.yml b/appveyor.yml index 8e1508321a..67acd344fa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,7 +56,7 @@ install: - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "python ci/install_wheels.py" + - "python continuous_integration/install_wheels.py" build: false diff --git a/ci/install_wheels.py b/continuous_integration/install_wheels.py similarity index 100% rename from ci/install_wheels.py rename to continuous_integration/install_wheels.py diff --git a/tox.ini b/tox.ini index b73ea83de1..0b13ad3c04 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,7 @@ setenv = commands = python --version pip --version - python ci/install_wheels.py + python continuous_integration/install_wheels.py python setup.py build_ext --inplace pytest {posargs:gensim/test} From b049461191452f4db50af9b46ed7bab996f0f5c5 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sat, 21 Dec 2019 13:25:35 +0900 Subject: [PATCH 2/9] git add continuous_integration/check_wheels.py --- continuous_integration/check_wheels.py | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 continuous_integration/check_wheels.py diff --git a/continuous_integration/check_wheels.py b/continuous_integration/check_wheels.py new file mode 100644 index 0000000000..7e2463f0c4 --- /dev/null +++ b/continuous_integration/check_wheels.py @@ -0,0 +1,33 @@ +"""Print available wheels for a particular Python package.""" +import re +import sys + +import requests + +def to_int(value): + value = ''.join((x for x in value if x.isdigit())) + try: + return int(value) + except Exception: + return 0 + + +def to_tuple(version): + return tuple(to_int(x) for x in version.split('.')) + + +def main(): + project = sys.argv[1] + json = requests.get('https://pypi.org/pypi/%s/json' % project).json() + for version in sorted(json['releases'], key=to_tuple): + print(version) + wheel_packages = [ + p for p in json['releases'][version] + if p['packagetype'] == 'bdist_wheel' + ] + for p in wheel_packages: + print(' %(python_version)s %(filename)s' % p) + + +if __name__ == '__main__': + main() From 475f6f75d8fb173d41acdc3628354bb280d81796 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sat, 21 Dec 2019 13:43:13 +0900 Subject: [PATCH 3/9] bump versions for numpy and scipy --- continuous_integration/install_wheels.py | 30 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/continuous_integration/install_wheels.py b/continuous_integration/install_wheels.py index 97d5646da6..69369b2fe3 100644 --- a/continuous_integration/install_wheels.py +++ b/continuous_integration/install_wheels.py @@ -6,6 +6,27 @@ We use this when building/testing gensim in a CI environment (Travis, AppVeyor, etc). + +The versions we currently target are: + + - 3.5 (AppVeyor, TravisCI) + - 3.6 (AppVeyor, TravisCI) + - 3.7 (AppVeyor, TravisCI, CircleCI) + +AppVeyor builds are Windows. +CircleCI builds are Linux, and they build documentation only. +TravisCI builds are Linux and MacOS. + +We want to pick numpy and scipy versions that have wheels for the current +Python version and OS. + +You can check whether wheels are available for a particular numpy release here:: + + https://pypi.org/project/numpy/1.17.4/#files + +or by running:: + + python continuous_integration/check_wheels.py numpy """ import subprocess @@ -13,10 +34,11 @@ def main(): - if sys.version_info[:2] == (3, 7): - packages = ['numpy==1.14.5', 'scipy==1.1.0'] - else: - packages = ['numpy==1.11.3', 'scipy==1.0.0'] + # + # We don't support Py2 anymore, so the most recent versions of both + # numpy and scipy have what we need. + # + packages = ['numpy==1.17.4', 'scipy==1.4.1'] command = [sys.executable, '-m', 'pip', 'install'] + packages print('sys.executable: %r' % sys.executable, file=sys.stderr) From 0aaec1f754f2ccb1db3aa80891b6dcf0a4602adf Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sat, 21 Dec 2019 14:29:34 +0900 Subject: [PATCH 4/9] update old requirements.txt --- continuous_integration/appveyor/requirements.txt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/continuous_integration/appveyor/requirements.txt b/continuous_integration/appveyor/requirements.txt index 2938812af1..d477ad3e93 100644 --- a/continuous_integration/appveyor/requirements.txt +++ b/continuous_integration/appveyor/requirements.txt @@ -1,18 +1,9 @@ -# Fetch numpy and scipy wheels from the sklearn rackspace wheelhouse. -# Those wheels were collected from http://www.lfd.uci.edu/~gohlke/pythonlibs/ -# This is a temporary solution. As soon as numpy and scipy provide official -# wheel for windows we ca delete this --find-links line. ---find-links http://28daf2247a33ed269873-7b1aad3fab3cc330e1fd9d109892382a.r6.cf2.rackcdn.com/ - -# fix the versions of numpy to force the use of numpy and scipy to use the whl -# of the rackspace folder instead of trying to install from more recent -# source tarball published on PyPI -numpy==1.11.3 -scipy==0.18.1 +# +# /continuous_integration/install_wheels.py takes care of installing numpy and scipy. +# cython six >= 1.5.0 smart_open >= 1.2.1 nose wheel wheelhouse_uploader - From 0b5c68a2493eb73a6a5a7e1c3849f50f8f5c2a93 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 29 Dec 2019 22:21:21 +0900 Subject: [PATCH 5/9] add file header --- continuous_integration/check_wheels.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/continuous_integration/check_wheels.py b/continuous_integration/check_wheels.py index 7e2463f0c4..38fd845ecd 100644 --- a/continuous_integration/check_wheels.py +++ b/continuous_integration/check_wheels.py @@ -1,3 +1,9 @@ +# +# -*- coding: utf-8 -*- +# +# Copyright (C) 2019 RaRe Technologies s.r.o. +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html +# """Print available wheels for a particular Python package.""" import re import sys From 5009b8a451a95fda63e064af5968490c638edafd Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 29 Dec 2019 22:25:05 +0900 Subject: [PATCH 6/9] get rid of install_wheels.py hack --- appveyor.yml | 2 - .../appveyor/requirements.txt | 3 -- continuous_integration/install_wheels.py | 52 ------------------- tox.ini | 1 - 4 files changed, 58 deletions(-) delete mode 100644 continuous_integration/install_wheels.py diff --git a/appveyor.yml b/appveyor.yml index 67acd344fa..2a95324668 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,8 +56,6 @@ install: - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "python continuous_integration/install_wheels.py" - build: false test_script: diff --git a/continuous_integration/appveyor/requirements.txt b/continuous_integration/appveyor/requirements.txt index d477ad3e93..b422707968 100644 --- a/continuous_integration/appveyor/requirements.txt +++ b/continuous_integration/appveyor/requirements.txt @@ -1,6 +1,3 @@ -# -# /continuous_integration/install_wheels.py takes care of installing numpy and scipy. -# cython six >= 1.5.0 smart_open >= 1.2.1 diff --git a/continuous_integration/install_wheels.py b/continuous_integration/install_wheels.py deleted file mode 100644 index 69369b2fe3..0000000000 --- a/continuous_integration/install_wheels.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Install wheels for numpy and scipy. - -Without wheels, installation requires doing a build, which is too much. -The versions of the packages for which wheels are available depends on -the current Python version. - -We use this when building/testing gensim in a CI environment (Travis, AppVeyor, -etc). - -The versions we currently target are: - - - 3.5 (AppVeyor, TravisCI) - - 3.6 (AppVeyor, TravisCI) - - 3.7 (AppVeyor, TravisCI, CircleCI) - -AppVeyor builds are Windows. -CircleCI builds are Linux, and they build documentation only. -TravisCI builds are Linux and MacOS. - -We want to pick numpy and scipy versions that have wheels for the current -Python version and OS. - -You can check whether wheels are available for a particular numpy release here:: - - https://pypi.org/project/numpy/1.17.4/#files - -or by running:: - - python continuous_integration/check_wheels.py numpy -""" - -import subprocess -import sys - - -def main(): - # - # We don't support Py2 anymore, so the most recent versions of both - # numpy and scipy have what we need. - # - packages = ['numpy==1.17.4', 'scipy==1.4.1'] - command = [sys.executable, '-m', 'pip', 'install'] + packages - - print('sys.executable: %r' % sys.executable, file=sys.stderr) - print('sys.version_info: %r' % list(sys.version_info), file=sys.stderr) - print('command: %r' % command, file=sys.stderr) - - subprocess.check_call(command) - - -if __name__ == '__main__': - main() diff --git a/tox.ini b/tox.ini index 0b13ad3c04..0ad3749097 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,6 @@ setenv = commands = python --version pip --version - python continuous_integration/install_wheels.py python setup.py build_ext --inplace pytest {posargs:gensim/test} From f5cccee8774e610406cdb5092d8337acc9a4c919 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 29 Dec 2019 22:29:18 +0900 Subject: [PATCH 7/9] fixup: update travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b68b1fa7ae..954ca04d4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,5 +33,5 @@ matrix: install: - pip install tox - - python continuous_integration/install_wheels.py + script: tox -vv From c06e8c610bfb511ef5ae486382db5674a22421b2 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Wed, 1 Jan 2020 19:09:30 +0900 Subject: [PATCH 8/9] Update continuous_integration/check_wheels.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Radim Řehůřek --- continuous_integration/check_wheels.py | 1 - 1 file changed, 1 deletion(-) diff --git a/continuous_integration/check_wheels.py b/continuous_integration/check_wheels.py index 38fd845ecd..305df4e279 100644 --- a/continuous_integration/check_wheels.py +++ b/continuous_integration/check_wheels.py @@ -3,7 +3,6 @@ # # Copyright (C) 2019 RaRe Technologies s.r.o. # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html -# """Print available wheels for a particular Python package.""" import re import sys From 9ca13c013c85de2d638aa331ad09ce540ad0b5f8 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Wed, 1 Jan 2020 19:09:43 +0900 Subject: [PATCH 9/9] Update continuous_integration/check_wheels.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Radim Řehůřek --- continuous_integration/check_wheels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/check_wheels.py b/continuous_integration/check_wheels.py index 305df4e279..e66d5d69f3 100644 --- a/continuous_integration/check_wheels.py +++ b/continuous_integration/check_wheels.py @@ -1,4 +1,4 @@ -# +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2019 RaRe Technologies s.r.o.