From b7c7fdfd3d728f90ca63ba8001843fa539dec25f Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 6 Mar 2023 13:10:04 +0100 Subject: [PATCH] Move imports instead of disabling requirements check --- spacy/cli/project/run.py | 5 ----- spacy/tests/test_cli.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/spacy/cli/project/run.py b/spacy/cli/project/run.py index 7dd0925e3..0f4858a99 100644 --- a/spacy/cli/project/run.py +++ b/spacy/cli/project/run.py @@ -330,11 +330,6 @@ def _check_requirements(requirements: List[str]) -> Tuple[bool, bool]: RETURNS (Tuple[bool, bool]): Whether (1) any packages couldn't be imported, (2) any packages with version conflicts exist. """ - msg.warn("Requirements checks are being skipped.") - return False, False - - -def _check_requirements_pkg_resources(requirements: List[str]) -> Tuple[bool, bool]: import pkg_resources failed_pkgs_msgs: List[str] = [] diff --git a/spacy/tests/test_cli.py b/spacy/tests/test_cli.py index 5ce8671e4..e43a63528 100644 --- a/spacy/tests/test_cli.py +++ b/spacy/tests/test_cli.py @@ -2,7 +2,6 @@ import os import math from collections import Counter from typing import Tuple, List, Dict, Any -import pkg_resources import time from pathlib import Path @@ -1159,6 +1158,7 @@ def test_cli_find_threshold(capsys): ], ) def test_project_check_requirements(reqs, output): + import pkg_resources # excessive guard against unlikely package name try: pkg_resources.require("spacyunknowndoesnotexist12345")