mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-03-12 04:35:40 -07:00
* Bump pyjwt from 2.3.0 to 2.4.0 Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jpadilla/pyjwt/compare/2.3.0...2.4.0) --- updated-dependencies: - dependency-name: pyjwt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update pyjwt==2.4.0 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
61 lines
1.6 KiB
Python
61 lines
1.6 KiB
Python
import json
|
|
import platform
|
|
import sys
|
|
|
|
from . import __version__ as pyjwt_version
|
|
|
|
try:
|
|
import cryptography
|
|
except ModuleNotFoundError:
|
|
cryptography = None # type: ignore
|
|
|
|
|
|
def info():
|
|
"""
|
|
Generate information for a bug report.
|
|
Based on the requests package help utility module.
|
|
"""
|
|
try:
|
|
platform_info = {
|
|
"system": platform.system(),
|
|
"release": platform.release(),
|
|
}
|
|
except OSError:
|
|
platform_info = {"system": "Unknown", "release": "Unknown"}
|
|
|
|
implementation = platform.python_implementation()
|
|
|
|
if implementation == "CPython":
|
|
implementation_version = platform.python_version()
|
|
elif implementation == "PyPy":
|
|
implementation_version = (
|
|
f"{sys.pypy_version_info.major}."
|
|
f"{sys.pypy_version_info.minor}."
|
|
f"{sys.pypy_version_info.micro}"
|
|
)
|
|
if sys.pypy_version_info.releaselevel != "final":
|
|
implementation_version = "".join(
|
|
[implementation_version, sys.pypy_version_info.releaselevel]
|
|
)
|
|
else:
|
|
implementation_version = "Unknown"
|
|
|
|
return {
|
|
"platform": platform_info,
|
|
"implementation": {
|
|
"name": implementation,
|
|
"version": implementation_version,
|
|
},
|
|
"cryptography": {"version": getattr(cryptography, "__version__", "")},
|
|
"pyjwt": {"version": pyjwt_version},
|
|
}
|
|
|
|
|
|
def main():
|
|
"""Pretty-print the bug information as JSON."""
|
|
print(json.dumps(info(), sort_keys=True, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|