Skip to content

Commit 2b0cd75

Browse files
committed
Use PEP 440 direct references in requirements
This adds support for PEP 440 requirements instead of using the pip-specific VCS format. see: https://peps.python.org/pep-0440/#direct-references This facilitates using newer tooling that does not support using the legacy pip VCS format. I adjusted the dist_utils.py functions to maintain the same functionality. Note however that I plan to use pants to replace all the python packaging bits, including dist_utils.py. So the dist_utils.py changes are a stop-gap to keep things working until we get the rest of the pants changes in.
1 parent a5c35a6 commit 2b0cd75

File tree

30 files changed

+138
-18
lines changed

30 files changed

+138
-18
lines changed

contrib/linux/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# used by file watcher sensor
22
pyinotify>=0.9.5,<=0.10
3-
-e git+https://github.com/StackStorm/logshipper.git@stackstorm_patched#egg=logshipper
3+
logshipper@ git+https://github.com/StackStorm/logshipper.git@stackstorm_patched

contrib/runners/action_chain_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/announcement_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/http_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/inquirer_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/local_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/noop_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

contrib/runners/orquesta_runner/dist_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def _get_link(line):
118118

119119
link = line.replace("-e ", "").strip()
120120
return link, req_name[0]
121+
elif vcs_prefix in line and line.count("@") == 2:
122+
# PEP 440 direct reference: <package name>@ <url>@version
123+
req_name, link = line.split("@", 1)
124+
req_name = req_name.strip()
125+
link = f"{link.strip()}#egg={req_name}"
126+
return link, req_name
121127

122128
return None, None
123129

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/StackStorm/[email protected]#egg=orquesta
1+
orquesta@ git+https://github.com/StackStorm/[email protected]

contrib/runners/orquesta_runner/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# If you want to update depdencies for a single component, modify the
66
# in-requirements.txt for that component and then run 'make requirements' to
77
# update the component requirements.txt
8-
git+https://github.com/StackStorm/[email protected]#egg=orquesta
8+
orquesta@ git+https://github.com/StackStorm/[email protected]

0 commit comments

Comments
 (0)