diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56b122907..d0ba34355 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,16 +69,13 @@ jobs: echo "$HOME/bin" >> $GITHUB_PATH - name: tox run: | - TIMEOUT=10m - if [[ "${{ matrix.python }}" = "2.7" ]]; then - TIMEOUT=15m - elif [[ "py${{ matrix.python }}-${{ matrix.os }}" = "py3.8-ubuntu" ]]; then - export TOXENV="py38-tf,py38-tf-keras" # full + if [[ "py${{ matrix.python }}-${{ matrix.os }}" = "py3.11-ubuntu" ]]; then + export TOXENV="py311-tf,py311-tf-keras" # full fi if [[ "${{ matrix.os }}" != "ubuntu" ]]; then - tox -e py${PYVER/./} # basic + tox -e py${PYVER/./} # basic else - timeout $TIMEOUT tox || timeout $TIMEOUT tox || timeout $TIMEOUT tox + timeout 5m tox || timeout 5m tox || timeout 5m tox fi env: PYVER: ${{ matrix.python }} diff --git a/.meta/.readme.rst b/.meta/.readme.rst index 4e325bcd2..753ae94ee 100644 --- a/.meta/.readme.rst +++ b/.meta/.readme.rst @@ -327,9 +327,6 @@ of a neat one-line progress bar. * The same applies to ``itertools``. * Some useful convenience functions can be found under ``tqdm.contrib``. -- `Hanging pipes in python2 `__: - when using ``tqdm`` on the CLI, you may need to use Python 3.5+ for correct - buffering. - `No intermediate output in docker-compose `__: use ``docker-compose run`` instead of ``docker-compose up`` and ``tty: true``. - Overriding defaults via environment variables: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b987ee21..533a8ab45 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,9 +97,9 @@ versions of Python.) 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 make sure -that each distribution has an alias to call the Python interpreter: -`python27` for Python 2.7's interpreter, `python32` for Python 3.2's, etc. +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). ### Alternative unit tests with pytest diff --git a/README.rst b/README.rst index defa9ad35..3daa4a341 100644 --- a/README.rst +++ b/README.rst @@ -327,9 +327,6 @@ of a neat one-line progress bar. * The same applies to ``itertools``. * Some useful convenience functions can be found under ``tqdm.contrib``. -- `Hanging pipes in python2 `__: - when using ``tqdm`` on the CLI, you may need to use Python 3.5+ for correct - buffering. - `No intermediate output in docker-compose `__: use ``docker-compose run`` instead of ``docker-compose up`` and ``tty: true``. - Overriding defaults via environment variables: diff --git a/asv.conf.json b/asv.conf.json index d826f85b4..27e7a89b1 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -6,7 +6,7 @@ "environment_type": "virtualenv", "build_command": ["PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} ."], "show_commit_url": "https://github.com/tqdm/tqdm/commit/", - // "pythons": ["2.7", "3.6"], + // "pythons": ["3.7", "3.11"], // "conda_channels": ["conda-forge", "defaults"], "matrix": { "alive-progress": [""], diff --git a/examples/async_coroutines.py b/examples/async_coroutines.py index 40f4f249d..3e3190508 100644 --- a/examples/async_coroutines.py +++ b/examples/async_coroutines.py @@ -1,6 +1,4 @@ -""" -Asynchronous examples using `asyncio`, `async` and `await` on `python>=3.7`. -""" +"""Asynchronous examples using `asyncio`, `async` and `await`.""" import asyncio from tqdm.asyncio import tqdm, trange diff --git a/examples/parallel_bars.py b/examples/parallel_bars.py index 5b969732c..b7e149413 100644 --- a/examples/parallel_bars.py +++ b/examples/parallel_bars.py @@ -21,8 +21,7 @@ def progresser(n, auto_position=True, write_safe=False, blocking=True, progress= sleep(interval) # NB: may not clear instances with higher `position` upon completion # since this worker may not know about other bars #796 - if write_safe: - # we think we know about other bars (currently only py3 threading) + if write_safe: # we think we know about other bars if n == 6: tqdm.write("n == 6 completed") return n + 1 diff --git a/tests/tests_asyncio.py b/tests/tests_asyncio.py index ddfa1b1b0..bdef569fa 100644 --- a/tests/tests_asyncio.py +++ b/tests/tests_asyncio.py @@ -1,4 +1,4 @@ -"""Tests `tqdm.asyncio` on `python>=3.7`.""" +"""Tests `tqdm.asyncio`.""" import asyncio from functools import partial from sys import platform diff --git a/tox.ini b/tox.ini index 4b63a438f..cd5dc1b07 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,7 @@ deps= numpy pandas rich - !py311-tf: tensorflow!=2.5.0 + tf: tensorflow!=2.5.0 keras: keras commands= pytest --cov=tqdm --cov-report= -W=ignore tests_notebook.ipynb --nbval --current-env --sanitize-with=.meta/nbval.ini diff --git a/tqdm/notebook.py b/tqdm/notebook.py index 0a14b4599..0f531ab94 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -10,6 +10,7 @@ # import compatibility functions and utilities import re import sys +from html import escape from weakref import proxy # to inherit from the tqdm class @@ -58,12 +59,6 @@ except ImportError: pass - # HTML encoding - try: # Py3 - from html import escape - except ImportError: # Py2 - from cgi import escape - __author__ = {"github.com/": ["lrq3000", "casperdcl", "alexanderkuk"]} __all__ = ['tqdm_notebook', 'tnrange', 'tqdm', 'trange'] WARN_NOIPYW = ("IProgress not found. Please update jupyter and ipywidgets."