File tree 2 files changed +25
-2
lines changed
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,27 @@ def from_poetry_checkout(path: Path) -> bytes:
233
233
optional = False
234
234
235
235
if not version :
236
- # e.g. git, path or url dependencies, skip for now
236
+ # e.g. git, path or url dependencies
237
+ if "git" in v :
238
+ git_link = f"git+{ v ['git' ]} "
239
+
240
+ # from both poetry and pypa docs, seems like only one of the following should be specified
241
+ revision = v .get ("rev" ) or v .get ("tag" ) or v .get ("branch" )
242
+ if revision :
243
+ git_link += f"@{ revision } "
244
+
245
+ if "subdirectory" in v :
246
+ git_link += f"#subdirectory={ v ['subdirectory' ]} "
247
+
248
+ buf .append (f"Requires-Dist: { k } @ { git_link } \n " )
249
+
250
+ # Still not sure about the PEP-508 form that these are supposed to take
251
+ # elif "path" in v:
252
+ # buf.append(f"Requires-Dist: {v['path']}\n")
253
+ #
254
+ # elif "url" in v:
255
+ # buf.append(f"Requires-Dist: {v['url']}\n")
256
+ #
237
257
continue
238
258
239
259
# https://python-poetry.org/docs/dependency-specification/#version-constraints
Original file line number Diff line number Diff line change @@ -111,7 +111,9 @@ def test_poetry_full(self) -> None:
111
111
c3 = "~1"
112
112
d = {version="2", python="<3.11"}
113
113
e = {version="2", markers="sys_platform == 'darwin'"}
114
- skipped = {git = "..."}
114
+ skipped = {git = "...", tag = "12345"}
115
+ my-url-package = { url = "https://example.com/my-package-0.1.0.tar.gz" }
116
+ my-path-package = { path = "../my-package/dist/my-other-package-0.1.0.tar.gz" }
115
117
complex = {extras=["bar", "baz"], version="2"}
116
118
opt = { version = "^2.9", optional = true}
117
119
unused-extra = { version = "2", optional = true }
@@ -133,6 +135,7 @@ def test_poetry_full(self) -> None:
133
135
"c3>=1,<2" ,
134
136
"d==2 ; python_version < '3.11'" ,
135
137
"e==2 ; sys_platform == 'darwin'" ,
138
+ "skipped @ git+...@12345" ,
136
139
"complex[bar,baz]==2" ,
137
140
'opt>=2.9,<3.0 ; extra == "foo"' ,
138
141
],
You can’t perform that action at this time.
0 commit comments