Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "create PEP508 compliant dependency string for directory and file dependencies (#1796)" #1865

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions poetry/packages/directory_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 0 additions & 11 deletions poetry/packages/file_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 1 addition & 13 deletions tests/packages/test_directory_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
10 changes: 0 additions & 10 deletions tests/packages/test_file_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down