diff --git a/python-verboselogs-1.7-astroid2.patch b/python-verboselogs-1.7-astroid2.patch new file mode 100644 index 0000000000000000000000000000000000000000..a664f07377240e9eaba004d96238771fa4c8b554 --- /dev/null +++ b/python-verboselogs-1.7-astroid2.patch @@ -0,0 +1,21 @@ +diff -uNr a/verboselogs/pylint.py b/verboselogs/pylint.py +--- a/verboselogs/pylint.py 2017-08-07 12:45:42.000000000 -0700 ++++ b/verboselogs/pylint.py 2019-03-13 16:52:01.048252829 -0700 +@@ -11,6 +11,10 @@ + """ + + from astroid import MANAGER, scoped_nodes, nodes ++from astroid.__pkginfo__ import numversion ++ ++ ++scoped_nodes_class = scoped_nodes.ClassDef if numversion >= (2, 0) else scoped_nodes.Class + + + def register(linter): +@@ -32,5 +36,5 @@ + + + # Register the above methods with Pylint. +-MANAGER.register_transform(scoped_nodes.Class, verboselogs_class_transform) ++MANAGER.register_transform(scoped_nodes_class, verboselogs_class_transform) + MANAGER.register_transform(scoped_nodes.Module, verboselogs_module_transform) diff --git a/python-verboselogs-1.7-sphinx-theme.patch b/python-verboselogs-1.7-sphinx-theme.patch new file mode 100644 index 0000000000000000000000000000000000000000..bf0ad5f9586a4b41c0f0d4d30707694b527a35e4 --- /dev/null +++ b/python-verboselogs-1.7-sphinx-theme.patch @@ -0,0 +1,12 @@ +diff -uNr a/docs/conf.py b/docs/conf.py +--- a/docs/conf.py 2017-08-07 12:45:42.000000000 -0700 ++++ b/docs/conf.py 2019-03-13 17:12:14.251222745 -0700 +@@ -74,7 +74,7 @@ + + # The theme to use for HTML and HTML Help pages. See the documentation for + # a list of builtin themes. +-html_theme = 'classic' ++html_theme = 'nature' + + # Output file base name for HTML help builder. + htmlhelp_basename = 'verboselogsdoc' diff --git a/python-verboselogs-1.7.tar.gz b/python-verboselogs-1.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3248e80af777bddc16b4790e25112660502459bb Binary files /dev/null and b/python-verboselogs-1.7.tar.gz differ diff --git a/python-verboselogs.spec b/python-verboselogs.spec new file mode 100644 index 0000000000000000000000000000000000000000..4a35ab99e15ce83bc866fd744b560cb75b988773 --- /dev/null +++ b/python-verboselogs.spec @@ -0,0 +1,102 @@ +%global srcname verboselogs + +Name: python-%{srcname} +Version: 1.7 +Release: 1 +Summary: Verbose logging level for Python's logging module + +License: MIT +URL: https://%{srcname}.readthedocs.io +Source0: https://github.com/xolox/%{name}/archive/%{version}/%{name}-%{version}.tar.gz + +# Compatibility with astroid 2.0 - not submitted upstream +Patch0: %{name}-1.7-astroid2.patch +# Use a more available sphinx theme - not submitted upstream +Patch1: %{name}-1.7-sphinx-theme.patch + +BuildArch: noarch + +%description +The verboselogs package extends Python's logging module to add the log levels +NOTICE, SPAM, SUCCESS and VERBOSE: + +- The NOTICE level sits between the predefined WARNING and INFO levels. +- The SPAM level sits between the predefined DEBUG and NOTSET levels. +- The SUCCESS level sits between the predefined WARNING and ERROR levels. +- The VERBOSE level sits between the predefined INFO and DEBUG levels. + +The code to do this is simple and short, but I still don't want to copy/paste it +to every project I'm working on, hence this package. + + +%package doc +Summary: Documentation for the '%{srcname}' Python module +BuildRequires: python%{python3_pkgversion}-sphinx + +%description doc +HTML documentation for the '%{srcname}' Python module. + + +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{summary} +BuildRequires: python%{python3_pkgversion}-astroid +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-mock +BuildRequires: python%{python3_pkgversion}-pylint +BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-setuptools +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} + +%if 0%{?fedora} || 0%{?rhel} >= 8 +Suggests: %{name}-doc = %{version}-%{release} +%endif + +%description -n python%{python3_pkgversion}-%{srcname} +The verboselogs package extends Python's logging module to add the log levels +NOTICE, SPAM, SUCCESS and VERBOSE: + +- The NOTICE level sits between the predefined WARNING and INFO levels. +- The SPAM level sits between the predefined DEBUG and NOTSET levels. +- The SUCCESS level sits between the predefined WARNING and ERROR levels. +- The VERBOSE level sits between the predefined INFO and DEBUG levels. + +The code to do this is simple and short, but I still don't want to copy/paste it +to every project I'm working on, hence this package. + + +%prep +%autosetup -p1 + + +%build +%py3_build + +# Don't install pylint.py or tests.py +rm build/lib/%{srcname}/{pylint,tests}.py + +sphinx-build-%{python3_version} -nb html -d docs/build/doctrees docs docs/build/html +rm docs/build/html/.buildinfo + + +%install +%py3_install + + +%check +PYTHONUNBUFFERED=1 py.test-%{python3_version} %{srcname}/tests.py + + +%files doc +%license LICENSE.txt +%doc docs/build/html + +%files -n python%{python3_pkgversion}-%{srcname} +%license LICENSE.txt +%doc README.rst +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ + + +%changelog +* Thu Jul 08 2021 wanglixing -1.7-1 +- init project