Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-autopage for openSUSE:Factory checked in at 2026-03-05 17:15:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-autopage (Old) and /work/SRC/openSUSE:Factory/.python-autopage.new.561 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-autopage" Thu Mar 5 17:15:03 2026 rev:10 rq:1336602 version:0.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-autopage/python-autopage.changes 2024-10-08 17:25:57.748919326 +0200 +++ /work/SRC/openSUSE:Factory/.python-autopage.new.561/python-autopage.changes 2026-03-05 17:18:22.182653080 +0100 @@ -1,0 +2,11 @@ +Wed Mar 4 22:05:35 UTC 2026 - Dirk Müller <[email protected]> + +- update to 0.6.0: + * Compatibility with Python 3.15.0a5 + * Testing on Python 3.13, 3.14, and 3.15 + * Compliance with PEP540 (UTF-8 Mode) + * Deference to the standard library colorization of argparse output + where available (in Python 3.14+) + * The ability to specify a different default error code + +------------------------------------------------------------------- Old: ---- autopage-0.5.2.tar.gz New: ---- autopage-0.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-autopage.spec ++++++ --- /var/tmp/diff_new_pack.pg4owt/_old 2026-03-05 17:18:22.722675428 +0100 +++ /var/tmp/diff_new_pack.pg4owt/_new 2026-03-05 17:18:22.722675428 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-autopage # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-autopage -Version: 0.5.2 +Version: 0.6.0 Release: 0 Summary: A library to provide automatic paging for console output License: Apache-2.0 ++++++ autopage-0.5.2.tar.gz -> autopage-0.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/.package/lib/python3.11/site-packages/pip/py.typed new/autopage-0.6.0/.tox/.package/lib/python3.11/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/.package/lib/python3.11/site-packages/pip/py.typed 2023-05-25 02:30:05.000000000 +0200 +++ new/autopage-0.6.0/.tox/.package/lib/python3.11/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed new/autopage-0.6.0/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed 2023-10-13 00:23:23.000000000 +0200 +++ new/autopage-0.6.0/.tox/.pkg/lib/python3.11/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/mypy/lib/python3.11/site-packages/pip/py.typed new/autopage-0.6.0/.tox/mypy/lib/python3.11/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/mypy/lib/python3.11/site-packages/pip/py.typed 2023-10-13 06:00:58.000000000 +0200 +++ new/autopage-0.6.0/.tox/mypy/lib/python3.11/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed new/autopage-0.6.0/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed --- old/autopage-0.5.2/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed 2023-05-25 02:30:12.000000000 +0200 +++ new/autopage-0.6.0/.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561. The mypy package uses inline types. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/pep8/lib/python3.11/site-packages/pip/py.typed new/autopage-0.6.0/.tox/pep8/lib/python3.11/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/pep8/lib/python3.11/site-packages/pip/py.typed 2023-10-13 06:00:54.000000000 +0200 +++ new/autopage-0.6.0/.tox/pep8/lib/python3.11/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py310/lib/python3.10/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py310/lib/python3.10/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py310/lib/python3.10/site-packages/pip/py.typed 2023-10-13 06:02:51.000000000 +0200 +++ new/autopage-0.6.0/.tox/py310/lib/python3.10/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py310/lib/python3.10/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/py310/lib/python3.10/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/py310/lib/python3.10/site-packages/tomli/py.typed 2023-05-25 02:30:58.000000000 +0200 +++ new/autopage-0.6.0/.tox/py310/lib/python3.10/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py311/lib/python3.11/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py311/lib/python3.11/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py311/lib/python3.11/site-packages/pip/py.typed 2023-10-13 00:23:22.000000000 +0200 +++ new/autopage-0.6.0/.tox/py311/lib/python3.11/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py312/lib/python3.12/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py312/lib/python3.12/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py312/lib/python3.12/site-packages/pip/py.typed 2023-10-13 10:15:06.000000000 +0200 +++ new/autopage-0.6.0/.tox/py312/lib/python3.12/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py36/lib/python3.6/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/pip/py.typed 2023-10-13 06:02:29.000000000 +0200 +++ new/autopage-0.6.0/.tox/py36/lib/python3.6/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/py36/lib/python3.6/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/py36/lib/python3.6/site-packages/tomli/py.typed 2023-05-25 02:30:29.000000000 +0200 +++ new/autopage-0.6.0/.tox/py36/lib/python3.6/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py37/lib/python3.7/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/pip/py.typed 2023-10-13 06:02:35.000000000 +0200 +++ new/autopage-0.6.0/.tox/py37/lib/python3.7/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/py37/lib/python3.7/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/py37/lib/python3.7/site-packages/tomli/py.typed 2023-05-25 02:30:38.000000000 +0200 +++ new/autopage-0.6.0/.tox/py37/lib/python3.7/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py38/lib/python3.8/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/pip/py.typed 2023-10-13 06:02:41.000000000 +0200 +++ new/autopage-0.6.0/.tox/py38/lib/python3.8/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/py38/lib/python3.8/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/py38/lib/python3.8/site-packages/tomli/py.typed 2023-05-25 02:30:45.000000000 +0200 +++ new/autopage-0.6.0/.tox/py38/lib/python3.8/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py39/lib/python3.9/site-packages/pip/py.typed new/autopage-0.6.0/.tox/py39/lib/python3.9/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/py39/lib/python3.9/site-packages/pip/py.typed 2023-10-13 06:02:46.000000000 +0200 +++ new/autopage-0.6.0/.tox/py39/lib/python3.9/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/py39/lib/python3.9/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/py39/lib/python3.9/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/py39/lib/python3.9/site-packages/tomli/py.typed 2023-05-25 02:30:52.000000000 +0200 +++ new/autopage-0.6.0/.tox/py39/lib/python3.9/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed new/autopage-0.6.0/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed --- old/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed 2023-10-13 06:01:00.000000000 +0200 +++ new/autopage-0.6.0/.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -pip is a command line program. While it is implemented in Python, and so is -available for import, you must not use pip's internal APIs in this way. Typing -information is provided as a convenience only and is not a guarantee. Expect -unannounced changes to the API and types in releases. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed new/autopage-0.6.0/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed --- old/autopage-0.5.2/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed 2023-05-25 02:30:18.000000000 +0200 +++ new/autopage-0.6.0/.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Marker file for PEP 561 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/PKG-INFO new/autopage-0.6.0/PKG-INFO --- old/autopage-0.5.2/PKG-INFO 2023-10-16 11:19:58.986908000 +0200 +++ new/autopage-0.6.0/PKG-INFO 2026-01-30 04:34:31.680104500 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: autopage -Version: 0.5.2 +Version: 0.6.0 Summary: A library to provide automatic paging for console output Home-page: https://github.com/zaneb/autopage Author: Zane Bitter @@ -16,6 +16,9 @@ Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: 3.15 Classifier: Operating System :: POSIX Classifier: Environment :: Console Classifier: Intended Audience :: Developers @@ -26,6 +29,7 @@ Requires-Python: >=3.6 Description-Content-Type: text/markdown License-File: LICENSE +Dynamic: license-file # autopage @@ -43,7 +47,7 @@ ## License -© 2020-2022 by Zane Bitter +© 2020-2026 by Zane Bitter Open Source licensed under the terms of the Apache Software License, version 2.0. @@ -60,7 +64,7 @@ Autopage is [packaged for Fedora](https://packages.fedoraproject.org/pkgs/python-autopage/python3-autopage/) -35 and later. To install: +35 and later, and EPEL 9. To install: # dnf install python3-autopage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/README.md new/autopage-0.6.0/README.md --- old/autopage-0.5.2/README.md 2023-05-25 01:25:05.000000000 +0200 +++ new/autopage-0.6.0/README.md 2026-01-08 23:59:43.000000000 +0100 @@ -14,7 +14,7 @@ ## License -© 2020-2022 by Zane Bitter +© 2020-2026 by Zane Bitter Open Source licensed under the terms of the Apache Software License, version 2.0. @@ -31,7 +31,7 @@ Autopage is [packaged for Fedora](https://packages.fedoraproject.org/pkgs/python-autopage/python3-autopage/) -35 and later. To install: +35 and later, and EPEL 9. To install: # dnf install python3-autopage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage/__init__.py new/autopage-0.6.0/autopage/__init__.py --- old/autopage-0.5.2/autopage/__init__.py 2023-10-16 11:01:59.000000000 +0200 +++ new/autopage-0.6.0/autopage/__init__.py 2026-01-30 04:12:14.000000000 +0100 @@ -16,6 +16,7 @@ By Zane Bitter. """ +import codecs import contextlib import enum import io @@ -74,7 +75,7 @@ self._set_errors = (ErrorStrategy(errors) if errors is not None else None) self._pager: Optional[subprocess.Popen] = None - self._exit_code = 0 + self._exit_code: typing.Union[int, BaseException] = 0 def to_terminal(self) -> bool: """Return whether the output stream is a terminal.""" @@ -97,7 +98,12 @@ return self._set_line_buffering def _encoding(self) -> str: - return getattr(self._out, 'encoding', 'ascii') + dflt = 'utf-8' if getattr(sys.flags, 'utf8_mode', False) else 'ascii' + encoding = getattr(self._out, 'encoding', dflt) + try: + return codecs.lookup(encoding).name + except LookupError: + return dflt def _errors(self) -> str: if self._set_errors is None: @@ -227,10 +233,10 @@ elif isinstance(exc, SystemExit) and isinstance(exc.code, int): self._exit_code = exc.code else: - self._exit_code = 1 + self._exit_code = exc return False - def exit_code(self) -> int: + def exit_code(self, *, on_error_default: int = 1) -> int: """ Return an appropriate exit code for the process based on any errors. @@ -239,6 +245,8 @@ returns an appropriate exit code on the basis of the existence and type of any uncaught exceptions. """ + if not isinstance(self._exit_code, int): + return on_error_default return self._exit_code diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage/argparse.py new/autopage-0.6.0/autopage/argparse.py --- old/autopage-0.5.2/autopage/argparse.py 2021-07-13 02:53:22.000000000 +0200 +++ new/autopage-0.6.0/autopage/argparse.py 2026-01-30 04:12:14.000000000 +0100 @@ -33,6 +33,8 @@ import argparse import contextlib import functools +import os +import sys import types from typing import Any, Sequence, Text, TextIO, Tuple, Type, Optional, Union from typing import Callable, ContextManager, Generator @@ -45,6 +47,7 @@ _HelpFormatter = argparse.HelpFormatter _color_attr = '_autopage_color' +_original_stream_attr = '_autopage_original_stream' def help_pager(out_stream: Optional[TextIO] = None) -> autopage.AutoPager: @@ -58,7 +61,20 @@ def use_color_for_parser(parser: argparse.ArgumentParser, color: bool) -> None: """Configure a parser whether to output in color from HelpFormatters.""" - setattr(parser, _color_attr, color) + if os.getenv('FORCE_COLOR') is None: + if (os.getenv('NO_COLOR') is not None or + os.getenv('TERM') == 'dumb' or + (not sys.flags.ignore_environment and + os.getenv('PYTHON_COLORS') == '0')): + color = False + elif sys.platform == 'win32': + try: + import nt + if not nt._supports_virtual_terminal(): + color = False + except (ImportError, AttributeError): + color = False + parser.color = color class ColorHelpFormatter(_HelpFormatter): @@ -129,7 +145,10 @@ option_string: Optional[Text] = None) -> None: pager = help_pager() with pager as out: - use_color_for_parser(parser, pager.to_terminal()) + if out is not pager._out: + setattr(out, _original_stream_attr, pager._out) + use_color_for_parser(parser, (pager.to_terminal() and + getattr(parser, 'color', True))) parser.print_help(out) parser.exit(pager.exit_code()) @@ -144,29 +163,41 @@ get_fmtr: Callable[[Any], _HelpFormatter] ) -> Callable[[argparse.ArgumentParser], _HelpFormatter]: @functools.wraps(get_fmtr) - def _get_formatter(parser: argparse.ArgumentParser) -> _HelpFormatter: + def _get_formatter(parser: argparse.ArgumentParser, + file: Optional[TextIO] = None) -> _HelpFormatter: if parser.formatter_class is _HelpFormatter: - parser.formatter_class = ColorHelpFormatter - formatter = get_fmtr(parser) + parser.formatter_class = HelpFormatter + kwargs = {} + if file is not None: + kwargs['file'] = getattr(file, _original_stream_attr, file) + formatter = get_fmtr(parser, **kwargs) if isinstance(formatter, ColorHelpFormatter): setattr(formatter, _color_attr, - getattr(parser, _color_attr, False)) + getattr(parser, 'color', False)) return formatter return _get_formatter class AutoPageArgumentParser(argparse.ArgumentParser, _ActionsContainer): @_substitute_formatter - def _get_formatter(self) -> _HelpFormatter: - return super()._get_formatter() - - -ArgumentParser = AutoPageArgumentParser # type: ignore -HelpFormatter = ColorHelpFormatter # type: ignore -RawDescriptionHelpFormatter = ColorRawDescriptionHelpFormatter # type: ignore -RawTextHelpFormatter = ColorRawTextHelpFormatter # type: ignore -ArgumentDefaultsHelpFormatter = ColorArgDefaultsHelpFormatter # type: ignore -MetavarTypeHelpFormatter = ColorMetavarTypeHelpFormatter # type: ignore + def _get_formatter(self, file: Optional[TextIO] = None) -> _HelpFormatter: + kwargs = {} + if file is not None: + kwargs['file'] = file + return super()._get_formatter(**kwargs) + + +ArgumentParser = AutoPageArgumentParser # type: ignore +if sys.version_info < (3, 14): + HelpFormatter = ColorHelpFormatter # type: ignore + RawDescriptionHelpFormatter = \ + ColorRawDescriptionHelpFormatter # type: ignore + RawTextHelpFormatter = \ + ColorRawTextHelpFormatter # type: ignore + ArgumentDefaultsHelpFormatter = \ + ColorArgDefaultsHelpFormatter # type: ignore + MetavarTypeHelpFormatter = \ + ColorMetavarTypeHelpFormatter # type: ignore def monkey_patch() -> ContextManager: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage/tests/test_argparse.py new/autopage-0.6.0/autopage/tests/test_argparse.py --- old/autopage-0.5.2/autopage/tests/test_argparse.py 2021-11-21 02:44:08.000000000 +0100 +++ new/autopage-0.6.0/autopage/tests/test_argparse.py 2026-01-30 04:12:14.000000000 +0100 @@ -22,6 +22,7 @@ class ArgumentParseTest(fixtures.TestWithFixtures): def setUp(self) -> None: + self.useFixture(fixtures.EnvironmentVariable('PYTHON_COLORS', '1')) patch_ap = self.useFixture(fixtures.MockPatch('autopage.AutoPager')) self.pager = patch_ap.mock self.stream = self.useFixture(fixtures.StringStream('stdout')).stream @@ -43,7 +44,8 @@ reset_on_exit=False) self.pager.return_value.__enter__.assert_called_once() self.stream.seek(0) - self.assertEqual('\033' in self.stream.read(), color) + output = self.stream.read() + self.assertEqual(any(c in output for c in ('\033', '\x1b')), color) def test_argparse_no_color(self) -> None: self.test_argparse(color=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage/tests/test_autopage.py new/autopage-0.6.0/autopage/tests/test_autopage.py --- old/autopage-0.5.2/autopage/tests/test_autopage.py 2023-10-16 11:01:59.000000000 +0200 +++ new/autopage-0.6.0/autopage/tests/test_autopage.py 2026-01-30 04:12:14.000000000 +0100 @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import codecs import subprocess import sys import unittest @@ -58,7 +59,7 @@ env=get_env.return_value, bufsize=-1, universal_newlines=True, - encoding='UTF-8', + encoding='utf-8', errors='strict', stdin=subprocess.PIPE, stdout=None) @@ -84,7 +85,7 @@ env=get_env.return_value, bufsize=-1, universal_newlines=True, - encoding='UTF-8', + encoding='utf-8', errors='strict', stdin=subprocess.PIPE, stdout=None) @@ -100,7 +101,7 @@ env=get_env.return_value, bufsize=-1, universal_newlines=True, - encoding='UTF-8', + encoding='utf-8', errors='strict', stdin=subprocess.PIPE, stdout=None) @@ -288,6 +289,17 @@ self.assertRaises(MyException, run) self.assertEqual(1, self.ap.exit_code()) + def test_exception_on_error_default(self) -> None: + class MyException(Exception): + pass + + def run() -> None: + with self.ap: + raise MyException + + self.assertRaises(MyException, run) + self.assertEqual(2, self.ap.exit_code(on_error_default=2)) + def test_base_exception(self) -> None: class MyBaseException(BaseException): pass @@ -315,6 +327,30 @@ self.assertRaises(SystemExit, run) self.assertEqual(42, self.ap.exit_code()) + def test_system_exit_on_error_default(self) -> None: + def run() -> None: + with self.ap: + raise SystemExit(42) + + self.assertRaises(SystemExit, run) + self.assertEqual(42, self.ap.exit_code(on_error_default=3)) + + def test_system_exit_string(self) -> None: + def run() -> None: + with self.ap: + raise SystemExit("nope") + + self.assertRaises(SystemExit, run) + self.assertEqual(1, self.ap.exit_code()) + + def test_system_exit_string_on_error_default(self) -> None: + def run() -> None: + with self.ap: + raise SystemExit("nope") + + self.assertRaises(SystemExit, run) + self.assertEqual(3, self.ap.exit_code(on_error_default=3)) + class CleanupTest(unittest.TestCase): def test_no_pager_stream_not_closed(self) -> None: @@ -412,7 +448,7 @@ self.stream = out.stream self.default_lb = self.stream.line_buffering self.default_errors = self.stream.errors - self.encoding = self.stream.encoding + self.encoding = codecs.lookup(self.stream.encoding).name def test_line_buffering_on(self) -> None: ap = autopage.AutoPager(self.stream, line_buffering=True) @@ -420,7 +456,7 @@ self.addCleanup(ap._out.close) self.assertTrue(ap._out.line_buffering) self.assertEqual(self.default_errors, ap._out.errors) - self.assertEqual(self.encoding, ap._out.encoding) + self.assertEqual(self.encoding, ap._encoding()) self.assertIs(True, ap._line_buffering()) self.assertEqual(self.default_errors, ap._errors()) @@ -430,7 +466,7 @@ self.addCleanup(ap._out.close) self.assertFalse(ap._out.line_buffering) self.assertEqual(self.default_errors, ap._out.errors) - self.assertEqual(self.encoding, ap._out.encoding) + self.assertEqual(self.encoding, ap._encoding()) self.assertIs(False, ap._line_buffering()) self.assertEqual(self.default_errors, ap._errors()) @@ -441,7 +477,8 @@ self.addCleanup(ap._out.close) self.assertTrue(sys.stdout.line_buffering) self.assertEqual(self.default_errors, sys.stdout.errors) - self.assertEqual(self.encoding, sys.stdout.encoding) + self.assertEqual(self.encoding, + codecs.lookup(sys.stdout.encoding).name) def test_errors(self) -> None: ap = autopage.AutoPager(self.stream, @@ -451,7 +488,7 @@ self.assertEqual(self.default_lb, ap._out.line_buffering) self.assertEqual('namereplace', ap._out.errors) self.assertNotEqual(self.default_errors, ap._out.errors) - self.assertEqual(self.encoding, ap._out.encoding) + self.assertEqual(self.encoding, ap._encoding()) self.assertEqual('namereplace', ap._errors()) self.assertEqual(self.default_lb, ap._line_buffering()) @@ -463,7 +500,7 @@ self.assertEqual(self.default_lb, ap._out.line_buffering) self.assertEqual('namereplace', ap._out.errors) self.assertNotEqual(self.default_errors, ap._out.errors) - self.assertEqual(self.encoding, ap._out.encoding) + self.assertEqual(self.encoding, ap._encoding()) self.assertEqual('namereplace', ap._errors()) self.assertEqual(self.default_lb, ap._line_buffering()) @@ -481,6 +518,6 @@ self.assertTrue(ap._out.line_buffering) self.assertEqual('namereplace', ap._out.errors) self.assertNotEqual(self.default_errors, ap._out.errors) - self.assertEqual(self.encoding, ap._out.encoding) + self.assertEqual(self.encoding, ap._encoding()) self.assertIs(True, ap._line_buffering()) self.assertEqual('namereplace', ap._errors()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage.egg-info/PKG-INFO new/autopage-0.6.0/autopage.egg-info/PKG-INFO --- old/autopage-0.5.2/autopage.egg-info/PKG-INFO 2023-10-16 11:19:58.000000000 +0200 +++ new/autopage-0.6.0/autopage.egg-info/PKG-INFO 2026-01-30 04:34:31.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: autopage -Version: 0.5.2 +Version: 0.6.0 Summary: A library to provide automatic paging for console output Home-page: https://github.com/zaneb/autopage Author: Zane Bitter @@ -16,6 +16,9 @@ Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: 3.15 Classifier: Operating System :: POSIX Classifier: Environment :: Console Classifier: Intended Audience :: Developers @@ -26,6 +29,7 @@ Requires-Python: >=3.6 Description-Content-Type: text/markdown License-File: LICENSE +Dynamic: license-file # autopage @@ -43,7 +47,7 @@ ## License -© 2020-2022 by Zane Bitter +© 2020-2026 by Zane Bitter Open Source licensed under the terms of the Apache Software License, version 2.0. @@ -60,7 +64,7 @@ Autopage is [packaged for Fedora](https://packages.fedoraproject.org/pkgs/python-autopage/python3-autopage/) -35 and later. To install: +35 and later, and EPEL 9. To install: # dnf install python3-autopage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/autopage.egg-info/SOURCES.txt new/autopage-0.6.0/autopage.egg-info/SOURCES.txt --- old/autopage-0.5.2/autopage.egg-info/SOURCES.txt 2023-10-16 11:19:58.000000000 +0200 +++ new/autopage-0.6.0/autopage.egg-info/SOURCES.txt 2026-01-30 04:34:31.000000000 +0100 @@ -4,84 +4,6 @@ pyproject.toml setup.cfg tox.ini -.tox/.package/lib/python3.11/site-packages/pip/py.typed -.tox/.pkg/lib/python3.11/site-packages/pip/py.typed -.tox/mypy/lib/python3.11/site-packages/autopage/py.typed -.tox/mypy/lib/python3.11/site-packages/pip/py.typed -.tox/mypy/lib64/python3.11/site-packages/mypy/py.typed -.tox/pep8/lib/python3.11/site-packages/autopage/py.typed -.tox/pep8/lib/python3.11/site-packages/pip/py.typed -.tox/py310/lib/python3.10/site-packages/_pytest/py.typed -.tox/py310/lib/python3.10/site-packages/autopage/py.typed -.tox/py310/lib/python3.10/site-packages/exceptiongroup/py.typed -.tox/py310/lib/python3.10/site-packages/iniconfig/py.typed -.tox/py310/lib/python3.10/site-packages/packaging/py.typed -.tox/py310/lib/python3.10/site-packages/pip/py.typed -.tox/py310/lib/python3.10/site-packages/pytest/py.typed -.tox/py310/lib/python3.10/site-packages/tomli/py.typed -.tox/py311/lib/python3.11/site-packages/_pytest/py.typed -.tox/py311/lib/python3.11/site-packages/autopage/py.typed -.tox/py311/lib/python3.11/site-packages/iniconfig/py.typed -.tox/py311/lib/python3.11/site-packages/packaging/py.typed -.tox/py311/lib/python3.11/site-packages/pip/py.typed -.tox/py311/lib/python3.11/site-packages/pytest/py.typed -.tox/py312/lib/python3.12/site-packages/_pytest/py.typed -.tox/py312/lib/python3.12/site-packages/autopage/py.typed -.tox/py312/lib/python3.12/site-packages/iniconfig/py.typed -.tox/py312/lib/python3.12/site-packages/packaging/py.typed -.tox/py312/lib/python3.12/site-packages/pip/py.typed -.tox/py312/lib/python3.12/site-packages/pluggy/py.typed -.tox/py312/lib/python3.12/site-packages/pytest/py.typed -.tox/py36/lib/python3.6/site-packages/_pytest/py.typed -.tox/py36/lib/python3.6/site-packages/attr/py.typed -.tox/py36/lib/python3.6/site-packages/attrs/py.typed -.tox/py36/lib/python3.6/site-packages/autopage/py.typed -.tox/py36/lib/python3.6/site-packages/importlib_metadata/py.typed -.tox/py36/lib/python3.6/site-packages/iniconfig/py.typed -.tox/py36/lib/python3.6/site-packages/packaging/py.typed -.tox/py36/lib/python3.6/site-packages/pip/py.typed -.tox/py36/lib/python3.6/site-packages/py/py.typed -.tox/py36/lib/python3.6/site-packages/py/_vendored_packages/iniconfig/py.typed -.tox/py36/lib/python3.6/site-packages/pyparsing/py.typed -.tox/py36/lib/python3.6/site-packages/pytest/py.typed -.tox/py36/lib/python3.6/site-packages/tomli/py.typed -.tox/py37/lib/python3.7/site-packages/_pytest/py.typed -.tox/py37/lib/python3.7/site-packages/autopage/py.typed -.tox/py37/lib/python3.7/site-packages/exceptiongroup/py.typed -.tox/py37/lib/python3.7/site-packages/importlib_metadata/py.typed -.tox/py37/lib/python3.7/site-packages/iniconfig/py.typed -.tox/py37/lib/python3.7/site-packages/packaging/py.typed -.tox/py37/lib/python3.7/site-packages/pip/py.typed -.tox/py37/lib/python3.7/site-packages/pytest/py.typed -.tox/py37/lib/python3.7/site-packages/tomli/py.typed -.tox/py38/lib/python3.8/site-packages/_pytest/py.typed -.tox/py38/lib/python3.8/site-packages/autopage/py.typed -.tox/py38/lib/python3.8/site-packages/exceptiongroup/py.typed -.tox/py38/lib/python3.8/site-packages/iniconfig/py.typed -.tox/py38/lib/python3.8/site-packages/packaging/py.typed -.tox/py38/lib/python3.8/site-packages/pip/py.typed -.tox/py38/lib/python3.8/site-packages/pytest/py.typed -.tox/py38/lib/python3.8/site-packages/tomli/py.typed -.tox/py39/lib/python3.9/site-packages/_pytest/py.typed -.tox/py39/lib/python3.9/site-packages/autopage/py.typed -.tox/py39/lib/python3.9/site-packages/exceptiongroup/py.typed -.tox/py39/lib/python3.9/site-packages/iniconfig/py.typed -.tox/py39/lib/python3.9/site-packages/packaging/py.typed -.tox/py39/lib/python3.9/site-packages/pip/py.typed -.tox/py39/lib/python3.9/site-packages/pytest/py.typed -.tox/py39/lib/python3.9/site-packages/tomli/py.typed -.tox/pypy/site-packages/attr/py.typed -.tox/pypy/site-packages/packaging/py.typed -.tox/pypy/site-packages/py/py.typed -.tox/pypy/site-packages/py/_vendored_packages/iniconfig/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/_pytest/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/autopage/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/exceptiongroup/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/iniconfig/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/packaging/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/pip/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/pytest/py.typed -.tox/pypy3/lib/pypy3.9/site-packages/tomli/py.typed autopage/__init__.py autopage/argparse.py autopage/command.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/setup.cfg new/autopage-0.6.0/setup.cfg --- old/autopage-0.5.2/setup.cfg 2023-10-16 11:19:58.986908000 +0200 +++ new/autopage-0.6.0/setup.cfg 2026-01-30 04:34:31.680539600 +0100 @@ -1,6 +1,6 @@ [metadata] name = autopage -version = 0.5.2 +version = 0.6.0 author = Zane Bitter author_email = [email protected] description = A library to provide automatic paging for console output @@ -19,6 +19,9 @@ Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 + Programming Language :: Python :: 3.14 + Programming Language :: Python :: 3.15 Operating System :: POSIX Environment :: Console Intended Audience :: Developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autopage-0.5.2/tox.ini new/autopage-0.6.0/tox.ini --- old/autopage-0.5.2/tox.ini 2023-06-16 03:21:27.000000000 +0200 +++ new/autopage-0.6.0/tox.ini 2026-01-30 03:47:14.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = pep8,mypy,pypy3,py36,py37,py38,py39,py310,py311,py312 +envlist = pep8,mypy,pypy3,py36,py37,py38,py39,py310,py311,py312,py313,py314,py315 isolated_build = true [testenv] @@ -8,16 +8,16 @@ fixtures fixtures[streams] pip>=19;python_version<'3.7' - testtools;python_version<'3.7' + testtools;python_version<'3.10' commands = - pytest + pytest {posargs} [testenv:pep8] deps = flake8 commands = - flake8 autopage + flake8 {posargs} autopage [testenv:mypy] -deps = mypy>=0.900,<1.3.0 +deps = mypy>=1.5.0,<1.20.0 commands = - mypy -p autopage + mypy -p autopage {posargs}
