-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[noissue]
- Loading branch information
Showing
21 changed files
with
251 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
bump2version | ||
gitpython | ||
python-redmine | ||
towncrier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# WARNING: DO NOT EDIT! | ||
# | ||
# This file was generated by plugin_template, and is managed by it. Please use | ||
# './plugin-template --github pulp_cookbook' to update this file. | ||
# | ||
# For more info visit https://github.com/pulp/plugin_template | ||
|
||
from packaging.requirements import Requirement | ||
|
||
|
||
def main(): | ||
"""Calculate the lower bound of dependencies where possible.""" | ||
with open("requirements.txt") as req_file: | ||
for line in req_file: | ||
try: | ||
requirement = Requirement(line) | ||
except ValueError: | ||
print(line.strip()) | ||
else: | ||
for spec in requirement.specifier: | ||
if spec.operator == ">=": | ||
if requirement.name == "pulpcore": | ||
operator = "~=" | ||
else: | ||
operator = "==" | ||
min_version = str(spec)[2:] | ||
print(f"{requirement.name}{operator}{min_version}") | ||
break | ||
else: | ||
print(line.strip()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# WARNING: DO NOT EDIT! | ||
# | ||
# This file was generated by plugin_template, and is managed by it. Please use | ||
# './plugin-template --github pulp_cookbook' to update this file. | ||
# | ||
# For more info visit https://github.com/pulp/plugin_template | ||
|
||
import warnings | ||
from pkg_resources import Requirement | ||
|
||
|
||
CHECK_MATRIX = [ | ||
("requirements.txt", True, True, True), | ||
("dev_requirements.txt", False, True, False), | ||
("ci_requirements.txt", False, True, True), | ||
("doc_requirements.txt", False, True, False), | ||
("lint_requirements.txt", False, True, True), | ||
("unittest_requirements.txt", False, True, True), | ||
("functest_requirements.txt", False, True, True), | ||
("clitest_requirements.txt", False, True, True), | ||
] | ||
|
||
errors = [] | ||
|
||
for filename, check_upperbound, check_prereleases, check_r in CHECK_MATRIX: | ||
try: | ||
with open(filename, "r") as fd: | ||
for nr, line in enumerate(fd.readlines()): | ||
line = line.strip() | ||
if not line or line.startswith("#"): | ||
continue | ||
try: | ||
req = Requirement.parse(line) | ||
except ValueError: | ||
if line.startswith("git+"): | ||
# The single exception... | ||
if "pulp-smash" not in line: | ||
errors.append(f"{filename}:{nr}: Invalid source requirement: {line}") | ||
elif line.startswith("-r "): | ||
if check_r: | ||
errors.append(f"{filename}:{nr}: Invalid deferred requirement: {line}") | ||
else: | ||
errors.append(f"{filename}:{nr}: Unreadable requirement {line}") | ||
else: | ||
if check_prereleases and req.specifier.prereleases: | ||
if req.name != "pulp-cookbook-client": | ||
errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.") | ||
ops = [op for op, ver in req.specs] | ||
spec = str(req.specs) | ||
if "~=" in ops: | ||
warnings.warn(f"{filename}:{nr}: Please avoid using ~= on {req.name}!") | ||
elif "<" not in ops and "<=" not in ops and "==" not in ops: | ||
if check_upperbound: | ||
errors.append(f"{filename}:{nr}: Upper bound missing in {line}.") | ||
except FileNotFoundError: | ||
# skip this test for plugins that don't use this requirements.txt | ||
pass | ||
|
||
if errors: | ||
print("Dependency issues found:") | ||
print("\n".join(errors)) | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2021.08.26-179-g8af2847 | ||
2021.08.26-207-g81d81f6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.