From a0267fadedc77b83f8c64517c89fbb5516655e24 Mon Sep 17 00:00:00 2001 From: Gordon Mohr Date: Fri, 27 Dec 2019 14:15:22 -0800 Subject: [PATCH] rm py3.5, add py3.8, rm/update older explicit pins/installs --- .travis.yml | 14 +++++---- appveyor.yml | 31 ++++++++++--------- .../appveyor/requirements.txt | 18 ----------- gensim/corpora/sharded_corpus.py | 6 ++-- gensim/models/hdpmodel.py | 4 +-- setup.py | 2 +- tox.ini | 5 ++- 7 files changed, 33 insertions(+), 47 deletions(-) delete mode 100644 continuous_integration/appveyor/requirements.txt diff --git a/.travis.yml b/.travis.yml index 946a192856..d5d628ecbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,10 @@ matrix: - python: '3.6' env: TOXENV="flake8,flake8-docs" - - python: '3.5' - env: TOXENV="py35-linux" - - - python: '3.6' - env: TOXENV="py36-linux" + - python: '3.8' + env: + - TOXENV="py38-linux" + dist: bionic - python: '3.7' env: @@ -29,9 +28,12 @@ matrix: - BOTO_CONFIG="/dev/null" dist: xenial sudo: true + + - python: '3.6' + env: TOXENV="py36-linux" install: - pip install tox - - python ci/install_wheels.py + script: tox -vv diff --git a/appveyor.yml b/appveyor.yml index 8e1508321a..fdf2a768b7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,20 +14,20 @@ environment: TOX_PARALLEL_NO_SPINNER: 1 matrix: - - PYTHON: "C:\\Python35-x64" - PYTHON_VERSION: "3.5.2" + - PYTHON: "C:\\Python38-x64" + PYTHON_VERSION: "3.8.1" PYTHON_ARCH: "64" - TOXENV: "py35-win" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.0" - PYTHON_ARCH: "64" - TOXENV: "py36-win" - + TOXENV: "py38-win" + - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.0" + PYTHON_VERSION: "3.7.6" PYTHON_ARCH: "64" TOXENV: "py37-win" + + - PYTHON: "C:\\Python36-x64" + PYTHON_VERSION: "3.6.10" + PYTHON_ARCH: "64" + TOXENV: "py36-win" init: - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" @@ -50,14 +50,17 @@ install: - "powershell ./continuous_integration/appveyor/install.ps1" - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - "python -m pip install -U pip tox" - - "pip --version" - # Check that we have the expected version and architecture for Python + # next line only to demo that py3.8-on-Appveyor *could* install Cython from wheel just fine, + # despite mysterious following attempt/failure to build-and-use Cython on that one Appveyor config + # delete when py3.8-on-Appveyor starts working normally + - "python -m pip install -v -U Cython==0.29.14" + + # Check that we have the expected versions and architecture + - "pip --version" - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "python ci/install_wheels.py" - build: false test_script: diff --git a/continuous_integration/appveyor/requirements.txt b/continuous_integration/appveyor/requirements.txt deleted file mode 100644 index 2938812af1..0000000000 --- a/continuous_integration/appveyor/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -# 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 -cython -six >= 1.5.0 -smart_open >= 1.2.1 -nose -wheel -wheelhouse_uploader - diff --git a/gensim/corpora/sharded_corpus.py b/gensim/corpora/sharded_corpus.py index 754cc7bbf4..6f90b715cf 100644 --- a/gensim/corpora/sharded_corpus.py +++ b/gensim/corpora/sharded_corpus.py @@ -280,12 +280,12 @@ def init_shards(self, output_prefix, corpus, shardsize=4096, dtype=_default_dtyp self.dim = proposed_dim self.offsets = [0] - start_time = time.clock() + start_time = time.perf_counter() logger.info('Running init from corpus.') for n, doc_chunk in enumerate(gensim.utils.grouper(corpus, chunksize=shardsize)): - logger.info('Chunk no. %d at %f s', n, time.clock() - start_time) + logger.info('Chunk no. %d at %f s', n, time.perf_counter() - start_time) current_shard = numpy.zeros((len(doc_chunk), self.dim), dtype=dtype) logger.debug('Current chunk dimension: %d x %d', len(doc_chunk), self.dim) @@ -300,7 +300,7 @@ def init_shards(self, output_prefix, corpus, shardsize=4096, dtype=_default_dtyp self.save_shard(current_shard) - end_time = time.clock() + end_time = time.perf_counter() logger.info('Built %d shards in %f s.', self.n_shards, end_time - start_time) def init_by_clone(self): diff --git a/gensim/models/hdpmodel.py b/gensim/models/hdpmodel.py index e0ce5de3a5..3682f94b39 100755 --- a/gensim/models/hdpmodel.py +++ b/gensim/models/hdpmodel.py @@ -464,7 +464,7 @@ def update(self, corpus): """ save_freq = max(1, int(10000 / self.chunksize)) # save every 10k docs, roughly chunks_processed = 0 - start_time = time.clock() + start_time = time.perf_counter() while True: for chunk in utils.grouper(corpus, self.chunksize): @@ -513,7 +513,7 @@ def update_finished(self, start_time, chunks_processed, docs_processed): (self.max_chunks and chunks_processed == self.max_chunks) # time limit reached - or (self.max_time and time.clock() - start_time > self.max_time) + or (self.max_time and time.perf_counter() - start_time > self.max_time) # no limits and whole corpus has been processed once or (not self.max_chunks and not self.max_time and docs_processed >= self.m_D)) diff --git a/setup.py b/setup.py index 4625790e56..5422a32ad9 100644 --- a/setup.py +++ b/setup.py @@ -321,7 +321,7 @@ def run(self): # to build with any sane version of Cython, so we should update this pin # periodically. # -CYTHON_STR = 'Cython==0.29.3' +CYTHON_STR = 'Cython==0.29.14' install_requires = [ NUMPY_STR, diff --git a/tox.ini b/tox.ini index b73ea83de1..12c8aa692b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = {py35,py36,py37}-{win,linux}, flake8, docs, docs-upload, download-wheels, upload-wheels, test-pypi +envlist = {py36,py37,py38}-{win,linux}, flake8, docs, docs-upload, download-wheels, upload-wheels, test-pypi skipsdist = True platform = linux: linux win: win64 @@ -43,7 +43,6 @@ setenv = commands = python --version pip --version - python ci/install_wheels.py python setup.py build_ext --inplace pytest {posargs:gensim/test} @@ -65,7 +64,7 @@ commands = flake8-rst gensim/ docs/ {posargs} basepython = python3 recreate = True -deps = numpy==1.14.5 +deps = numpy commands = python setup.py build_ext --inplace