# # spec file for package python-loguru # # Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 %define skip_python36 1 %define skip_python39 1 Name: python-loguru Version: 0.5.3 Release: 4.5 Summary: Python logging component with a simple interface License: MIT Group: Development/Languages/Python URL: https://github.com/Delgan/loguru Source: https://files.pythonhosted.org/packages/source/l/loguru/loguru-%{version}.tar.gz # PATCH-FIX-UPSTREAM pytest-6.2-excepthooks.patch Patch0: https://github.com/Delgan/loguru/commit/31cf758ee9d22dbfa125f38153782fe20ac9dce5.patch#/pytest-6.2-excepthooks.patch # PATCH-FIX-UPSTREAM loguru-exception-formatting-py39.patch Patch1: https://github.com/Delgan/loguru/commit/19f518c5f1f355703ffc4ee62f0e1e397605863e.patch#/loguru-exception-formatting-py39.patch BuildRequires: %{python_module aiocontextvars if %python-base < 3.7} BuildRequires: %{python_module colorama} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros %if 0%{?python_version_nodots} < 37 Requires: python-aiocontextvars %endif Recommends: python-colorama BuildArch: noarch %python_subpackages %description Python logging component providing a single object which dispatches log messages to configured handlers. %prep %autosetup -p1 -n loguru-%{version} %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export LANG=en_US.UTF-8 if [ $(getconf LONG_BIT) = 32 ]; then # Threads have different references on 32-bit donttest=" or (test_log_formatters and thread and not thread.name)" fi # different line numbers -- https://github.com/Delgan/loguru/issues/550 python310_donttest=" or (test_exceptions_formatting and formatting_with_context_manager)" %pytest -k "not (donttestexprprefixdummy $donttest ${$python_donttest})" %files %{python_files} %license LICENSE %doc README.rst %{python_sitelib}/loguru %{python_sitelib}/loguru-%{version}*-info %changelog * Thu Dec 9 2021 Ben Greiner - Skip two formatting tests -- gh#Delgan/loguru#550 * Sun Apr 18 2021 Ben Greiner - Add loguru-exception-formatting-py39.patch https://github.com/Delgan/loguru/commit/19f518c5 for changed exception formatting in Python 3.9 * Fri Feb 19 2021 John Vandenberg - Add pytest-6.2-excepthooks.patch for compatibility with pytest 6.2 * Mon Feb 8 2021 John Vandenberg - Update t0 v0.5.3 * Fix child process possibly hanging at exit while combining enqueue=True with third party library like uwsgi * Fix possible exception during formatting of non-string messages - from v0.5.2 * Fix AttributeError within handlers using serialize=True when calling logger.exception() outside of the context of an exception * Fix error while logging an exception containing a non-picklable value to a handler with enqueue=True * Add support for async callable classes used as sinks - from v0.5.1 * Modify the way the extra dict is used by LogRecord in order to prevent possible KeyError with standard logging handlers * Add a new default optional argument to logger.catch(), it should be the returned value by the decorated function in case an error occurred * Fix ValueError when using serialize=True in combination with logger.catch() or logger.opt(record=True) due to circular reference of the record dict - from v0.5.0 * Remove the possibility to modify the severity no of levels once they have been added in order to prevent surprising behavior * Add better support for "structured logging" by automatically adding **kwargs to the extra dict besides using these arguments to format the message. This behavior can be disabled by setting the new .opt(capture=False) parameter * Add a new onerror optional argument to logger.catch(), it should be a function which will be called when an exception occurs in order to customize error handling * Add a new exclude optional argument to logger.catch(), is should be a type of exception to be purposefully ignored and propagated to the caller without being logged * Modify complete() to make it callable from non-asynchronous functions, it can thus be used if enqueue=True to make sure all messages have been processed * Fix possible deadlocks on Linux when multiprocessing.Process() collides with enqueue=True or threading * Fix compression function not executable concurrently due to file renaming (to resolve conflicts) being performed after and not before it * Fix the filter function listing files for retention being too restrictive, it now matches files based on the pattern "basename(.*).ext(.*)" * Fix the impossibility to remove() a handler if an exception is raised while the sink' stop() function is called * Fix file sink left in an unstable state if an exception occurred during retention or compression process * Fix situation where changes made to record["message"] were unexpectedly ignored when opt(colors=True), causing "out-of-date" message to be logged due to implementation details * Fix possible exception if a stream having an isatty() method returning True but not being compatible with colorama is used on Windows * Fix exceptions occurring in coroutine sinks never retrieved and hence causing warnings * Thu Jan 21 2021 Benjamin Greiner - Add runtime requirement for contextvars and the correct BR for Leap - Skip failing tests on 32-bit * Thu Jan 21 2021 Steve Kowalik - BuildRequire python36-aiocontextvars if building under python 3.6 * Sun Feb 16 2020 Martin Hauke - Update to version 0.4.1 * Deprecate the ansi parameter of .opt() in favor of colors which is a name more appropriate. * Prevent unrelated files and directories to be incorrectly collected thus causing errors during the retention process * Strip color markups contained in record["message"] when logging with .opt(ansi=True) instead of leaving them as is. * Ignore color markups contained in *args and **kwargs when logging with .opt(ansi=True), leave them as is instead of trying to use them to colorize the message which could cause undesirable errors. - Update to version 0.4.0 * Add support for coroutine functions used as sinks and add the new logger.complete() asynchronous method to await them. * Add a way to filter logs using one level per module in the form of a dict passed to the filter argument. * Add type hints to annotate the public methods using a .pyi stub file. * Add support for copy.deepcopy() of the logger allowing multiple independent loggers with separate set of handlers. * Add the possibility to convert datetime to UTC before formatting (in logs and filenames) by adding "!UTC" at the end of the time format specifier. * Add the level name as the first argument of namedtuple returned by the .level() method. * Remove class objects from the list of supported sinks and restrict usage of **kwargs in .add() to file sink only. User is in charge of instantiating sink and wrapping additional keyword arguments if needed, before passing it to the .add() method. * Rename the logger.configure() keyword argument patch to patcher so it better matches the signature of logger.patch(). * Fix AttributeError while using a file sink on some distributions (like Alpine Linux) missing the os.getxattr and os.setxattr functions. * Fix values wrongly displayed for keyword arguments during exception formatting with diagnose=True. * Fix logging messages wrongly chopped off at the end while using standard logging.Handler sinks with .opt(raw=True). * Fix an error using a filter function "by name" while receiving a log with record["name"] equals to None. * Fix incorrect record displayed while handling errors (if catch=True) occurring because of non-picklable objects (if enqueue=True). * Prevent hypothetical ImportError if a Python installation is missing the built-in distutils module. * Raise TypeError instead of ValueError when a logger method is called with argument of invalid type. * Raise ValueError if the built-in format() and filter() functions are respectively used as format and filter arguments of the add() method. This helps the user to understand the problem, as such a mistake can quite easily occur. * Remove inheritance of some record dict attributes to str (for "level", "file", "thread" and "process"). * Give a name to the worker thread used when enqueue=True * Fri Aug 2 2019 John Vandenberg - Initial spec for v0.3.2