Skip to content

Commit 97dd34f

Browse files
committed
make fixate-requirements work with pip-19.3.1 and PEP 440
This is not needed during `make wheelhouse` in st2-packages. But, rpmbuild runs fixate-requirements again when running build_os_package.sh in a new rpmbuild venv that does not have pip-20 yet. So, this makes that corner case in our circleci workflow work like.
1 parent 4d46a28 commit 97dd34f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/fixate-requirements.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,14 @@ def write_requirements(
225225
# we don't have any idea how to process links, so just add them
226226
if linkreq.link and linkreq.link not in links:
227227
links.add(linkreq.link)
228-
rline = str(linkreq.link)
228+
if hasattr(req, "req") and req.req and str(req.req).count("@") == 2:
229+
# PEP 440 direct reference
230+
rline = str(linkreq.req)
231+
# Also write out environment markers
232+
if linkreq.markers:
233+
rline += " ; {}".format(str(linkreq.markers))
234+
else:
235+
rline = str(linkreq.link)
229236

230237
if (hasattr(req, "is_editable") and req.is_editable) or (
231238
hasattr(req, "editable") and req.editable

0 commit comments

Comments
 (0)