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 Jul 16, 2020
2 parents 15c5c51 + 8d2ee55 commit b1df116
Show file tree
Hide file tree
Showing 27 changed files with 773 additions and 148 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/bench.yml
@@ -0,0 +1,72 @@
name: Benchmark
on:
push:
schedule:
- cron: '36 1 * * SUN' # M H d m w (Sundays at 01:36)
jobs:
asvfull:
if: (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')) || github.event_name == 'schedule'
name: Full
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install
run: |
pip install -U wheel
pip install -U virtualenv asv
asv machine --machine github-actions --yes
git fetch --tags
git fetch origin master:master
- name: Restore previous results
uses: actions/cache@v2
with:
path: .asv
key: asv-${{ runner.os }}
restore-keys: |
asv-
- name: Benchmark
run: |
asv run -j 8 --interleave-processes --skip-existing v3.2.0..HEAD
- name: Build pages
run: |
git config --global user.email "$GIT_AUTHOR_EMAIL"
git config --global user.name "$GIT_AUTHOR_NAME"
asv gh-pages --no-push
git push -f origin gh-pages:gh-pages
env:
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
testasv:
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags')
name: Branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install
run: |
pip install -U wheel
pip install -U virtualenv asv
asv machine --machine github-actions --yes
git fetch --tags
git fetch origin master:master
- name: Restore previous results
uses: actions/cache@v2
with:
path: .asv
key: asv-${{ runner.os }}
restore-keys: |
asv-
- name: Benchmark
run: |
asv continuous --interleave-processes --only-changed -f 1.25 master HEAD
CHANGES="$(asv compare --only-changed -f 1.25 master HEAD)"
echo "$CHANGES"
[ -z "$CHANGES" ] || exit 1
56 changes: 56 additions & 0 deletions .github/workflows/comment-bot.yml
@@ -0,0 +1,56 @@
name: Comment Bot
on:
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]

jobs:
tag: # /tag <tagname> <commit>
if: startsWith(github.event.comment.body, '/tag ')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: React Seen
uses: actions/github-script@v2
with:
script: |
const perm = await github.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner, repo: context.repo.repo,
username: context.payload.comment.user.login})
post = (context.eventName == "issue_comment"
? github.reactions.createForIssueComment
: github.reactions.createForPullRequestReviewComment)
if (!["admin", "write"].includes(perm.data.permission)){
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "laugh"})
throw "Permission denied for user " + context.payload.comment.user.login
}
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "eyes"})
- name: Tag Commit
run: |
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} repo
git -C repo tag $(echo "$BODY" | awk '{print $2" "$3}')
git -C repo push --tags
rm -rf repo
env:
BODY: ${{ github.event.comment.body }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: React Success
uses: actions/github-script@v2
with:
script: |
post = (context.eventName == "issue_comment"
? github.reactions.createForIssueComment
: github.reactions.createForPullRequestReviewComment)
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "rocket"})
always:
runs-on: ubuntu-latest
steps:
- run: echo prevent failure when other jobs are skipped
50 changes: 50 additions & 0 deletions .github/workflows/post-release.yml
@@ -0,0 +1,50 @@
name: Post Release
on:
release:
types: [published]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Checkout wiki
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}.wiki
path: wiki
- name: Checkout docs
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}.github.io
path: docs
ref: src
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install
run: |
pip install -U wheel
pip install -U -r ./docs/requirements.txt
git config --global user.email "$GIT_AUTHOR_EMAIL"
git config --global user.name "$GIT_AUTHOR_NAME"
env:
GIT_AUTHOR_NAME: ${{ github.event.sender.login }}
GIT_AUTHOR_EMAIL: ${{ github.event.sender.login }}@users.noreply.github.com
- name: Update Wiki Releases
run: |
pushd wiki
make
git commit -a -m "update release notes to ${GITHUB_REF#refs/tags/}"
git push
popd
- name: Update Docs
run: |
pushd docs
git fetch --depth=1 origin master:master
git checkout master
git push --set-upstream origin master
git checkout -
make deploy
popd
49 changes: 32 additions & 17 deletions .meta/.readme.rst
Expand Up @@ -376,7 +376,7 @@ Returns
def set_description(self, desc=None, refresh=True):
"""{DOC_tqdm.tqdm.set_description}"""
def set_postfix(self, ordered_dict=None, refresh=True, **kwargs):
def set_postfix(self, ordered_dict=None, refresh=True, **tqdm_kwargs):
"""{DOC_tqdm.tqdm.set_postfix}"""
@classmethod
Expand All @@ -390,29 +390,45 @@ Returns
def display(self, msg=None, pos=None):
"""{DOC_tqdm.tqdm.display}"""
def trange(*args, **kwargs):
@classmethod
@contextmanager
def wrapattr(cls, stream, method, total=None, bytes=True, **tqdm_kwargs):
"""{DOC_tqdm.tqdm.wrapattr}"""
@classmethod
def pandas(cls, *targs, **tqdm_kwargs):
"""Registers the current `tqdm` class with `pandas`."""
def trange(*args, **tqdm_kwargs):
"""
A shortcut for tqdm(xrange(*args), **kwargs).
On Python3+ range is used instead of xrange.
A shortcut for `tqdm(xrange(*args), **tqdm_kwargs)`.
On Python3+, `range` is used instead of `xrange`.
"""
class tqdm.gui.tqdm(tqdm.tqdm):
"""Experimental GUI version"""
class tqdm.notebook.tqdm(tqdm.tqdm):
"""Experimental IPython/Jupyter Notebook widget."""
def tqdm.gui.trange(*args, **kwargs):
"""Experimental GUI version of trange"""
def tqdm.notebook.trange(*args, **tqdm_kwargs):
"""Experimental IPython/Jupyter Notebook widget version of `trange`."""
class tqdm.notebook.tqdm(tqdm.tqdm):
"""Experimental IPython/Jupyter Notebook widget"""
class tqdm.auto.tqdm(tqdm.tqdm):
"""Automatically chooses beween `tqdm.notebook` and `tqdm.tqdm`."""
def tqdm.notebook.trange(*args, **kwargs):
"""Experimental IPython/Jupyter Notebook widget version of trange"""
class tqdm.asyncio.tqdm(tqdm.tqdm):
"""Asynchronous version."""
@classmethod
def as_completed(cls, fs, *, loop=None, timeout=None, total=None,
**tqdm_kwargs):
"""Wrapper for `asyncio.as_completed`."""
class tqdm.gui.tqdm(tqdm.tqdm):
"""Experimental GUI version."""
class tqdm.keras.TqdmCallback(keras.callbacks.Callback):
"""`keras` callback for epoch and batch progress"""
"""`keras` callback for epoch and batch progress."""
def tqdm.contrib.tenumerate(iterable, start=0, total=None,
tqdm_class=tqdm.auto.tqdm, **kwargs):
tqdm_class=tqdm.auto.tqdm, **tqdm_kwargs):
"""Equivalent of `numpy.ndenumerate` or builtin `enumerate`."""
def tqdm.contrib.tzip(iter1, *iter2plus, **tqdm_kwargs):
Expand All @@ -428,13 +444,12 @@ 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.bells``: Automagically enables all optional features

* ``auto``, ``pandas``, ``discord``, ``telegram``

- ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com/>`__ bots
- ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org/>`__ bots

Examples and Advanced Usage
---------------------------

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -123,7 +123,7 @@ jobs:
-iv $encrypted_a6d6301302b7_iv -in .meta/.tqdm.gpg.enc -out .tqdm.gpg -d
- gpg --import .tqdm.gpg
- rm .tqdm.gpg
- git log --pretty='format:- %s%n%b---' $(git tag --sort=creatordate | tail -n2 | head -n1)..HEAD > CHANGES.md
- git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
deploy:
- provider: script
script: twine upload -s -i tqdm@caspersci.uk.to dist/tqdm-*
Expand All @@ -140,7 +140,7 @@ jobs:
edge: true
tag_name: $TRAVIS_TAG
target_commitish: $TRAVIS_COMMIT
release_notes_file: CHANGES.md
release_notes_file: _CHANGES.md
on:
tags: true
- name: docker
Expand Down
47 changes: 34 additions & 13 deletions CONTRIBUTING.md
Expand Up @@ -321,24 +321,43 @@ following:
Additionally (less maintained), there exists:

- A [wiki] which is publicly editable.
- The [gh-pages project](https://tqdm.github.io/tqdm/) which is built from the
- The [gh-pages project] which is built from the
[gh-pages branch](https://github.com/tqdm/tqdm/tree/gh-pages), which is
built using [asv](https://github.com/spacetelescope/asv/).
- The [gh-pages root](https://tqdm.github.io/) which is built from a separate
built using [asv](https://github.com/airspeed-velocity/asv).
- The [gh-pages root] which is built from a separate
[github.io repo](https://github.com/tqdm/tqdm.github.io).

[gh-pages project]: https://tqdm.github.io/tqdm/
[gh-pages root]: https://tqdm.github.io/


## Helper Bots

There are some helpers in
[.github/workflows](https://github.com/tqdm/tqdm/tree/master/.github/workflows)
to assist with maintenance.

- Comment Bot
+ allows maintainers to write `/tag vM.m.p commit_hash` in an issue/PR to create a tag
- Post Release
+ automatically updates the [wiki]
+ automatically updates the [gh-pages root]
- Benchmark
+ automatically updates the [gh-pages project]


## QUICK DEV SUMMARY

For experienced devs, once happy with local master:
For experienced devs, once happy with local master, follow the steps below.
Much is automated so really it's steps 1-6, then 12(a).

1. bump version in `tqdm/_version.py`
2. test (`[python setup.py] make alltests`)
3. `git commit [--amend] # -m "bump version"`
4. `git push`
5. wait for tests to pass
a) in case of failure, fix and go back to (2)
6. `git tag vM.m.p && git push --tags`
6. `git tag vM.m.p && git push --tags` or comment `/tag vM.m.p commit_hash`
7. **`[AUTO:TravisCI]`** `[python setup.py] make distclean`
8. **`[AUTO:TravisCI]`** `[python setup.py] make build`
9. **`[AUTO:TravisCI]`** upload to PyPI. either:
Expand All @@ -352,16 +371,18 @@ For experienced devs, once happy with local master:
a) `make snap`, and
b) `snapcraft push tqdm*.snap --release stable`
12. Wait for travis to draft a new release on <https://github.com/tqdm/tqdm/releases>
a) add helpful release notes
a) replace the commit history with helpful release notes, and click publish
b) **`[AUTO:TravisCI]`** attach `dist/tqdm-*` binaries
(usually only `*.whl*`)
13. **`[SUB]`** run `make` in the `wiki` submodule to update release notes
14. **`[SUB]`** run `make deploy` in the `docs` submodule to update website
15. **`[SUB]`** accept the automated PR in the `feedstock` submodule to update conda
13. **`[SUB][AUTO:GHActions]`** run `make` in the `wiki` submodule to update release notes
14. **`[SUB][AUTO:GHActions]`** run `make deploy` in the `docs` submodule to update website
15. **`[SUB][AUTO:GHActions]`** accept the automated PR in the `feedstock` submodule to update conda
16. **`[AUTO:GHActions]`** update the [gh-pages project] benchmarks
a) `[python setup.py] make testasvfull`
b) `asv gh-pages`

Key:

- **`[AUTO:TravisCI]`**: Travis CI should automatically do this after
`git push --tags` (6)
- **`[SUB]`**: Requires one-time `make submodules` to clone
`docs`, `wiki`, and `feedstock`
- **`[AUTO:TravisCI]`**: Travis CI should automatically do this after `git push --tags` (6)
- **`[AUTO:GHActions]`**: GitHub Actions CI should automatically do this after release (12a)
- **`[SUB]`**: Requires one-time `make submodules` to clone `docs`, `wiki`, and `feedstock`
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -79,7 +79,7 @@ testasv:

testasvfull:
# Test all the commits since the beginning (full test)
asv run -j 8 v1.0.0..master
asv run --skip-existing-commits -j 8 v1.0.0..HEAD
@make testasv

viewasv:
Expand Down

0 comments on commit b1df116

Please sign in to comment.