From 8f8560c9450488fc4c1aad37f2042ce4888e3005 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 3 Mar 2023 15:50:04 +0000 Subject: [PATCH] drop redundant __future__ imports --- .meta/mkcompletion.py | 2 -- .meta/mkdocs.py | 2 -- benchmarks/benchmarks.py | 2 -- examples/7zx.py | 2 -- examples/parallel_bars.py | 2 -- examples/redirect_print.py | 2 -- tests/tests_contrib_logging.py | 2 -- tests/tests_dask.py | 2 -- tests/tests_keras.py | 2 -- tests/tests_perf.py | 2 -- tests/tests_synchronisation.py | 2 -- tests/tests_tqdm.py | 2 -- tqdm/contrib/concurrent.py | 2 -- tqdm/contrib/discord.py | 2 -- tqdm/contrib/itertools.py | 2 -- tqdm/contrib/logging.py | 2 -- tqdm/contrib/slack.py | 2 -- tqdm/contrib/telegram.py | 2 -- tqdm/contrib/utils_worker.py | 2 -- tqdm/dask.py | 2 -- tqdm/gui.py | 2 -- tqdm/keras.py | 2 -- tqdm/notebook.py | 4 ---- tqdm/rich.py | 2 -- tqdm/std.py | 2 -- tqdm/tk.py | 2 -- 26 files changed, 54 deletions(-) diff --git a/.meta/mkcompletion.py b/.meta/mkcompletion.py index 8c56967b..387bd307 100644 --- a/.meta/mkcompletion.py +++ b/.meta/mkcompletion.py @@ -1,8 +1,6 @@ """ Auto-generate tqdm/completion.sh from docstrings. """ -from __future__ import print_function - import re import sys from io import open as io_open diff --git a/.meta/mkdocs.py b/.meta/mkdocs.py index 40a9f71d..6fdc0bad 100644 --- a/.meta/mkdocs.py +++ b/.meta/mkdocs.py @@ -1,8 +1,6 @@ """ Auto-generate README.rst from .meta/.readme.rst and docstrings. """ -from __future__ import print_function - import sys from io import open as io_open from os import path diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index fcf43bbe..341dead1 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -1,7 +1,5 @@ # Write the benchmarking functions here. # See "Writing benchmarks" in the asv docs for more information. -from __future__ import division - from functools import partial diff --git a/examples/7zx.py b/examples/7zx.py index 3d152542..18d7e333 100644 --- a/examples/7zx.py +++ b/examples/7zx.py @@ -18,8 +18,6 @@ Options: NOTSET -d, --debug-trace Print lots of debugging information (-D NOTSET) """ -from __future__ import print_function - import io import logging import os diff --git a/examples/parallel_bars.py b/examples/parallel_bars.py index c6aef292..14e9ca03 100644 --- a/examples/parallel_bars.py +++ b/examples/parallel_bars.py @@ -1,5 +1,3 @@ -from __future__ import print_function - from concurrent.futures import ThreadPoolExecutor from functools import partial from multiprocessing import Pool, RLock, freeze_support diff --git a/examples/redirect_print.py b/examples/redirect_print.py index 0f9721ee..38e6b4f8 100644 --- a/examples/redirect_print.py +++ b/examples/redirect_print.py @@ -10,8 +10,6 @@ any input string to `tqdm.write()`, and supply the arguments A reusable canonical example is given below: """ -from __future__ import print_function - import contextlib import sys from time import sleep diff --git a/tests/tests_contrib_logging.py b/tests/tests_contrib_logging.py index 6f675dd7..b8d60b65 100644 --- a/tests/tests_contrib_logging.py +++ b/tests/tests_contrib_logging.py @@ -1,7 +1,5 @@ # pylint: disable=missing-module-docstring, missing-class-docstring # pylint: disable=missing-function-docstring, no-self-use -from __future__ import absolute_import - import logging import logging.handlers import sys diff --git a/tests/tests_dask.py b/tests/tests_dask.py index 8bf4b64f..16992bf3 100644 --- a/tests/tests_dask.py +++ b/tests/tests_dask.py @@ -1,5 +1,3 @@ -from __future__ import division - from time import sleep from .tests_tqdm import importorskip, mark diff --git a/tests/tests_keras.py b/tests/tests_keras.py index 220f9461..32d64700 100644 --- a/tests/tests_keras.py +++ b/tests/tests_keras.py @@ -1,5 +1,3 @@ -from __future__ import division - from .tests_tqdm import importorskip, mark pytestmark = mark.slow diff --git a/tests/tests_perf.py b/tests/tests_perf.py index 92bed375..fd12449c 100644 --- a/tests/tests_perf.py +++ b/tests/tests_perf.py @@ -1,5 +1,3 @@ -from __future__ import division, print_function - import sys from contextlib import contextmanager from functools import wraps diff --git a/tests/tests_synchronisation.py b/tests/tests_synchronisation.py index 5b0ad1df..0cd9190f 100644 --- a/tests/tests_synchronisation.py +++ b/tests/tests_synchronisation.py @@ -1,5 +1,3 @@ -from __future__ import division - from functools import wraps from threading import Event from time import sleep, time diff --git a/tests/tests_tqdm.py b/tests/tests_tqdm.py index 513be501..c3ae9b59 100644 --- a/tests/tests_tqdm.py +++ b/tests/tests_tqdm.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- # Advice: use repr(our_file.read()) to print the full output of tqdm # (else '\r' will replace the previous lines and you'll see only the latest. -from __future__ import print_function - import csv import os import re diff --git a/tqdm/contrib/concurrent.py b/tqdm/contrib/concurrent.py index ded24aca..8ec6f59a 100644 --- a/tqdm/contrib/concurrent.py +++ b/tqdm/contrib/concurrent.py @@ -1,8 +1,6 @@ """ Thin wrappers around `concurrent.futures`. """ -from __future__ import absolute_import - from contextlib import contextmanager from ..auto import tqdm as tqdm_auto diff --git a/tqdm/contrib/discord.py b/tqdm/contrib/discord.py index fe14078f..b8366fb6 100644 --- a/tqdm/contrib/discord.py +++ b/tqdm/contrib/discord.py @@ -8,8 +8,6 @@ Usage: ![screenshot](https://img.tqdm.ml/screenshot-discord.png) """ -from __future__ import absolute_import - import logging from os import getenv diff --git a/tqdm/contrib/itertools.py b/tqdm/contrib/itertools.py index 5f22505a..e67651a4 100644 --- a/tqdm/contrib/itertools.py +++ b/tqdm/contrib/itertools.py @@ -1,8 +1,6 @@ """ Thin wrappers around `itertools`. """ -from __future__ import absolute_import - import itertools from ..auto import tqdm as tqdm_auto diff --git a/tqdm/contrib/logging.py b/tqdm/contrib/logging.py index cd9925ec..4fd602e9 100644 --- a/tqdm/contrib/logging.py +++ b/tqdm/contrib/logging.py @@ -1,8 +1,6 @@ """ Helper functionality for interoperability with stdlib `logging`. """ -from __future__ import absolute_import - import logging import sys from contextlib import contextmanager diff --git a/tqdm/contrib/slack.py b/tqdm/contrib/slack.py index 78b2c526..c8fe713a 100644 --- a/tqdm/contrib/slack.py +++ b/tqdm/contrib/slack.py @@ -8,8 +8,6 @@ Usage: ![screenshot](https://img.tqdm.ml/screenshot-slack.png) """ -from __future__ import absolute_import - import logging from os import getenv diff --git a/tqdm/contrib/telegram.py b/tqdm/contrib/telegram.py index 6eb598e2..b9a589b5 100644 --- a/tqdm/contrib/telegram.py +++ b/tqdm/contrib/telegram.py @@ -8,8 +8,6 @@ Usage: ![screenshot](https://img.tqdm.ml/screenshot-telegram.gif) """ -from __future__ import absolute_import - from os import getenv from warnings import warn diff --git a/tqdm/contrib/utils_worker.py b/tqdm/contrib/utils_worker.py index 17adda66..2a03a2a8 100644 --- a/tqdm/contrib/utils_worker.py +++ b/tqdm/contrib/utils_worker.py @@ -1,8 +1,6 @@ """ IO/concurrency helpers for `tqdm.contrib`. """ -from __future__ import absolute_import - from collections import deque from concurrent.futures import ThreadPoolExecutor diff --git a/tqdm/dask.py b/tqdm/dask.py index 6fc7504c..af9926a2 100644 --- a/tqdm/dask.py +++ b/tqdm/dask.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from functools import partial from dask.callbacks import Callback diff --git a/tqdm/gui.py b/tqdm/gui.py index 50014263..d52b9b66 100644 --- a/tqdm/gui.py +++ b/tqdm/gui.py @@ -8,8 +8,6 @@ Usage: """ # future division is important to divide integers and get as # a result precise floating numbers (instead of truncated int) -from __future__ import absolute_import, division - import re from warnings import warn diff --git a/tqdm/keras.py b/tqdm/keras.py index 523e62e9..96782d7e 100644 --- a/tqdm/keras.py +++ b/tqdm/keras.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division - from copy import copy from functools import partial diff --git a/tqdm/notebook.py b/tqdm/notebook.py index 05559ea7..d594b0f9 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -7,10 +7,6 @@ Usage: >>> for i in trange(10): ... ... """ -# future division is important to divide integers and get as -# a result precise floating numbers (instead of truncated int) -from __future__ import absolute_import, division - # import compatibility functions and utilities import re import sys diff --git a/tqdm/rich.py b/tqdm/rich.py index b3426f21..00e1ddf2 100644 --- a/tqdm/rich.py +++ b/tqdm/rich.py @@ -6,8 +6,6 @@ Usage: >>> for i in trange(10): ... ... """ -from __future__ import absolute_import - from warnings import warn from rich.progress import ( diff --git a/tqdm/std.py b/tqdm/std.py index 701151cb..ce96376e 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -7,8 +7,6 @@ Usage: >>> for i in trange(10): ... ... """ -from __future__ import absolute_import, division - import sys from collections import OrderedDict, defaultdict from contextlib import contextmanager diff --git a/tqdm/tk.py b/tqdm/tk.py index 1fc68d3f..2cf8a47b 100644 --- a/tqdm/tk.py +++ b/tqdm/tk.py @@ -6,8 +6,6 @@ Usage: >>> for i in trange(10): ... ... """ -from __future__ import absolute_import, division - import re import sys from warnings import warn