spaCy/spacy
Adrien Ball 88909a9adb Fix egg fragments in direct download (#3369)
## Description
The egg fragment in the URL must be of the form `#egg=package_name==version` instead of `#egg=package_name-version`.
One of the consequences of specifying wrong egg fragments is that `pip` does not recognize the package and its version properly, and thus it re-downloads the package systematically.

I'm not sure how this should be tested properly. 
Here is what I had before the fix when running the same direct download twice:
```
$ python -m spacy download en_core_web_sm-2.0.0 --direct
Looking in indexes: https://pypi.python.org/simple/
Collecting en_core_web_sm-2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm-2.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB)
    100% |████████████████████████████████| 37.4MB 1.6MB/s
  Generating metadata for package en-core-web-sm-2.0.0 produced metadata for project name en-core-web-sm. Fix your #egg=en-core-web-sm-2.0.0 fragments.
Installing collected packages: en-core-web-sm
  Running setup.py install for en-core-web-sm ... done
Successfully installed en-core-web-sm-2.0.0
$ python -m spacy download en_core_web_sm-2.0.0 --direct
Looking in indexes: https://pypi.python.org/simple/
Collecting en_core_web_sm-2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm-2.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB)
    100% |████████████████████████████████| 37.4MB 919kB/s
  Generating metadata for package en-core-web-sm-2.0.0 produced metadata for project name en-core-web-sm. Fix your #egg=en-core-web-sm-2.0.0 fragments.
Requirement already satisfied (use --upgrade to upgrade): en-core-web-sm from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm-2.0.0 in ./venv3/lib/python3.6/site-packages
```

And after the fix:
```
$ python -m spacy download en_core_web_sm-2.0.0 --direct
Looking in indexes: https://pypi.python.org/simple/
Collecting en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm==2.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB)
    100% |████████████████████████████████| 37.4MB 1.1MB/s
Installing collected packages: en-core-web-sm
  Running setup.py install for en-core-web-sm ... done
Successfully installed en-core-web-sm-2.0.0
$ python -m spacy download en_core_web_sm-2.0.0 --direct
Looking in indexes: https://pypi.python.org/simple/
Requirement already satisfied: en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm==2.0.0 in ./venv3/lib/python3.6/site-packages (2.0.0)
```

### Types of change
This is an enhancement as it avoids unnecessary downloads of (potentially big) spacy models, when they have already been downloaded.

## Checklist
- [x] I have submitted the spaCy Contributor Agreement.
- [x] I ran the tests, and all new and existing tests passed.
- [x] My changes don't require a change to the documentation, or if they do, I've added all required information.
2019-03-07 21:07:19 +01:00
..
cli Fix egg fragments in direct download (#3369) 2019-03-07 21:07:19 +01:00
data Make spacy/data a package 2017-03-18 20:04:22 +01:00
displacy Don't check for Jupyter in global scope and fix check (#3213) 2019-01-31 23:49:13 +01:00
lang Fixing pymorphy2 dependency issue (#3329) (closes #3327) 2019-02-25 15:48:17 +01:00
syntax Fix out-of-bounds access in NER training 2018-10-27 00:46:30 +02:00
tests Fixing pymorphy2 dependency issue (#3329) (closes #3327) 2019-02-25 15:48:17 +01:00
tokens Don't use numpy directly for similarity (#3362) 2019-03-06 22:58:38 +00:00
__init__.pxd * Seems to be working after refactor. Need to wire up more POS tag features, and wire up save/load of POS tags. 2014-10-24 02:23:42 +11:00
__init__.py Unhack prefer_gpu 2018-10-14 23:27:09 +02:00
__main__.py Don't pass CLI command name as dummy argument 2018-01-04 21:33:47 +01:00
_ml.py 💫 New system for error messages and warnings (#2163) 2018-04-03 15:50:31 +02:00
about.py Set version to v2.0.18 2018-12-01 03:35:09 +01:00
attrs.pxd Fix LANG symbol 2018-02-17 18:10:50 +01:00
attrs.pyx missing PrepCase attribute 2018-02-18 14:46:12 +00:00
compat.py Fix formatting 2018-11-26 13:27:41 +01:00
errors.py Add split one token into several (resolves #2838) (#3253) 2019-02-15 01:27:13 +11:00
glossary.py Add FAC to spacy.explain (resolves #2706) 2018-08-26 14:13:50 +02:00
gold.pxd Add support for sent_start to GoldParse 2017-08-25 20:03:14 -05:00
gold.pyx New Feature: display more detail when Error E067 (#2639) 2018-08-07 10:45:29 +02:00
language.py Allow input text of length up to max_length, inclusive (#2922) 2018-11-13 16:46:29 +01:00
lemmatizer.py If no rules are set, lemmatize by lookup 2017-12-06 12:12:11 +01:00
lexeme.pxd WIP on stringstore change. 27 failures 2017-05-28 14:06:40 +02:00
lexeme.pyx Don't use numpy directly for similarity (#3362) 2019-03-06 22:58:38 +00:00
matcher.pyx Set up dependency tree pattern matching skeleton (#2732) 2018-09-27 13:27:18 +02:00
morphology.pxd fix typo/missing here too 2018-02-18 14:38:27 +00:00
morphology.pyx 💫 New system for error messages and warnings (#2163) 2018-04-03 15:50:31 +02:00
parts_of_speech.pxd Add support for Universal Dependencies v2.0 2017-03-03 13:17:34 +01:00
parts_of_speech.pyx Tidy up rest 2017-10-27 21:07:59 +02:00
pipeline.pxd Fix names of pipeline components 2017-10-26 12:38:23 +02:00
pipeline.pyx Fix loading of models when custom vectors are added 2018-04-10 22:19:20 +02:00
scorer.py 💫 New system for error messages and warnings (#2163) 2018-04-03 15:50:31 +02:00
strings.pxd Try to fix StringStore clean up (see #1506) 2017-11-11 03:11:27 +03:00
strings.pyx 💫 New system for error messages and warnings (#2163) 2018-04-03 15:50:31 +02:00
structs.pxd Make TokenC.sent_tart an int, to allow ternary value 2017-10-08 19:58:54 +02:00
symbols.pxd Fix inconsistencies in the symbols table 2018-02-18 13:51:31 +01:00
symbols.pyx Fix inconsistencies in the symbols table 2018-02-18 13:51:31 +01:00
tokenizer.pxd Disable tokenizer cache for special-cases. Fixes #1250 2017-10-24 16:08:05 +02:00
tokenizer.pyx Fix loading tokenizer with custom prefix search (#2495) 2018-07-04 12:56:07 +02:00
typedefs.pxd Work on changing StringStore to return hashes. 2017-05-28 12:36:27 +02:00
typedefs.pyx Tidy up rest 2017-10-27 21:07:59 +02:00
util.py Don't check for Jupyter in global scope and fix check (#3213) 2019-01-31 23:49:13 +01:00
vectors.pyx 💫 New system for error messages and warnings (#2163) 2018-04-03 15:50:31 +02:00
vocab.pxd Add Vocab.cfg attr, to hold stuff like oov probs 2017-10-30 16:08:50 +01:00
vocab.pyx Fix bug where Vocab.prune_vector did not use 'batch_size' (#2977) 2018-11-28 19:49:33 +01:00