-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add contextual comment to dependency change
- Loading branch information
Showing
16 changed files
with
138 additions
and
53 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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from dataclasses import dataclass | ||
|
||
from packaging.requirements import Requirement | ||
|
||
|
||
@dataclass | ||
class License: | ||
name: str | ||
url: str | ||
|
||
|
||
@dataclass | ||
class Dependency: | ||
requirement: Requirement | ||
description: str | ||
_license: License | ||
oss_link: str | ||
package_link: str | ||
|
||
@property | ||
def name(self) -> str: | ||
return self.requirement.name | ||
|
||
@property | ||
def version(self) -> str: | ||
return self.requirement.specifier.__str__().strip() | ||
|
||
def build_description(self) -> str: | ||
return f"""{self.description} | ||
License: [{self._license.name}]({self._license.url}) ✅ \ | ||
[Open Source]({self.oss_link}) ✅ \ | ||
[More facts]({self.package_link}) | ||
""" | ||
|
||
def __hash__(self): | ||
return hash(self.requirement) | ||
|
||
|
||
DefusedXML = Dependency( | ||
Requirement("defusedxml~=0.7.1"), | ||
description="""\ | ||
This package is [recommended by the Python community](https://docs.python.org/3/library/xml.html#the-defusedxml-package) \ | ||
to protect against XML vulnerabilities.\ | ||
""", | ||
_license=License( | ||
"PSF-2.0", | ||
"https://opensource.org/license/python-2-0/", | ||
), | ||
oss_link="https://github.com/tiran/defusedxml", | ||
package_link="https://pypi.org/project/defusedxml/", | ||
) | ||
|
||
Security = Dependency( | ||
Requirement("security~=1.2.0"), | ||
description="""This library holds security tools for protecting Python API calls.""", | ||
_license=License( | ||
"MIT", | ||
"https://opensource.org/license/MIT/", | ||
), | ||
oss_link="https://github.com/pixee/python-security", | ||
package_link="https://pypi.org/project/security/", | ||
) |
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
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
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.