Skip to content

Commit ef51f4e

Browse files
authored
Updates for python 3.9 for v7.x (#417)
* Set version to v7.4.2 * Update setup.py for python 3.9 * Extend blis range to <0.8.0 * Add python 3.9 classifier * Update requirements.txt * Extend blis to <0.8.0 * Raise lower hypothesis pin * Add python 3.9 to CI * Update CI settings * Add --prefer-binary to dependencies install * Remove specific python versions * Use generic linux python 3.7 version * Add newer cupy-cuda versions to extras * Update cupy instructions in README Update cupy instructions and include a pip upgrade step.
1 parent f4e9a09 commit ef51f4e

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

README.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,23 @@ dependency is a compiler tool-chain (e.g. `build-essential`) and the Python
173173
development headers (e.g. `python-dev`).
174174

175175
```bash
176+
pip install -U pip setuptools wheel
176177
pip install thinc
177178
```
178179

179180
For GPU support, we're grateful to use the work of Chainer's `cupy` module,
180181
which provides a numpy-compatible interface for GPU arrays. However, installing
181182
Chainer when no GPU is available currently causes an error. We therefore do not
182-
list Chainer as an explicit dependency — so building Thinc for GPU requires some
183-
extra steps:
183+
list `cupy` as an explicit dependency — so `cupy` is installed using an extra
184+
option with the correct CUDA version:
184185

185186
```bash
186-
export CUDA_HOME=/usr/local/cuda-8.0 # Or wherever your CUDA is
187-
export PATH=$PATH:$CUDA_HOME/bin
188-
pip install chainer
189-
python -c "import cupy; assert cupy" # Check it installed
190-
pip install thinc_gpu_ops thinc # Or `thinc[cuda]`
191-
python -c "import thinc_gpu_ops" # Check the GPU ops were built
187+
pip install thinc[cuda102]
192188
```
193189

190+
Alternatively, to install `cupy` from source use `thinc[cuda]` or install
191+
`cupy` directly using its source package with `pip install cupy`.
192+
194193
The rest of this section describes how to build Thinc from source. If you have
195194
[Fabric](http://www.fabfile.org) installed, you can use the shortcut:
196195

azure-pipelines.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
matrix:
1212
Python27Linux:
1313
imageName: 'ubuntu-16.04'
14-
python.version: '2.7.17'
14+
python.version: '2.7'
1515
Python27Mac:
1616
imageName: 'macos-10.15'
1717
python.version: '2.7'
1818
Python35Linux:
1919
imageName: 'ubuntu-16.04'
20-
python.version: '3.5.9'
20+
python.version: '3.5'
2121
Python35Windows:
2222
imageName: 'vs2017-win2016'
2323
python.version: '3.5'
@@ -35,7 +35,7 @@ jobs:
3535
python.version: '3.6'
3636
Python37Linux:
3737
imageName: 'ubuntu-16.04'
38-
python.version: '3.7.6'
38+
python.version: '3.7'
3939
Python37Windows:
4040
imageName: 'vs2017-win2016'
4141
python.version: '3.7'
@@ -51,6 +51,15 @@ jobs:
5151
Python38Mac:
5252
imageName: 'macos-10.15'
5353
python.version: '3.8'
54+
Python39Linux:
55+
imageName: 'ubuntu-16.04'
56+
python.version: '3.9'
57+
Python39Windows:
58+
imageName: 'vs2017-win2016'
59+
python.version: '3.9'
60+
Python39Mac:
61+
imageName: 'macos-10.15'
62+
python.version: '3.9'
5463
maxParallel: 4
5564
pool:
5665
vmImage: $(imageName)
@@ -63,7 +72,7 @@ jobs:
6372

6473
- script: |
6574
python -m pip install --upgrade pip
66-
pip install -r requirements.txt
75+
pip install -r requirements.txt --prefer-binary
6776
displayName: 'Install dependencies'
6877
6978
- script: pip install -e .

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
murmurhash>=0.28.0,<1.1.0
33
cymem>=2.0.2,<2.1.0
44
preshed>=1.0.1,<3.1.0
5-
blis>=0.4.0,<0.5.0
5+
blis>=0.4.0,<0.8.0
66
srsly>=0.0.6,<1.1.0
77
wasabi>=0.0.9,<1.1.0
88
catalogue>=0.0.7,<1.1.0
@@ -13,7 +13,7 @@ tqdm>=4.10.0,<5.0.0
1313
pathlib==1.0.1; python_version < "3.4"
1414
# Development dependencies
1515
cython>=0.25.0
16-
hypothesis>=2.0.0,<5.0.0
16+
hypothesis>=4.0.0,<5.0.0
1717
pytest
1818
mock>=2.0.0,<3.0.0
1919
flake8>=3.5.0,<3.6.0

setup.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def setup_package():
218218
"murmurhash>=0.28.0,<1.1.0",
219219
"cymem>=2.0.2,<2.1.0",
220220
"preshed>=1.0.1,<3.1.0",
221-
"blis>=0.4.0,<0.5.0",
221+
"blis>=0.4.0,<0.8.0",
222222
"wasabi>=0.0.9,<1.1.0",
223223
"srsly>=0.0.6,<1.1.0",
224224
"catalogue>=0.0.7,<1.1.0",
@@ -236,6 +236,8 @@ def setup_package():
236236
"cuda92": ["cupy-cuda92>=5.0.0b4,<8.0.0"],
237237
"cuda100": ["cupy-cuda100>=5.0.0b4,<8.0.0"],
238238
"cuda101": ["cupy-cuda101>=5.0.0b4,<8.0.0"],
239+
"cuda102": ["cupy-cuda102>=5.0.0b4,<8.0.0"],
240+
"cuda110": ["cupy-cuda110>=5.0.0b4,<8.0.0"],
239241
},
240242
classifiers=[
241243
"Development Status :: 5 - Production/Stable",
@@ -255,6 +257,7 @@ def setup_package():
255257
"Programming Language :: Python :: 3.6",
256258
"Programming Language :: Python :: 3.7",
257259
"Programming Language :: Python :: 3.8",
260+
"Programming Language :: Python :: 3.9",
258261
"Topic :: Scientific/Engineering",
259262
],
260263
cmdclass={"build_ext": build_ext_subclass},

thinc/about.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
55

66
__name__ = "thinc"
7-
__version__ = "7.4.1"
7+
__version__ = "7.4.2"
88
__summary__ = "Practical Machine Learning for NLP"
99
__uri__ = "https://github.com/explosion/thinc"
1010
__author__ = "Matthew Honnibal"

0 commit comments

Comments
 (0)