File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,26 @@ def from_poetry_checkout(path: Path) -> bytes:
213213 optional = False
214214
215215 if not version :
216- # e.g. git, path or url dependencies, skip for now
216+ # e.g. git, path or url dependencies
217+ if "path" in v :
218+ buf .append (f"Requires-Dist: { v ['path' ]} \n " )
219+
220+ elif "url" in v :
221+ buf .append (f"Requires-Dist: { v ['url' ]} \n " )
222+
223+ elif "git" in v :
224+ git_link = f"git+{ v ['git' ]} "
225+
226+ # from both poetry and pypa docs, seems like only one of the following should be specified
227+ revision = v .get ("rev" ) or v .get ("tag" ) or v .get ("branch" )
228+ if revision :
229+ git_link += f"@{ revision } "
230+
231+ if "subdirectory" in v :
232+ git_link += f"#subdirectory={ v ['subdirectory' ]} "
233+
234+ buf .append (f"Requires-Dist: { k } @ { git_link } \n " )
235+
217236 continue
218237
219238 # https://python-poetry.org/docs/dependency-specification/#version-constraints
Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ def test_poetry_full(self) -> None:
110110c3 = "~1"
111111d = {version="2", python="<3.11"}
112112e = {version="2", markers="sys_platform == 'darwin'"}
113- skipped = {git = "..."}
113+ skipped = {git = "...", tag = "12345"}
114+ my-package = { url = "https://example.com/my-package-0.1.0.tar.gz" }
115+ my-other-package = { path = "../my-package/dist/my-other-package-0.1.0.tar.gz" }
114116complex = {extras=["bar", "baz"], version="2"}
115117opt = { version = "^2.9", optional = true}
116118unused-extra = { version = "2", optional = true }
@@ -131,6 +133,9 @@ def test_poetry_full(self) -> None:
131133 "c3>=1,<2" ,
132134 "d==2 ; python_version < '3.11'" ,
133135 "e==2 ; sys_platform == 'darwin'" ,
136+ "skipped @ git+...@12345" ,
137+ "https://example.com/my-package-0.1.0.tar.gz" ,
138+ "../my-package/dist/my-other-package-0.1.0.tar.gz" ,
134139 "complex[bar,baz]==2" ,
135140 'opt>=2.9,<3 ; extra == "foo"' ,
136141 ],
You can’t perform that action at this time.
0 commit comments