Skip to content

Commit

Permalink
bump version, merge pull request #1113 from tqdm/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Feb 9, 2021
2 parents c58fc25 + ea06383 commit 94842e1
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
run: |
sudo apt-get install -yqq pandoc
pip install .[dev]
make build .dockerignore snapcraft.yaml
make build .dockerignore Dockerfile snapcraft.yaml
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/
/snapcraft.yaml
/tqdm_*.snap
/.dockerignore
/Dockerfile

# Unit test / coverage reports
/.tox/
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Casper da Costa-Luis <tqdm@caspersci.uk.to> casperdcl
Stephen Larroque <lrq3000@gmail.com>
Richard Sheridan <richard.sheridan@gmail.com>
Guangshuo Chen <guangshuo.chen@gmail.com> Guangshuo CHEN
Guangshuo Chen <guangshuo.chen@gmail.com> <guangshuo.chen@inria.fr>
Guangshuo Chen <guangshuo.chen@gmail.com> chengs <cgs.sjtu@gmail.com>
Expand Down
21 changes: 11 additions & 10 deletions .meta/.readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1131,16 +1131,17 @@ are:
==================== ======================================================== ==== ================================
Name ID SLoC Notes
==================== ======================================================== ==== ================================
Casper da Costa-Luis `casperdcl <https://github.com/casperdcl>`__ ~82% primary maintainer |Gift-Casper|
Stephen Larroque `lrq3000 <https://github.com/lrq3000>`__ ~11% team member
Casper da Costa-Luis `casperdcl <https://github.com/casperdcl>`__ ~81% primary maintainer |Gift-Casper|
Stephen Larroque `lrq3000 <https://github.com/lrq3000>`__ ~10% team member
Martin Zugnoni `martinzugnoni <https://github.com/martinzugnoni>`__ ~3%
Richard Sheridan `richardsheridan <https://github.com/richardsheridan>`__ ~1%
Guangshuo Chen `chengs <https://github.com/chengs>`__ ~1%
Kyle Altendorf `altendky <https://github.com/altendky>`__ <1%
Hadrien Mary `hadim <https://github.com/hadim>`__ <1% team member
Matthew Stevens `mjstevens777 <https://github.com/mjstevens777>`__ <1%
Hadrien Mary `hadim <https://github.com/hadim>`__ <1% team member
Ivan Ivanov `obiwanus <https://github.com/obiwanus>`__ <1%
Daniel Panteleit `danielpanteleit <https://github.com/danielpanteleit>`__ <1%
Jona Haag `jonashaag <https://github.com/jonashaag>`__ <1%
Jonas Haag `jonashaag <https://github.com/jonashaag>`__ <1%
James E. King III `jeking3 <https://github.com/jeking3>`__ <1%
Noam Yorav-Raphael `noamraph <https://github.com/noamraph>`__ <1% original author
Mikhail Korobov `kmike <https://github.com/kmike>`__ <1% team member
Expand All @@ -1163,10 +1164,10 @@ Citation information: |DOI|
|README-Hits| (Since 19 May 2016)

.. |Logo| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif
.. |Screenshot| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm.gif
.. |Video| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/video.jpg
.. |Screenshot| image:: https://raw.githubusercontent.com/tqdm/img/master/tqdm.gif
.. |Video| image:: https://raw.githubusercontent.com/tqdm/img/master/video.jpg
:target: https://tqdm.github.io/video
.. |Slides| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/slides.jpg
.. |Slides| image:: https://raw.githubusercontent.com/tqdm/img/master/slides.jpg
:target: https://tqdm.github.io/PyData2019/slides.html
.. |Build-Status| image:: https://img.shields.io/github/workflow/status/tqdm/tqdm/Test/master?logo=GitHub
:target: https://github.com/tqdm/tqdm/actions?query=workflow%3ATest
Expand Down Expand Up @@ -1222,8 +1223,8 @@ Citation information: |DOI|
:target: https://doi.org/10.5281/zenodo.595120
.. |binder-demo| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/tqdm/tqdm/master?filepath=DEMO.ipynb
.. |Screenshot-Jupyter1| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-1.gif
.. |Screenshot-Jupyter2| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-2.gif
.. |Screenshot-Jupyter3| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-3.gif
.. |Screenshot-Jupyter1| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-1.gif
.. |Screenshot-Jupyter2| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-2.gif
.. |Screenshot-Jupyter3| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-3.gif
.. |README-Hits| image:: https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&style=social&r=https://github.com/tqdm/tqdm&l=https://caspersci.uk.to/images/tqdm.png&f=https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif
:target: https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&a=plot&r=https://github.com/tqdm/tqdm&l=https://caspersci.uk.to/images/tqdm.png&f=https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif&style=social
2 changes: 1 addition & 1 deletion .meta/.tqdm.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% TQDM(1) tqdm User Manuals
% tqdm developers <https://github.com/tqdm>
% 2015-2020
% 2015-2021

# NAME

Expand Down
12 changes: 4 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,16 @@ repos:
name: Check TODO
language: pygrep
entry: WIP
args: [-i]
types: [text]
exclude: ^(.pre-commit-config.yaml|.github/workflows/test.yml)$
args: [-i]
- id: metadata
name: Check metadata
language: system
entry: make testsetup
pass_filenames: false
- id: pytest
name: pytest quick
language: python
entry: pytest
args: ['-qq', '--durations=1', '-k=not slow']
pass_filenames: false
types: [python]
language: python
pass_filenames: false
additional_dependencies:
- numpy
- pandas
Expand All @@ -47,6 +42,7 @@ repos:
rev: 3.8.4
hooks:
- id: flake8
args: ['-j8']
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
Expand Down
4 changes: 2 additions & 2 deletions DEMO.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"![Screenshot](https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm.gif)|[![Video](https://raw.githubusercontent.com/tqdm/tqdm/master/images/video.jpg)](https://tqdm.github.io/video) [![Slides](https://raw.githubusercontent.com/tqdm/tqdm/master/images/slides.jpg)](https://tqdm.github.io/PyData2019/slides.html)\n",
"![Screenshot](https://raw.githubusercontent.com/tqdm/img/master/tqdm.gif)|[![Video](https://raw.githubusercontent.com/tqdm/img/master/video.jpg)](https://tqdm.github.io/video) [![Slides](https://raw.githubusercontent.com/tqdm/img/master/slides.jpg)](https://tqdm.github.io/PyData2019/slides.html)\n",
"-|-\n",
"\n",
"It can also be executed as a module with pipes:"
Expand Down Expand Up @@ -1553,7 +1553,7 @@
"bars and colour hints (blue: normal, green: completed, red:\n",
"error/interrupt, light blue: no ETA); as demonstrated below.\n",
"\n",
"![Screenshot-Jupyter3](https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-3.gif)\n",
"![Screenshot-Jupyter3](https://raw.githubusercontent.com/tqdm/img/master/jupyter-3.gif)\n",
"\n",
"The `notebook` version supports percentage or pixels for overall width\n",
"(e.g.: `ncols='100%'` or `ncols='480px'`).\n",
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Exceptions or notable authors are listed below
in reverse chronological order:

* files: *
MPLv2.0 2015-2020 (c) Casper da Costa-Luis
MPLv2.0 2015-2021 (c) Casper da Costa-Luis
[casperdcl](https://github.com/casperdcl).
* files: tqdm/_tqdm.py
MIT 2016 (c) [PR #96] on behalf of Google Inc.
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ testsetup:

testcoverage:
@make coverclean
pytest -k "not perf" --cov=tqdm --cov-fail-under=80
pytest -k "not perf" --cov=tqdm --cov-report=xml --cov-report=term --cov-fail-under=80

testperf:
# do not use coverage (which is extremely slow)
Expand Down Expand Up @@ -107,6 +107,9 @@ snapcraft.yaml: .meta/mksnap.py
.dockerignore:
@+python -c "fd=open('.dockerignore', 'w'); fd.write('*\n!dist/*.whl\n')"

Dockerfile:
@+python -c 'fd=open("Dockerfile", "w"); fd.write("FROM python:3.8-alpine\nCOPY dist/*.whl .\nRUN pip install -U $$(ls ./*.whl) && rm ./*.whl\nENTRYPOINT [\"tqdm\"]\n")'

distclean:
@+make coverclean
@+make prebuildclean
Expand Down Expand Up @@ -167,6 +170,7 @@ snap:
docker:
@make build
@make .dockerignore
@make Dockerfile
docker build . -t tqdm/tqdm
docker tag tqdm/tqdm:latest tqdm/tqdm:$(shell docker run -i --rm tqdm/tqdm -v)
none:
Expand Down
21 changes: 11 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1348,16 +1348,17 @@ are:
==================== ======================================================== ==== ================================
Name ID SLoC Notes
==================== ======================================================== ==== ================================
Casper da Costa-Luis `casperdcl <https://github.com/casperdcl>`__ ~82% primary maintainer |Gift-Casper|
Stephen Larroque `lrq3000 <https://github.com/lrq3000>`__ ~11% team member
Casper da Costa-Luis `casperdcl <https://github.com/casperdcl>`__ ~81% primary maintainer |Gift-Casper|
Stephen Larroque `lrq3000 <https://github.com/lrq3000>`__ ~10% team member
Martin Zugnoni `martinzugnoni <https://github.com/martinzugnoni>`__ ~3%
Richard Sheridan `richardsheridan <https://github.com/richardsheridan>`__ ~1%
Guangshuo Chen `chengs <https://github.com/chengs>`__ ~1%
Kyle Altendorf `altendky <https://github.com/altendky>`__ <1%
Hadrien Mary `hadim <https://github.com/hadim>`__ <1% team member
Matthew Stevens `mjstevens777 <https://github.com/mjstevens777>`__ <1%
Hadrien Mary `hadim <https://github.com/hadim>`__ <1% team member
Ivan Ivanov `obiwanus <https://github.com/obiwanus>`__ <1%
Daniel Panteleit `danielpanteleit <https://github.com/danielpanteleit>`__ <1%
Jona Haag `jonashaag <https://github.com/jonashaag>`__ <1%
Jonas Haag `jonashaag <https://github.com/jonashaag>`__ <1%
James E. King III `jeking3 <https://github.com/jeking3>`__ <1%
Noam Yorav-Raphael `noamraph <https://github.com/noamraph>`__ <1% original author
Mikhail Korobov `kmike <https://github.com/kmike>`__ <1% team member
Expand All @@ -1380,10 +1381,10 @@ Citation information: |DOI|
|README-Hits| (Since 19 May 2016)

.. |Logo| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif
.. |Screenshot| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm.gif
.. |Video| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/video.jpg
.. |Screenshot| image:: https://raw.githubusercontent.com/tqdm/img/master/tqdm.gif
.. |Video| image:: https://raw.githubusercontent.com/tqdm/img/master/video.jpg
:target: https://tqdm.github.io/video
.. |Slides| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/slides.jpg
.. |Slides| image:: https://raw.githubusercontent.com/tqdm/img/master/slides.jpg
:target: https://tqdm.github.io/PyData2019/slides.html
.. |Build-Status| image:: https://img.shields.io/github/workflow/status/tqdm/tqdm/Test/master?logo=GitHub
:target: https://github.com/tqdm/tqdm/actions?query=workflow%3ATest
Expand Down Expand Up @@ -1439,8 +1440,8 @@ Citation information: |DOI|
:target: https://doi.org/10.5281/zenodo.595120
.. |binder-demo| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/tqdm/tqdm/master?filepath=DEMO.ipynb
.. |Screenshot-Jupyter1| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-1.gif
.. |Screenshot-Jupyter2| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-2.gif
.. |Screenshot-Jupyter3| image:: https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm-jupyter-3.gif
.. |Screenshot-Jupyter1| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-1.gif
.. |Screenshot-Jupyter2| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-2.gif
.. |Screenshot-Jupyter3| image:: https://raw.githubusercontent.com/tqdm/img/master/jupyter-3.gif
.. |README-Hits| image:: https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&style=social&r=https://github.com/tqdm/tqdm&l=https://caspersci.uk.to/images/tqdm.png&f=https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif
:target: https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&a=plot&r=https://github.com/tqdm/tqdm&l=https://caspersci.uk.to/images/tqdm.png&f=https://raw.githubusercontent.com/tqdm/tqdm/master/images/logo.gif&style=social
Binary file removed images/slides.jpg
Binary file not shown.
Binary file removed images/tqdm-jupyter-1.gif
Binary file not shown.
Binary file removed images/tqdm-jupyter-2.gif
Binary file not shown.
Binary file removed images/tqdm-jupyter-3.gif
Binary file not shown.
Binary file removed images/video.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ classifiers=
[options]
setup_requires=setuptools>=42; setuptools_scm[toml]>=3.4
python_requires=>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
tests_require=pytest; flake8; coverage
tests_require=tox
include_package_data=True
packages=find:
[options.extras_require]
Expand Down
15 changes: 13 additions & 2 deletions tests/tests_tqdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ def test_clear():


def test_clear_disabled():
"""Test clearing bar display"""
"""Test disabled clear"""
with closing(StringIO()) as our_file:
with tqdm(total=10, file=our_file, desc='pos0 bar', disable=True,
bar_format='{l_bar}') as t:
Expand Down Expand Up @@ -1454,8 +1454,19 @@ def test_refresh():
assert after == [u'pos0 bar: 10%|', u'pos1 bar: 10%|']


def test_disabled_repr(capsys):
"""Test disabled repr"""
with tqdm(total=10, disable=True) as t:
str(t)
t.update()
print(t)
out, err = capsys.readouterr()
assert not err
assert out == ' 0%| | 0/10 [00:00<?, ?it/s]\n'


def test_disabled_refresh():
"""Test refresh bar display"""
"""Test disabled refresh"""
with closing(StringIO()) as our_file:
with tqdm(total=10, file=our_file, desc='pos0 bar', disable=True,
bar_format='{l_bar}', mininterval=999, miniters=999) as t:
Expand Down
9 changes: 0 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@ deps=
pytest-timeout
commands=pytest -k perf

[testenv:flake8]
deps=
flake8
flake8-bugbear
flake8-comprehensions
flake8-debugger
flake8-string-format
commands=flake8 -j 8 --count --statistics .

[testenv:setup.py]
deps=
docutils
Expand Down
14 changes: 8 additions & 6 deletions tqdm/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from __future__ import absolute_import, division

import sys
from collections import OrderedDict
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
from datetime import datetime, timedelta
from numbers import Number
Expand Down Expand Up @@ -1133,7 +1133,7 @@ def __exit__(self, exc_type, exc_value, traceback):
def __del__(self):
self.close()

def __repr__(self):
def __str__(self):
return self.format_meter(**self.format_dict)

@property
Expand Down Expand Up @@ -1420,14 +1420,16 @@ def moveto(self, n):
@property
def format_dict(self):
"""Public API for read-only member access."""
if self.disable and not hasattr(self, 'unit'):
return defaultdict(lambda: None, {
'n': self.n, 'total': self.total, 'elapsed': 0, 'unit': 'it'})
if self.dynamic_ncols:
self.ncols, self.nrows = self.dynamic_ncols(self.fp)
ncols, nrows = self.ncols, self.nrows
return {
'n': self.n, 'total': self.total,
'elapsed': self._time() - self.start_t if hasattr(self, 'start_t') else 0,
'ncols': ncols, 'nrows': nrows, 'prefix': self.desc, 'ascii': self.ascii,
'unit': self.unit, 'unit_scale': self.unit_scale,
'ncols': self.ncols, 'nrows': self.nrows, 'prefix': self.desc,
'ascii': self.ascii, 'unit': self.unit, 'unit_scale': self.unit_scale,
'rate': self._ema_dn() / self._ema_dt() if self._ema_dt() else None,
'bar_format': self.bar_format, 'postfix': self.postfix,
'unit_divisor': self.unit_divisor, 'initial': self.initial,
Expand Down Expand Up @@ -1464,7 +1466,7 @@ def display(self, msg=None, pos=None):

if pos:
self.moveto(pos)
self.sp(self.__repr__() if msg is None else msg)
self.sp(self.__str__() if msg is None else msg)
if pos:
self.moveto(-pos)
return True
Expand Down
2 changes: 1 addition & 1 deletion tqdm/tqdm.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 1.19.2
.\"
.TH "TQDM" "1" "2015\-2020" "tqdm User Manuals" ""
.TH "TQDM" "1" "2015\-2021" "tqdm User Manuals" ""
.hy
.SH NAME
.PP
Expand Down

0 comments on commit 94842e1

Please sign in to comment.