Skip to content

Commit

Permalink
Updates for python 3.9 for v7.x (#417)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
adrianeboyd authored Nov 4, 2020
1 parent f4e9a09 commit ef51f4e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,23 @@ dependency is a compiler tool-chain (e.g. `build-essential`) and the Python
development headers (e.g. `python-dev`).

```bash
pip install -U pip setuptools wheel
pip install thinc
```

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

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

Alternatively, to install `cupy` from source use `thinc[cuda]` or install
`cupy` directly using its source package with `pip install cupy`.

The rest of this section describes how to build Thinc from source. If you have
[Fabric](http://www.fabfile.org) installed, you can use the shortcut:

Expand Down
17 changes: 13 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
matrix:
Python27Linux:
imageName: 'ubuntu-16.04'
python.version: '2.7.17'
python.version: '2.7'
Python27Mac:
imageName: 'macos-10.15'
python.version: '2.7'
Python35Linux:
imageName: 'ubuntu-16.04'
python.version: '3.5.9'
python.version: '3.5'
Python35Windows:
imageName: 'vs2017-win2016'
python.version: '3.5'
Expand All @@ -35,7 +35,7 @@ jobs:
python.version: '3.6'
Python37Linux:
imageName: 'ubuntu-16.04'
python.version: '3.7.6'
python.version: '3.7'
Python37Windows:
imageName: 'vs2017-win2016'
python.version: '3.7'
Expand All @@ -51,6 +51,15 @@ jobs:
Python38Mac:
imageName: 'macos-10.15'
python.version: '3.8'
Python39Linux:
imageName: 'ubuntu-16.04'
python.version: '3.9'
Python39Windows:
imageName: 'vs2017-win2016'
python.version: '3.9'
Python39Mac:
imageName: 'macos-10.15'
python.version: '3.9'
maxParallel: 4
pool:
vmImage: $(imageName)
Expand All @@ -63,7 +72,7 @@ jobs:

- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements.txt --prefer-binary
displayName: 'Install dependencies'
- script: pip install -e .
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
murmurhash>=0.28.0,<1.1.0
cymem>=2.0.2,<2.1.0
preshed>=1.0.1,<3.1.0
blis>=0.4.0,<0.5.0
blis>=0.4.0,<0.8.0
srsly>=0.0.6,<1.1.0
wasabi>=0.0.9,<1.1.0
catalogue>=0.0.7,<1.1.0
Expand All @@ -13,7 +13,7 @@ tqdm>=4.10.0,<5.0.0
pathlib==1.0.1; python_version < "3.4"
# Development dependencies
cython>=0.25.0
hypothesis>=2.0.0,<5.0.0
hypothesis>=4.0.0,<5.0.0
pytest
mock>=2.0.0,<3.0.0
flake8>=3.5.0,<3.6.0
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def setup_package():
"murmurhash>=0.28.0,<1.1.0",
"cymem>=2.0.2,<2.1.0",
"preshed>=1.0.1,<3.1.0",
"blis>=0.4.0,<0.5.0",
"blis>=0.4.0,<0.8.0",
"wasabi>=0.0.9,<1.1.0",
"srsly>=0.0.6,<1.1.0",
"catalogue>=0.0.7,<1.1.0",
Expand All @@ -236,6 +236,8 @@ def setup_package():
"cuda92": ["cupy-cuda92>=5.0.0b4,<8.0.0"],
"cuda100": ["cupy-cuda100>=5.0.0b4,<8.0.0"],
"cuda101": ["cupy-cuda101>=5.0.0b4,<8.0.0"],
"cuda102": ["cupy-cuda102>=5.0.0b4,<8.0.0"],
"cuda110": ["cupy-cuda110>=5.0.0b4,<8.0.0"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand All @@ -255,6 +257,7 @@ def setup_package():
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
],
cmdclass={"build_ext": build_ext_subclass},
Expand Down
2 changes: 1 addition & 1 deletion thinc/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py

__name__ = "thinc"
__version__ = "7.4.1"
__version__ = "7.4.2"
__summary__ = "Practical Machine Learning for NLP"
__uri__ = "https://github.com/explosion/thinc"
__author__ = "Matthew Honnibal"
Expand Down

0 comments on commit ef51f4e

Please sign in to comment.