1
0
Fork 0

Adding upstream version 4.66.5.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 19:21:46 +01:00
parent 49887fb75a
commit 579fccd9fa
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
8 changed files with 20 additions and 11 deletions

View file

@ -39,7 +39,7 @@ repos:
- pytest-timeout
- pytest-asyncio
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
args: [-j8]

View file

@ -99,7 +99,7 @@ Note: to install all versions of the Python interpreter that are specified
in [tox.ini](https://github.com/tqdm/tqdm/blob/master/tox.ini),
you can use `MiniConda` to install a minimal setup. You must also ensure
that each distribution has an alias to call the Python interpreter
(e.g. `python311` for Python 3.11's interpreter).
(e.g. `python312` for Python 3.12's interpreter).
### Alternative unit tests with pytest

View file

@ -38,10 +38,10 @@ dependencies:
- build # `python -m build`
# `cd docs && pymake`
- mkdocs-material
- pydoc-markdown
- pygments
- pymdown-extensions
- pip:
- py-make >=0.1.0 # `make/pymake`
- mkdocs-minify-plugin # `cd docs && pymake`
- git+https://github.com/tqdm/jsmin@python3-only#egg=jsmin # `cd docs && pymake`
- git+https://github.com/tqdm/jsmin@fix-pip#egg=jsmin # `cd docs && pymake`
- pydoc-markdown >=4.6 # `cd docs && pymake`

View file

@ -58,6 +58,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: IronPython",

View file

@ -48,10 +48,14 @@ async def test_generators(capsys):
_, err = capsys.readouterr()
assert '9it' in err
with tqdm(acount(), desc="async_counter") as pbar:
acounter = acount()
try:
with tqdm(acounter, desc="async_counter") as pbar:
async for i in pbar:
if i >= 8:
break
finally:
await acounter.aclose()
_, err = capsys.readouterr()
assert '9it' in err

View file

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist=py{37,38,39,310,311,py3}{,-tf}{,-keras}, perf, check
envlist=py{37,38,39,310,311,312,py3}{,-tf}{,-keras}, perf, check
isolated_build=True
[gh-actions]
@ -14,6 +14,7 @@ python=
3.9: py39
3.10: py310
3.11: py311
3.12: py312
pypy-3.7: pypy3
[gh-actions:env]
PLATFORM=

View file

@ -5,6 +5,7 @@ import logging
import re
import sys
from ast import literal_eval as numeric
from textwrap import indent
from .std import TqdmKeyError, TqdmTypeError, tqdm
from .version import __version__
@ -177,7 +178,9 @@ def main(fp=sys.stderr, argv=None):
logging.basicConfig(level=getattr(logging, logLevel),
format="%(levelname)s:%(module)s:%(lineno)d:%(message)s")
d = tqdm.__doc__ + CLI_EXTRA_DOC
# py<3.13 doesn't dedent docstrings
d = (tqdm.__doc__ if sys.version_info < (3, 13)
else indent(tqdm.__doc__, " ")) + CLI_EXTRA_DOC
opt_types = dict(RE_OPTS.findall(d))
# opt_types['delim'] = 'chr'

View file

@ -14,7 +14,7 @@ from weakref import proxy
_range, _unich, _unicode, _basestring = range, chr, str, str
CUR_OS = sys.platform
IS_WIN = any(CUR_OS.startswith(i) for i in ['win32', 'cygwin'])
IS_NIX = any(CUR_OS.startswith(i) for i in ['aix', 'linux', 'darwin'])
IS_NIX = any(CUR_OS.startswith(i) for i in ['aix', 'linux', 'darwin', 'freebsd'])
RE_ANSI = re.compile(r"\x1b\[[;\d]*[A-Za-z]")
try: