mirror of https://github.com/explosion/spaCy.git
Moved test for universe into .github folder (#9447)
* Moved universe-test into .github folder * Cleaned code * CHanged a file name
This commit is contained in:
parent
d2645b2e03
commit
78365452d3
|
@ -100,3 +100,8 @@ steps:
|
|||
python -m spacy assemble ner_source_md.cfg output_dir 2>&1 | grep -q W113
|
||||
displayName: 'Test assemble CLI vectors warning'
|
||||
condition: eq(variables['python_version'], '3.8')
|
||||
|
||||
- script: |
|
||||
python .github/validate_universe_json.py website/meta/universe.json
|
||||
displayName: 'Test website/meta/universe.json'
|
||||
condition: eq(variables['python_version'], '3.8')
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_universe_json():
|
||||
|
||||
root_dir = Path(__file__).parent
|
||||
universe_file = root_dir / "universe.json"
|
||||
|
||||
def validate_json(document):
|
||||
universe_file = Path(document)
|
||||
with universe_file.open() as f:
|
||||
universe_data = json.load(f)
|
||||
for entry in universe_data["resources"]:
|
||||
|
@ -15,3 +13,7 @@ def test_universe_json():
|
|||
assert not re.match(
|
||||
r"^(http:)|^(https:)", entry["github"]
|
||||
), "Github field should be user/repo, not a url"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
validate_json(str(sys.argv[1]))
|
|
@ -9,7 +9,6 @@ keys/
|
|||
spacy/tests/package/setup.cfg
|
||||
spacy/tests/package/pyproject.toml
|
||||
spacy/tests/package/requirements.txt
|
||||
spacy/tests/universe/universe.json
|
||||
|
||||
# Website
|
||||
website/.cache/
|
||||
|
|
1
setup.py
1
setup.py
|
@ -81,7 +81,6 @@ COPY_FILES = {
|
|||
ROOT / "setup.cfg": PACKAGE_ROOT / "tests" / "package",
|
||||
ROOT / "pyproject.toml": PACKAGE_ROOT / "tests" / "package",
|
||||
ROOT / "requirements.txt": PACKAGE_ROOT / "tests" / "package",
|
||||
ROOT / "website" / "meta" / "universe.json": PACKAGE_ROOT / "tests" / "universe",
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue