Skip to content

Commit

Permalink
drop py2.6/3.2/3.3 and distutils (no longer tested)
Browse files Browse the repository at this point in the history
- drop py2.6 (replaces/closes tqdm#502 <- fixes tqdm#620, invalidates/fixes tqdm#127)
- drop distutils in favour of setup.cfg (fixes tqdm#723, fixes tqdm#721)
- related setuptools_scm (tqdm#722)
  • Loading branch information
casperdcl committed Nov 16, 2020
1 parent db86b89 commit f37a43a
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 248 deletions.
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Misc
include .coveragerc
include CONTRIBUTING.md
include LICENCE
include logo.png
# include images/logo.gif
include Makefile
Expand All @@ -16,7 +15,6 @@ include requirements-dev.txt

# Examples/Documentation
recursive-include examples *.py
include README.rst
include tqdm/tqdm.1
include tqdm/completion.sh
include DEMO.ipynb
6 changes: 3 additions & 3 deletions examples/7zx.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import io
__author__ = "Casper da Costa-Luis <casper.dcl@physics.org>"
__licence__ = "MPLv2.0"
__version__ = "0.2.1"
__version__ = "0.2.2"
__license__ = __licence__

RE_SCN = re.compile(r"([0-9]+)\s+([0-9]+)\s+(.*)$", flags=re.M)
Expand Down Expand Up @@ -59,8 +59,8 @@ def main():
if totals_s != totals[s]:
log.warn("%s: individual total %d != 7z total %d" % (
fn, totals_s, totals[s]))
fcomp = dict((n, int(c if args.compressed else u))
for (u, c, n) in finfo[:-1])
fcomp = {n: int(c if args.compressed else u)
for (u, c, n) in finfo[:-1]}
# log.debug(fcomp)
# zips : {'zipname' : {'filename' : int(size)}}
zips[fn] = fcomp
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=38.6.0"]
build-backend = "setuptools.build_meta"
91 changes: 91 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,94 @@ python_files = tests_*.py
testpaths = tests
addopts = -v --tb=short
usefixtures = pretest_posttest

[metadata]
name = tqdm
url = https://github.com/tqdm/tqdm
project_urls =
Changelog = https://tqdm.github.io/releases
Documentation = https://github.com/tqdm/tqdm#tqdm
Documentation (dev) = https://tqdm.github.io/docs/tqdm
Wiki = https://github.com/tqdm/tqdm/wiki
maintainer = tqdm developers
maintainer_email = python.tqdm@gmail.com
license = MPLv2.0, MIT Licences
license_file = LICENCE
description = Fast, Extensible Progress Meter
long_description = file: README.rst
long_description_content_type = text/x-rst
keywords = progressbar, progressmeter, progress, bar, meter, rate, eta, console, terminal, time
platforms = any
provides = tqdm
# Trove classifiers (https://pypi.org/pypi?%3Aaction=list_classifiers)
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Environment :: MacOS X
Environment :: Other Environment
Environment :: Win32 (MS Windows)
Environment :: X11 Applications
Framework :: IPython
Framework :: Jupyter
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: End Users/Desktop
Intended Audience :: Other Audience
Intended Audience :: System Administrators
License :: OSI Approved :: MIT License
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Operating System :: MacOS
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft
Operating System :: Microsoft :: MS-DOS
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: POSIX :: BSD
Operating System :: POSIX :: BSD :: FreeBSD
Operating System :: POSIX :: Linux
Operating System :: POSIX :: SunOS/Solaris
Operating System :: Unix
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation
Programming Language :: Python :: Implementation :: IronPython
Programming Language :: Python :: Implementation :: PyPy
Programming Language :: Unix Shell
Topic :: Desktop Environment
Topic :: Education :: Computer Aided Instruction (CAI)
Topic :: Education :: Testing
Topic :: Office/Business
Topic :: Other/Nonlisted Topic
Topic :: Software Development :: Build Tools
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Software Development :: Pre-processors
Topic :: Software Development :: User Interfaces
Topic :: System :: Installation/Setup
Topic :: System :: Logging
Topic :: System :: Monitoring
Topic :: System :: Shells
Topic :: Terminals
Topic :: Utilities

[options]
setup_requires = setuptools>=38.6.0
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
tests_require = pytest; flake8; coverage
include_package_data = True
packages = find:
[options.entry_points]
console_scripts =
tqdm = tqdm.cli:main
[options.package_data]
tqdm = CONTRIBUTING.md, examples/*.py, tqdm.1, completion.sh, requirements-dev.txt
[options.packages.find]
exclude = benchmarks, tests
107 changes: 3 additions & 104 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from io import open as io_open
from setuptools import setup
import os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup

def find_packages(where='.'):
# os.walk -> list[(dirname, list[subdirs], list[files])]
return [folder.replace("/", ".").lstrip(".")
for (folder, _, fils) in os.walk(where)
if "__init__.py" in fils]
import sys
from io import open as io_open

# Get version from tqdm/_version.py
__version__ = None
Expand All @@ -36,96 +27,4 @@ def find_packages(where='.'):
extras_require['dev'] = [i.strip().split('#', 1)[0].strip()
for i in fd.read().strip().split('\n')]

README_rst = ''
fndoc = os.path.join(src_dir, 'README.rst')
with io_open(fndoc, mode='r', encoding='utf-8') as fd:
README_rst = fd.read()
setup(
name='tqdm',
version=__version__,
description='Fast, Extensible Progress Meter',
long_description=README_rst,
license='MPLv2.0, MIT Licences',
url='https://github.com/tqdm/tqdm',
project_urls={'Changelog': 'https://tqdm.github.io/releases',
'Documentation': 'https://github.com/tqdm/tqdm#tqdm',
'Documentation (dev)': 'https://tqdm.github.io/docs/tqdm',
'Wiki': 'https://github.com/tqdm/tqdm/wiki'},
maintainer='tqdm developers',
maintainer_email='python.tqdm@gmail.com',
platforms=['any'],
packages=['tqdm'] + ['tqdm.' + i for i in find_packages('tqdm')],
provides=['tqdm'],
extras_require=extras_require,
entry_points={'console_scripts': ['tqdm=tqdm.cli:main'], },
package_data={'tqdm': ['CONTRIBUTING.md', 'LICENCE', 'examples/*.py',
'tqdm.1', 'completion.sh', 'requirements-dev.txt']},
python_requires='>=2.6, !=3.0.*, !=3.1.*',
classifiers=[
# Trove classifiers
# (https://pypi.org/pypi?%3Aaction=list_classifiers)
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Other Environment',
'Environment :: Win32 (MS Windows)',
'Environment :: X11 Applications',
'Framework :: IPython',
'Framework :: Jupyter',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Other Audience',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft',
'Operating System :: Microsoft :: MS-DOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: POSIX :: BSD',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: SunOS/Solaris',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: IronPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Unix Shell',
'Topic :: Desktop Environment',
'Topic :: Education :: Computer Aided Instruction (CAI)',
'Topic :: Education :: Testing',
'Topic :: Office/Business',
'Topic :: Other/Nonlisted Topic',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Pre-processors',
'Topic :: Software Development :: User Interfaces',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Logging',
'Topic :: System :: Monitoring',
'Topic :: System :: Shells',
'Topic :: Terminals',
'Topic :: Utilities'
],
keywords='progressbar progressmeter progress bar meter'
' rate eta console terminal time',
test_suite='pytest',
tests_require=['pytest', 'flake8', 'coverage'],
)
setup(version=__version__, extras_require=extras_require)
21 changes: 3 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# and then run "tox" from this directory.

[tox]
# deprecation warning: py{26,32,33,34}
envlist = py{26,27,33,34,35,36,37,38,39,py2,py3}{,-tf}{,-keras}, perf, flake8, setup.py
# deprecation warning: py{34}
envlist = py{27,34,35,36,37,38,39,py2,py3}{,-tf}{,-keras}, perf, flake8, setup.py
isolated_build = True

[coverage]
deps =
Expand Down Expand Up @@ -48,28 +49,12 @@ allowlist_externals = {[extra]allowlist_externals}

# no cython/numpy/pandas for py{py2,py3,26,33,34}

[testenv:py26]
deps =
pytest
pytest-cov
coverage
coveralls==1.2.0
codecov
pycparser==2.18
idna==2.7
commands =
{[coverage]commands}
codecov

[testenv:pypy]
deps = {[extra]deps}

[testenv:pypy3]
deps = {[extra]deps}

[testenv:py33]
deps = {[extra]deps}

[testenv:py34]
# py34-compatible pandas
deps = {[extra]deps}
Expand Down
2 changes: 1 addition & 1 deletion tqdm/_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .utils import CUR_OS, IS_WIN, IS_NIX, RE_ANSI, _range, _unich, _unicode, colorama, WeakSet, _basestring, _OrderedDict, FormatReplace, Comparable, SimpleTextIOWrapper, _is_utf, _supports_unicode, _is_ascii, _screen_shape_wrapper, _screen_shape_windows, _screen_shape_tput, _screen_shape_linux, _environ_cols_wrapper, _term_move_up # NOQA
from .utils import CUR_OS, IS_WIN, IS_NIX, RE_ANSI, _range, _unich, _unicode, colorama, _basestring, FormatReplace, Comparable, SimpleTextIOWrapper, _is_utf, _supports_unicode, _is_ascii, _screen_shape_wrapper, _screen_shape_windows, _screen_shape_tput, _screen_shape_linux, _environ_cols_wrapper, _term_move_up # NOQA
from .std import TqdmDeprecationWarning
from warnings import warn
warn("This function will be removed in tqdm==5.0.0\n"
Expand Down
17 changes: 9 additions & 8 deletions tqdm/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
... ...
"""
from __future__ import absolute_import, division
# compatibility functions and utilities
from .utils import _supports_unicode, _screen_shape_wrapper, _range, _unich, \
_term_move_up, _unicode, WeakSet, _basestring, _OrderedDict, \
Comparable, _is_ascii, FormatReplace, disp_len, disp_trim, \
SimpleTextIOWrapper, DisableOnWriteError, CallbackIOWrapper
from ._monitor import TMonitor
# native libraries
from collections import OrderedDict
from contextlib import contextmanager
from datetime import datetime, timedelta
from numbers import Number
from time import time
from warnings import warn
from weakref import WeakSet
import sys

from .utils import _supports_unicode, _screen_shape_wrapper, _range, _unich, \
_term_move_up, _unicode, _basestring, \
Comparable, _is_ascii, FormatReplace, disp_len, disp_trim, \
SimpleTextIOWrapper, DisableOnWriteError, CallbackIOWrapper
from ._monitor import TMonitor

__author__ = "https://github.com/tqdm/tqdm#contributions"
__all__ = ['tqdm', 'trange',
'TqdmTypeError', 'TqdmKeyError', 'TqdmWarning',
Expand Down Expand Up @@ -1443,7 +1444,7 @@ def set_postfix(self, ordered_dict=None, refresh=True, **kwargs):
kwargs : dict, optional
"""
# Sort in alphabetical order to be more deterministic
postfix = _OrderedDict([] if ordered_dict is None else ordered_dict)
postfix = OrderedDict([] if ordered_dict is None else ordered_dict)
for key in sorted(kwargs.keys()):
postfix[key] = kwargs[key]
# Preprocess stats according to datatype
Expand Down
Loading

0 comments on commit f37a43a

Please sign in to comment.