Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ba07bfe8a | |||
| c510be9c0e | |||
| 91594fe671 |
@@ -14,4 +14,3 @@ requests>=2.11.0,<3.0.0
|
||||
regex>=2017.4.1,<2017.12.1
|
||||
ftfy>=4.4.2,<5.0.0
|
||||
pytest>=3.0.6,<4.0.0
|
||||
pip>=9.0.0,<10.0.0
|
||||
|
||||
+9
-5
@@ -1,7 +1,7 @@
|
||||
# coding: utf8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import pip
|
||||
import pkg_resources
|
||||
from pathlib import Path
|
||||
import importlib
|
||||
from ..compat import unicode_, symlink_to
|
||||
@@ -69,10 +69,14 @@ def get_meta(package_path, package):
|
||||
meta = util.parse_package_meta(package_path, package)
|
||||
return meta
|
||||
|
||||
|
||||
def is_package(origin):
|
||||
packages = pip.get_installed_distributions()
|
||||
def is_package(name):
|
||||
"""Check if string maps to a package installed via pip.
|
||||
name (unicode): Name of package.
|
||||
RETURNS (bool): True if installed package, False if not.
|
||||
"""
|
||||
name = name.lower() # compare package name against lowercase name
|
||||
packages = pkg_resources.working_set.by_key.keys()
|
||||
for package in packages:
|
||||
if package.project_name.replace('-', '_') == origin:
|
||||
if package.lower().replace('-', '_') == name:
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..cli.download import download, get_compatibility, get_version, check_error_depr
|
||||
from ..cli.link import is_package
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -24,3 +25,9 @@ def test_cli_download_get_matching_version_fails(model):
|
||||
def test_cli_download_no_model_depr_error(model):
|
||||
with pytest.raises(SystemExit):
|
||||
check_error_depr(model)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('package', ['numpy'])
|
||||
def test_cli_link_is_package(package):
|
||||
"""Test that an installed package via pip is recognised by link.is_package."""
|
||||
assert is_package(package)
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
]
|
||||
},
|
||||
|
||||
"robots.txt": {
|
||||
"layout": false
|
||||
},
|
||||
|
||||
"404": {
|
||||
"title": "404 Error",
|
||||
"landing": true
|
||||
|
||||
+3
-3
@@ -12,10 +12,10 @@
|
||||
"COMPANY_URL": "https://explosion.ai",
|
||||
"DEMOS_URL": "https://demos.explosion.ai",
|
||||
|
||||
"SPACY_VERSION": "1.9",
|
||||
"SPACY_VERSION": "2.0",
|
||||
"LATEST_NEWS": {
|
||||
"url": "/docs/usage/models",
|
||||
"title": "The first official Spanish model is here!"
|
||||
"url": "https://alpha.spacy.io",
|
||||
"title": "Try spaCy v2.0!"
|
||||
},
|
||||
|
||||
"SOCIAL": {
|
||||
|
||||
@@ -19,5 +19,6 @@
|
||||
//- Generate GitHub links
|
||||
|
||||
- function gh(repo, filepath, branch) {
|
||||
- if (repo == "spacy") branch = 'v1.x';
|
||||
- return 'https://github.com/' + SOCIAL.github + '/' + repo + (filepath ? '/blob/' + (branch || 'master') + '/' + filepath : '' );
|
||||
- }
|
||||
|
||||
@@ -5,8 +5,7 @@ include _mixins
|
||||
nav.c-nav.u-text.js-nav(class=landing ? "c-nav--theme" : null)
|
||||
a(href='/') #[+logo]
|
||||
|
||||
if SUBSECTION != "index"
|
||||
.u-text-label.u-padding-small.u-hidden-xs=SUBSECTION
|
||||
.u-text-label.u-padding-small.u-hidden-xs Legacy
|
||||
|
||||
ul.c-nav__menu
|
||||
each url, item in NAVIGATION
|
||||
|
||||
@@ -10,6 +10,16 @@ main.o-main.o-main--sidebar.o-main--aside
|
||||
if tag
|
||||
+tag=tag
|
||||
|
||||
+infobox("⚠️ Important note")
|
||||
| You are viewing the #[strong v1.x legacy documentation].
|
||||
| #[+a("https://spacy.io", true) Go here] for the latest
|
||||
| documentation of the new version. spaCy v2.0 comes with a lot
|
||||
| of improvements around training, serialization and processing
|
||||
| pipeline management, as well as new convolutional neural network
|
||||
| models for several languages. See
|
||||
| #[+a("https://spacy.io/usage/v2") this page] for more details and
|
||||
| a migration guide.
|
||||
|
||||
!=yield
|
||||
|
||||
+grid.o-content.u-text
|
||||
@@ -21,7 +31,7 @@ main.o-main.o-main--sidebar.o-main--aside
|
||||
span #[strong.u-text-label Read next:] #[+a(next).u-link=data.title]
|
||||
|
||||
+grid-col("half").u-text-right
|
||||
.o-inline-list
|
||||
//-.o-inline-list
|
||||
+button(gh("spacy", "website/" + current.path.join('/') + ".jade"), false, "secondary").u-text-tag Suggest edits #[+icon("code", 14)]
|
||||
|
||||
+gitter("spaCy chat")
|
||||
|
||||
@@ -11,8 +11,6 @@ include _includes/_mixins
|
||||
h2.c-landing__title.o-block.u-heading-1
|
||||
| in Python
|
||||
|
||||
+landing-badge(gh("spaCy") + "/releases/tag/v2.0.0-alpha", "v2alpha", "Try spaCy v2.0.0 alpha!")
|
||||
|
||||
+grid.o-content
|
||||
+grid-col("third").o-card
|
||||
+h(2) Fastest in the world
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
@@ -1,5 +0,0 @@
|
||||
//- 💫 ROBOTS.TXT
|
||||
|
||||
if environment != "deploy"
|
||||
| User-agent: *
|
||||
| Disallow: /
|
||||
Reference in New Issue
Block a user