Skip to content

Commit

Permalink
Ensure vcs dependencies preserve editable flag
Browse files Browse the repository at this point in the history
Resolves: #3263
  • Loading branch information
abn authored and finswimmer committed Oct 22, 2020
1 parent 3f66d5c commit 5af1ff7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion poetry/packages/locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def _dump_package(self, package): # type: (Package) -> dict
if package.source_resolved_reference:
data["source"]["resolved_reference"] = package.source_resolved_reference

if package.source_type == "directory":
if package.source_type in ["directory", "git"]:
data["develop"] = package.develop

return data
1 change: 1 addition & 0 deletions poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def search_for_vcs(self, dependency): # type: (VCSDependency) -> List[Package]
rev=dependency.rev,
name=dependency.name,
)
package.develop = dependency.develop

dependency._constraint = package.version
dependency._pretty_constraint = package.version.text
Expand Down
1 change: 1 addition & 0 deletions tests/packages/test_locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def test_lock_file_data_is_ordered(locker, root):
category = "main"
optional = false
python-versions = "*"
develop = true
[package.source]
type = "git"
Expand Down
9 changes: 9 additions & 0 deletions tests/puzzle/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ def provider(root, pool):
return Provider(root, pool, NullIO())


@pytest.mark.parametrize("value", [True, False])
def test_search_for_vcs_retains_develop_flag(provider, value):
dependency = VCSDependency(
"demo", "git", "https://github.com/demo/demo.git", develop=value
)
package = provider.search_for_vcs(dependency)[0]
assert package.develop == value


def test_search_for_vcs_setup_egg_info(provider):
dependency = VCSDependency("demo", "git", "https://github.com/demo/demo.git")

Expand Down

0 comments on commit 5af1ff7

Please sign in to comment.