Skip to content

Commit

Permalink
bump version, merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Mar 5, 2021
2 parents 0ed778e + 299789b commit bcce20f
Show file tree
Hide file tree
Showing 26 changed files with 265 additions and 133 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
@@ -1,3 +1,2 @@
github: casperdcl
custom: https://caspersci.uk.to/donate
tidelift: pypi/tqdm
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -21,9 +21,7 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: dependencies
run: |
pip install -U pre-commit docutils pygments py-make
sudo apt-get install -yqq pandoc
run: pip install -U pre-commit
- uses: reviewdog/action-setup@v1
- if: github.event_name != 'schedule'
name: comment
Expand Down Expand Up @@ -144,7 +142,7 @@ jobs:
- name: Install
run: |
sudo apt-get install -yqq pandoc
pip install .[dev]
pip install -r .meta/requirements-build.txt
make build .dockerignore Dockerfile snapcraft.yaml
- id: dist
uses: casperdcl/deploy-pypi@v2
Expand Down
5 changes: 4 additions & 1 deletion .mailmap
@@ -1,4 +1,7 @@
Casper da Costa-Luis <tqdm@caspersci.uk.to> casperdcl
Casper da Costa-Luis <tqdm@cdcl.ml> <tqdm@caspersci.uk.to>
Casper da Costa-Luis <tqdm@cdcl.ml> <casper.dcl@physics.org>
Casper da Costa-Luis <tqdm@cdcl.ml> <casperdcl@users.noreply.github.com>
tqdm[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Stephen Larroque <lrq3000@gmail.com>
Richard Sheridan <richard.sheridan@gmail.com>
Guangshuo Chen <guangshuo.chen@gmail.com> Guangshuo CHEN
Expand Down
31 changes: 26 additions & 5 deletions .meta/.readme.rst
Expand Up @@ -140,7 +140,7 @@ Changelog
The list of all changes is available either on GitHub's Releases:
|GitHub-Status|, on the
`wiki <https://github.com/tqdm/tqdm/wiki/Releases>`__, or on the
`website <https://tqdm.github.io/releases/>`__.
`website <https://tqdm.github.io/releases>`__.


Usage
Expand Down Expand Up @@ -460,7 +460,10 @@ Submodules
"""`rich.progress` version."""
class tqdm.keras.TqdmCallback(keras.callbacks.Callback):
"""`keras` callback for epoch and batch progress."""
"""Keras callback for epoch and batch progress."""
class tqdm.dask.TqdmCallback(dask.callbacks.Callback):
"""Dask callback for task progress."""
``contrib``
Expand All @@ -470,8 +473,8 @@ The ``tqdm.contrib`` package also contains experimental modules:

- ``tqdm.contrib.itertools``: Thin wrappers around ``itertools``
- ``tqdm.contrib.concurrent``: Thin wrappers around ``concurrent.futures``
- ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com/>`__ bots
- ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org/>`__ bots
- ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com>`__ bots
- ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org>`__ bots
- ``tqdm.contrib.bells``: Automagically enables all optional features

* ``auto``, ``pandas``, ``discord``, ``telegram``
Expand Down Expand Up @@ -829,6 +832,24 @@ A ``keras`` callback is also available:
model.fit(..., verbose=0, callbacks=[TqdmCallback()])
Dask Integration
~~~~~~~~~~~~~~~~

A ``dask`` callback is also available:

.. code:: python
from tqdm.dask import TqdmCallback
with TqdmCallback(desc="compute"):
...
arr.compute()
# or use callback globally
cb = TqdmCallback(desc="global")
cb.register()
arr.compute()
IPython/Jupyter Integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1199,7 +1220,7 @@ Citation information: |DOI|
.. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/tqdm/tqdm/master.svg?logo=github&logoColor=white&label=pushed
:target: https://github.com/tqdm/tqdm/pulse
.. |Gift-Casper| image:: https://img.shields.io/badge/dynamic/json.svg?color=ff69b4&label=gifts%20received&prefix=%C2%A3&query=%24..sum&url=https%3A%2F%2Fcaspersci.uk.to%2Fgifts.json
:target: https://caspersci.uk.to/donate
:target: https://www.cdcl.ml/sponsor
.. |Versions| image:: https://img.shields.io/pypi/v/tqdm.svg
:target: https://tqdm.github.io/releases
.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/tqdm.svg?label=pypi%20downloads&logo=PyPI&logoColor=white
Expand Down
3 changes: 3 additions & 0 deletions .meta/requirements-build.txt
@@ -0,0 +1,3 @@
py-make>=0.1.0
twine
wheel
5 changes: 5 additions & 0 deletions .meta/requirements-test.txt
@@ -0,0 +1,5 @@
flake8
pytest
pytest-cov
pytest-timeout
# py>=37: pytest-asyncio
39 changes: 17 additions & 22 deletions CONTRIBUTING.md
@@ -1,9 +1,11 @@
# HOW TO CONTRIBUTE TO TQDM

**TL;DR: Skip to [QUICK DEV SUMMARY]**

This file describes how to

- contribute changes to the project, and
- upload released to the pypi repository.
- upload released to the PyPI repository.

Most of the management commands have been directly placed inside the
Makefile:
Expand All @@ -24,7 +26,7 @@ Contributions to the project are made using the "Fork & Pull" model. The
typical steps would be:

1. create an account on [github](https://github.com)
2. fork [tqdm](https://github.com/tqdm/tqdm)
2. fork [`tqdm`](https://github.com/tqdm/tqdm)
3. make a local clone: `git clone https://github.com/your_account/tqdm.git`
4. make changes on the local copy
5. test (see below) and commit changes `git commit -a -m "my message"`
Expand Down Expand Up @@ -103,7 +105,7 @@ that each distribution has an alias to call the Python interpreter:

Alternatively, use `pytest` to run the tests just for the current Python version:

- install `pytest`, `coverage`, `pytest-cov` and `flake8`
- install test requirements: `[python setup.py] make install_test`
- run the following command:

```
Expand All @@ -118,30 +120,26 @@ This section is intended for the project's maintainers and describes
how to build and upload a new release. Once again,
`[python setup.py] make [<alias>]` will help.
Also consider `pip install`ing development utilities:
`pip install tqdm[dev]` at a minimum, or a more thorough `conda env create`.
`[python setup.py] make install_build` at a minimum, or a more thorough `conda env create`.


## Pre-commit Hook

It's probably a good idea to run `pre-commit install` for convenient local
sanity-checking.
It's probably a good idea to use the `pre-commit` (`pip install pre-commit`) helper.

Run `pre-commit install` for convenient local sanity-checking.

## Semantic Versioning

The tqdm repository managers should:
## Semantic Versioning

- follow the [Semantic Versioning](https://semver.org) convention
- take care of this (instead of users) to avoid PR conflicts
solely due to the version file bumping
The `tqdm` repository managers should:

Note: tools can be used to automate this process, such as
[python-semanticversion](https://github.com/rbarrois/python-semanticversion).
- follow the [Semantic Versioning](https://semver.org) convention for tagging


## Checking setup.py

To check that the `setup.py`/`setup.cfg` file is compliant with PyPI
To check that the `setup.py`/`setup.cfg`/`pyproject.toml` file is compliant with PyPI
requirements (e.g. version number; reStructuredText in `README.rst`) use:

```
Expand Down Expand Up @@ -217,18 +215,15 @@ Formally publishing requires additional steps: testing and tagging.

### Test

- ensure that all online CI tests have passed
- check `setup.py` and `setup.cfg` - which define the packaging
process and info that will be uploaded to [PyPI](https://pypi.org) -
using `[python setup.py] make installdev`
Ensure that all online CI tests have passed.

### Tag

- ensure the version has been bumped, committed **and** tagged.
- ensure the version has been tagged.
The tag format is `v{major}.{minor}.{patch}`, for example: `v4.4.1`.
The current commit's tag is used in the version checking process.
If the current commit is not tagged appropriately, the version will
display as `v{major}.{minor}.{patch}-{commit_hash}`.
display as `v{major}.{minor}.{patch}.dev{N}+g{commit_hash}`.

### Upload

Expand All @@ -244,7 +239,7 @@ Build `tqdm` into a distributable python package:
This will generate several builds in the `dist/` folder. On non-windows
machines the windows `exe` installer may fail to build. This is normal.

Finally, upload everything to pypi. This can be done easily using the
Finally, upload everything to PyPI. This can be done easily using the
[twine](https://github.com/pypa/twine) module:

```
Expand Down Expand Up @@ -338,7 +333,7 @@ to assist with maintenance.
For experienced devs, once happy with local master, follow the steps below.
Much is automated so really it's steps 1-5, then 11(a).

1. test (`[python setup.py] make alltests`)
1. test (`[python setup.py] make alltests` or rely on `pre-commit`)
2. `git commit [--amend] # -m "bump version"`
3. `git push`
4. wait for tests to pass
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Expand Up @@ -18,7 +18,7 @@
prebuildclean
clean
toxclean
installdev
install_dev
install
build
buildupload
Expand Down Expand Up @@ -139,9 +139,6 @@ toxclean:
@+python -c "import shutil; shutil.rmtree('.tox', True)"


installdev:
python setup.py develop --uninstall
python setup.py develop
submodules:
git clone git@github.com:tqdm/tqdm.wiki wiki
git clone git@github.com:tqdm/tqdm.github.io docs
Expand All @@ -150,6 +147,13 @@ submodules:

install:
python setup.py install
install_dev:
python setup.py develop --uninstall
python setup.py develop
install_build:
python -m pip install -r .meta/requirements-dev.txt
install_test:
python -m pip install -r .meta/requirements-test.txt

build:
@make prebuildclean
Expand Down
31 changes: 26 additions & 5 deletions README.rst
Expand Up @@ -140,7 +140,7 @@ Changelog
The list of all changes is available either on GitHub's Releases:
|GitHub-Status|, on the
`wiki <https://github.com/tqdm/tqdm/wiki/Releases>`__, or on the
`website <https://tqdm.github.io/releases/>`__.
`website <https://tqdm.github.io/releases>`__.


Usage
Expand Down Expand Up @@ -679,7 +679,10 @@ Submodules
"""`rich.progress` version."""
class tqdm.keras.TqdmCallback(keras.callbacks.Callback):
"""`keras` callback for epoch and batch progress."""
"""Keras callback for epoch and batch progress."""
class tqdm.dask.TqdmCallback(dask.callbacks.Callback):
"""Dask callback for task progress."""
``contrib``
Expand All @@ -689,8 +692,8 @@ The ``tqdm.contrib`` package also contains experimental modules:

- ``tqdm.contrib.itertools``: Thin wrappers around ``itertools``
- ``tqdm.contrib.concurrent``: Thin wrappers around ``concurrent.futures``
- ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com/>`__ bots
- ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org/>`__ bots
- ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com>`__ bots
- ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org>`__ bots
- ``tqdm.contrib.bells``: Automagically enables all optional features

* ``auto``, ``pandas``, ``discord``, ``telegram``
Expand Down Expand Up @@ -1048,6 +1051,24 @@ A ``keras`` callback is also available:
model.fit(..., verbose=0, callbacks=[TqdmCallback()])
Dask Integration
~~~~~~~~~~~~~~~~

A ``dask`` callback is also available:

.. code:: python
from tqdm.dask import TqdmCallback
with TqdmCallback(desc="compute"):
...
arr.compute()
# or use callback globally
cb = TqdmCallback(desc="global")
cb.register()
arr.compute()
IPython/Jupyter Integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1418,7 +1439,7 @@ Citation information: |DOI|
.. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/tqdm/tqdm/master.svg?logo=github&logoColor=white&label=pushed
:target: https://github.com/tqdm/tqdm/pulse
.. |Gift-Casper| image:: https://img.shields.io/badge/dynamic/json.svg?color=ff69b4&label=gifts%20received&prefix=%C2%A3&query=%24..sum&url=https%3A%2F%2Fcaspersci.uk.to%2Fgifts.json
:target: https://caspersci.uk.to/donate
:target: https://www.cdcl.ml/sponsor
.. |Versions| image:: https://img.shields.io/pypi/v/tqdm.svg
:target: https://tqdm.github.io/releases
.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/tqdm.svg?label=pypi%20downloads&logo=PyPI&logoColor=white
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/README.md
Expand Up @@ -11,7 +11,7 @@ These benchmarks serve two purposes:
- [`progressbar2`](https://pypi.org/project/progressbar2)
- [`alive-progress`](https://pypi.org/project/alive-progress)

Performance graphs are available at <https://tqdm.github.io/tqdm/>
Performance graphs are available at <https://tqdm.github.io/tqdm>

## Running

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Expand Up @@ -25,6 +25,7 @@ dependencies:
- flake8-comprehensions
- coverage
# extras
- dask # dask
- matplotlib # gui
- numpy # pandas, keras, contrib.tenumerate
- pandas
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Expand Up @@ -82,6 +82,7 @@ packages=find:
[options.extras_require]
dev=py-make>=0.1.0; twine; wheel
telegram=requests
notebook=ipywidgets>=6
[options.entry_points]
console_scripts=
tqdm=tqdm.cli:main
Expand All @@ -95,6 +96,9 @@ universal=1
max_line_length=88
exclude=.asv,.eggs,.tox,.ipynb_checkpoints,build,dist,.git,__pycache__

[pydocstyle]
add_ignore=D400,D415

[yapf]
coalesce_brackets=True
column_limit=88
Expand Down
14 changes: 14 additions & 0 deletions tests/py37_asyncio.py
Expand Up @@ -10,6 +10,7 @@
tqdm = partial(tqdm_asyncio, miniters=0, mininterval=0)
trange = partial(tarange, miniters=0, mininterval=0)
as_completed = partial(tqdm_asyncio.as_completed, miniters=0, mininterval=0)
gather = partial(tqdm_asyncio.gather, miniters=0, mininterval=0)


def count(start=0, step=1):
Expand Down Expand Up @@ -112,3 +113,16 @@ async def test_as_completed(capsys, tol):
except AssertionError:
if retry == 2:
raise


async def double(i):
return i * 2


@mark.asyncio
async def test_gather(capsys):
"""Test asyncio gather"""
res = await gather(list(map(double, range(30))))
_, err = capsys.readouterr()
assert '30/30' in err
assert res == list(range(0, 30 * 2, 2))
20 changes: 20 additions & 0 deletions tests/tests_dask.py
@@ -0,0 +1,20 @@
from __future__ import division

from time import sleep

from .tests_tqdm import importorskip, mark

pytestmark = mark.slow


def test_dask(capsys):
"""Test tqdm.dask.TqdmCallback"""
ProgressBar = importorskip('tqdm.dask').TqdmCallback
dask = importorskip('dask')

schedule = [dask.delayed(sleep)(i / 10) for i in range(5)]
with ProgressBar(desc="computing"):
dask.compute(schedule)
_, err = capsys.readouterr()
assert "computing: " in err
assert '5/5' in err

0 comments on commit bcce20f

Please sign in to comment.