Commit d3156964 by David Hotham Committed by Bjorn Neergaard

remove strange VENDORS handling in installed repository

parent bd85ae6d
...@@ -20,15 +20,6 @@ if TYPE_CHECKING: ...@@ -20,15 +20,6 @@ if TYPE_CHECKING:
from poetry.utils.env import Env from poetry.utils.env import Env
_VENDORS = Path(__file__).parent.parent.joinpath("_vendor")
try:
FileNotFoundError
except NameError:
FileNotFoundError = OSError
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -283,13 +274,6 @@ class InstalledRepository(Repository): ...@@ -283,13 +274,6 @@ class InstalledRepository(Repository):
if name in seen: if name in seen:
continue continue
try:
path.relative_to(_VENDORS)
except ValueError:
pass
else:
continue
package = cls.create_package_from_distribution(distribution, env) package = cls.create_package_from_distribution(distribution, env)
if with_dependencies: if with_dependencies:
......
...@@ -22,14 +22,12 @@ ENV_DIR = (FIXTURES_DIR / "installed").resolve() ...@@ -22,14 +22,12 @@ ENV_DIR = (FIXTURES_DIR / "installed").resolve()
SITE_PURELIB = ENV_DIR / "lib" / "python3.7" / "site-packages" SITE_PURELIB = ENV_DIR / "lib" / "python3.7" / "site-packages"
SITE_PLATLIB = ENV_DIR / "lib64" / "python3.7" / "site-packages" SITE_PLATLIB = ENV_DIR / "lib64" / "python3.7" / "site-packages"
SRC = ENV_DIR / "src" SRC = ENV_DIR / "src"
VENDOR_DIR = ENV_DIR / "vendor" / "py3.7"
INSTALLED_RESULTS = [ INSTALLED_RESULTS = [
metadata.PathDistribution(SITE_PURELIB / "cleo-0.7.6.dist-info"), metadata.PathDistribution(SITE_PURELIB / "cleo-0.7.6.dist-info"),
metadata.PathDistribution(SRC / "pendulum" / "pendulum.egg-info"), metadata.PathDistribution(SRC / "pendulum" / "pendulum.egg-info"),
metadata.PathDistribution( metadata.PathDistribution(
zipfile.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO") zipfile.Path(str(SITE_PURELIB / "foo-0.1.0-py3.8.egg"), "EGG-INFO")
), ),
metadata.PathDistribution(VENDOR_DIR / "attrs-19.3.0.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "standard-1.2.3.dist-info"), metadata.PathDistribution(SITE_PURELIB / "standard-1.2.3.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "editable-2.3.4.dist-info"), metadata.PathDistribution(SITE_PURELIB / "editable-2.3.4.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "editable-with-import-2.3.4.dist-info"), metadata.PathDistribution(SITE_PURELIB / "editable-with-import-2.3.4.dist-info"),
...@@ -80,11 +78,6 @@ def mock_git_info(mocker: MockerFixture) -> None: ...@@ -80,11 +78,6 @@ def mock_git_info(mocker: MockerFixture) -> None:
) )
@pytest.fixture(autouse=True)
def mock_installed_repository_vendors(mocker: MockerFixture) -> None:
mocker.patch("poetry.repositories.installed_repository._VENDORS", str(VENDOR_DIR))
@pytest.fixture @pytest.fixture
def repository(mocker: MockerFixture, env: MockEnv) -> InstalledRepository: def repository(mocker: MockerFixture, env: MockEnv) -> InstalledRepository:
mocker.patch( mocker.patch(
...@@ -104,7 +97,7 @@ def get_package_from_repository( ...@@ -104,7 +97,7 @@ def get_package_from_repository(
def test_load_successful(repository: InstalledRepository): def test_load_successful(repository: InstalledRepository):
assert len(repository.packages) == len(INSTALLED_RESULTS) - 1 assert len(repository.packages) == len(INSTALLED_RESULTS)
def test_load_successful_with_invalid_distribution( def test_load_successful_with_invalid_distribution(
...@@ -118,9 +111,7 @@ def test_load_successful_with_invalid_distribution( ...@@ -118,9 +111,7 @@ def test_load_successful_with_invalid_distribution(
) )
repository_with_invalid_distribution = InstalledRepository.load(env) repository_with_invalid_distribution = InstalledRepository.load(env)
assert ( assert len(repository_with_invalid_distribution.packages) == len(INSTALLED_RESULTS)
len(repository_with_invalid_distribution.packages) == len(INSTALLED_RESULTS) - 1
)
assert len(caplog.messages) == 1 assert len(caplog.messages) == 1
message = caplog.messages[0] message = caplog.messages[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment