From 4299a7f654cc96f266f140cfd33037a59fc51a15 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 23 Oct 2020 11:27:54 +0200 Subject: [PATCH 1/6] Setup / install / quickstart updates * Add `cuda110` to setup.cfg and quickstart dropdown * Switch to `pip` for pip-only packages in conda quickstart instructions * Update zh pkuseg install message with version range and conda * Remove `zh` from `extras_require` because the default doesn't require additional packages --- setup.cfg | 4 ++-- spacy/lang/zh/__init__.py | 2 +- website/src/widgets/quickstart-install.js | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index e42bb9c57..cc48e576b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -87,6 +87,8 @@ cuda101 = cupy-cuda101>=5.0.0b4,<9.0.0 cuda102 = cupy-cuda102>=5.0.0b4,<9.0.0 +cuda110 = + cupy-cuda110>=5.0.0b4,<9.0.0 # Language tokenizers with external dependencies ja = sudachipy>=0.4.9 @@ -95,8 +97,6 @@ ko = natto-py==0.9.0 th = pythainlp>=2.0 -zh = - spacy-pkuseg==0.0.26 [bdist_wheel] universal = false diff --git a/spacy/lang/zh/__init__.py b/spacy/lang/zh/__init__.py index 30560ed0d..9a8a21a63 100644 --- a/spacy/lang/zh/__init__.py +++ b/spacy/lang/zh/__init__.py @@ -17,7 +17,7 @@ from ... import util # fmt: off -_PKUSEG_INSTALL_MSG = "install spacy-pkuseg with `pip install spacy-pkuseg==0.0.26`" +_PKUSEG_INSTALL_MSG = "install spacy-pkuseg with `pip install \"spacy-pkuseg>=0.0.27,<0.1.0\"` or `conda install -c conda-forge \"spacy-pkuseg>=0.0.27,<0.1.0\"`" # fmt: on DEFAULT_CONFIG = """ diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index 37ae10da4..4e63ec0bd 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -7,7 +7,7 @@ import { repo } from '../components/util' const DEFAULT_MODELS = ['en'] const DEFAULT_OPT = 'efficiency' const DEFAULT_HARDWARE = 'cpu' -const DEFAULT_CUDA = 'cuda100' +const DEFAULT_CUDA = 'cuda102' const CUDA = { '8.0': 'cuda80', '9.0': 'cuda90', @@ -16,6 +16,7 @@ const CUDA = { '10.0': 'cuda100', '10.1': 'cuda101', '10.2': 'cuda102', + '11.0': 'cuda110', } const LANG_EXTRAS = ['zh', 'ja'] // only for languages with models const DATA = [ @@ -184,11 +185,14 @@ const QuickstartInstall = ({ id, title }) => { pip install -e '.[{pipExtras}]' )} + + # packages only available via pip + - conda install -c conda-forge spacy-transformers + pip install spacy-transformers - conda install -c conda-forge spacy-lookups-data + pip install spacy-lookups-data {models.map(({ code, models: modelOptions }) => { From 8fe7ede6679dffeb581650ddc4617d0e63d1a532 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 23 Oct 2020 11:34:43 +0200 Subject: [PATCH 2/6] Add install step to source install quickstart --- website/src/widgets/quickstart-install.js | 1 + 1 file changed, 1 insertion(+) diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index 4e63ec0bd..0ec9d2eb7 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -181,6 +181,7 @@ const QuickstartInstall = ({ id, title }) => { pip install -r requirements.txt python setup.py build_ext --inplace + python setup.py install {(train || hardware == 'gpu') && ( pip install -e '.[{pipExtras}]' )} From c0b76f4c19ea8e5d50ac327874a34155b91d129f Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 23 Oct 2020 11:36:36 +0200 Subject: [PATCH 3/6] Add install step to "Compile from source" --- website/docs/usage/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/usage/index.md b/website/docs/usage/index.md index ccb59e937..8d40ee61e 100644 --- a/website/docs/usage/index.md +++ b/website/docs/usage/index.md @@ -174,6 +174,7 @@ $ source .env/bin/activate # activate virtual env $ export PYTHONPATH=`pwd` # set Python path to spaCy dir $ pip install -r requirements.txt # install all requirements $ python setup.py build_ext --inplace # compile spaCy +$ python setup.py install # install spaCy ``` Compared to regular install via pip, the From af26886fffb4d7da8c8606e58dad0acb956d48b5 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 23 Oct 2020 11:38:14 +0200 Subject: [PATCH 4/6] Fix formatting --- website/src/widgets/quickstart-install.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index 0ec9d2eb7..fd0b2d632 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -187,8 +187,8 @@ const QuickstartInstall = ({ id, title }) => { )} - # packages only available via pip - + # packages only available via pip + pip install spacy-transformers From 253480353c43152a05ab36d7629c269bf58ebf2c Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 23 Oct 2020 11:39:25 +0200 Subject: [PATCH 5/6] Remove zh from quickstart extras --- website/src/widgets/quickstart-install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index fd0b2d632..7e3bed136 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -18,7 +18,7 @@ const CUDA = { '10.2': 'cuda102', '11.0': 'cuda110', } -const LANG_EXTRAS = ['zh', 'ja'] // only for languages with models +const LANG_EXTRAS = ['ja'] // only for languages with models const DATA = [ { id: 'os', From 448bfbdc30a29225547562e3f222c08565b50021 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 10 Nov 2020 09:44:52 +0800 Subject: [PATCH 6/6] Remove conda from nightly install widget [ci skip] --- website/src/widgets/quickstart-install.js | 104 +++++++++++----------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index 7e3bed136..df8d971f0 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -19,54 +19,6 @@ const CUDA = { '11.0': 'cuda110', } const LANG_EXTRAS = ['ja'] // only for languages with models -const DATA = [ - { - id: 'os', - title: 'Operating system', - options: [ - { id: 'mac', title: 'macOS / OSX', checked: true }, - { id: 'windows', title: 'Windows' }, - { id: 'linux', title: 'Linux' }, - ], - }, - { - id: 'package', - title: 'Package manager', - options: [ - { id: 'pip', title: 'pip', checked: true }, - { id: 'conda', title: 'conda' }, - { id: 'source', title: 'from source' }, - ], - }, - { - id: 'hardware', - title: 'Hardware', - options: [ - { id: 'cpu', title: 'CPU', checked: DEFAULT_HARDWARE === 'cpu' }, - { id: 'gpu', title: 'GPU', checked: DEFAULT_HARDWARE == 'gpu' }, - ], - dropdown: Object.keys(CUDA).map(id => ({ id: CUDA[id], title: `CUDA ${id}` })), - defaultValue: DEFAULT_CUDA, - }, - { - id: 'config', - title: 'Configuration', - multiple: true, - options: [ - { - id: 'venv', - title: 'virtual env', - help: 'Use a virtual environment and install spaCy into a user directory', - }, - { - id: 'train', - title: 'train models', - help: - 'Check this if you plan to train your own models with spaCy to install extra dependencies and data resources', - }, - ], - }, -] const QuickstartInstall = ({ id, title }) => { const [train, setTrain] = useState(false) @@ -100,7 +52,56 @@ const QuickstartInstall = ({ id, title }) => { const pkg = nightly ? 'spacy-nightly' : 'spacy' const models = languages.filter(({ models }) => models !== null) const data = [ - ...DATA, + { + id: 'os', + title: 'Operating system', + options: [ + { id: 'mac', title: 'macOS / OSX', checked: true }, + { id: 'windows', title: 'Windows' }, + { id: 'linux', title: 'Linux' }, + ], + }, + { + id: 'package', + title: 'Package manager', + options: [ + { id: 'pip', title: 'pip', checked: true }, + !nightly ? { id: 'conda', title: 'conda' } : null, + { id: 'source', title: 'from source' }, + ].filter(o => o), + }, + { + id: 'hardware', + title: 'Hardware', + options: [ + { id: 'cpu', title: 'CPU', checked: DEFAULT_HARDWARE === 'cpu' }, + { id: 'gpu', title: 'GPU', checked: DEFAULT_HARDWARE == 'gpu' }, + ], + dropdown: Object.keys(CUDA).map(id => ({ + id: CUDA[id], + title: `CUDA ${id}`, + })), + defaultValue: DEFAULT_CUDA, + }, + { + id: 'config', + title: 'Configuration', + multiple: true, + options: [ + { + id: 'venv', + title: 'virtual env', + help: + 'Use a virtual environment and install spaCy into a user directory', + }, + { + id: 'train', + title: 'train models', + help: + 'Check this if you plan to train your own models with spaCy to install extra dependencies and data resources', + }, + ], + }, { id: 'models', title: 'Trained pipelines', @@ -142,11 +143,6 @@ const QuickstartInstall = ({ id, title }) => { setters={setters} showDropdown={showDropdown} > - {nightly && ( - - # 🚨 Nightly releases are currently only available via pip - - )} python -m venv .env source .env/bin/activate