From 929af85e1406f6d2714ec38d77c1db97e5d8cdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Eustace?= Date: Fri, 10 Jan 2020 15:07:07 +0100 Subject: [PATCH] Revert "create PEP508 compliant dependency string for directory and file dependencies (#1796)" This reverts commit 10e471a0e6a916acd4b6b1bf5362a0d7054ebc04. --- poetry/packages/directory_dependency.py | 11 ----------- poetry/packages/file_dependency.py | 11 ----------- tests/packages/test_directory_dependency.py | 14 +------------- tests/packages/test_file_dependency.py | 10 ---------- 4 files changed, 1 insertion(+), 45 deletions(-) diff --git a/poetry/packages/directory_dependency.py b/poetry/packages/directory_dependency.py index 9d611ec4da7..ac4bca8ea82 100644 --- a/poetry/packages/directory_dependency.py +++ b/poetry/packages/directory_dependency.py @@ -74,17 +74,6 @@ def base(self): def develop(self): return self._develop - @property - def base_pep_508_name(self): # type: () -> str - requirement = self.pretty_name - - if self.extras: - requirement += "[{}]".format(",".join(self.extras)) - - requirement += " @ {}".format(self._path) - - return requirement - def supports_poetry(self): return self._supports_poetry diff --git a/poetry/packages/file_dependency.py b/poetry/packages/file_dependency.py index 6db5c79464c..b91d296a512 100644 --- a/poetry/packages/file_dependency.py +++ b/poetry/packages/file_dependency.py @@ -49,17 +49,6 @@ def path(self): def full_path(self): return self._full_path.resolve() - @property - def base_pep_508_name(self): # type: () -> str - requirement = self.pretty_name - - if self.extras: - requirement += "[{}]".format(",".join(self.extras)) - - requirement += " @ {}".format(self._path) - - return requirement - def is_file(self): return True diff --git a/tests/packages/test_directory_dependency.py b/tests/packages/test_directory_dependency.py index a187558c8ae..a557bb8c060 100644 --- a/tests/packages/test_directory_dependency.py +++ b/tests/packages/test_directory_dependency.py @@ -8,24 +8,12 @@ from poetry.utils.env import MockEnv as BaseMockEnv -fixtures_dir = Path(__file__).parent.parent / "fixtures" -DIST_PATH = Path(__file__).parent.parent / "fixtures" / "git" / "github.com" / "demo" - - class MockEnv(BaseMockEnv): def run(self, bin, *args): raise EnvCommandError(CalledProcessError(1, "python", output="")) -def test_directory_dependency(): - dependency = DirectoryDependency("simple_project", fixtures_dir / "simple_project") - - assert dependency.pretty_name == "simple_project" - assert dependency.develop - assert dependency.path == fixtures_dir / "simple_project" - assert dependency.base_pep_508_name == "simple_project @ {}".format( - fixtures_dir / "simple_project" - ) +DIST_PATH = Path(__file__).parent.parent / "fixtures" / "git" / "github.com" / "demo" def test_directory_dependency_must_exist(): diff --git a/tests/packages/test_file_dependency.py b/tests/packages/test_file_dependency.py index 447ad5df2bc..f5808d26641 100644 --- a/tests/packages/test_file_dependency.py +++ b/tests/packages/test_file_dependency.py @@ -7,16 +7,6 @@ DIST_PATH = Path(__file__).parent.parent / "fixtures" / "distributions" -def test_file_dependency(): - dependency = FileDependency("demo", DIST_PATH / "demo-0.1.0.tar.gz") - - assert dependency.pretty_name == "demo" - assert dependency.path == DIST_PATH / "demo-0.1.0.tar.gz" - assert dependency.base_pep_508_name == "demo @ {}".format( - DIST_PATH / "demo-0.1.0.tar.gz" - ) - - def test_file_dependency_wrong_path(): with pytest.raises(ValueError): FileDependency("demo", DIST_PATH / "demo-0.2.0.tar.gz")