Skip to content

Commit

Permalink
mostly linting
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Nov 16, 2020
1 parent 1a2976a commit fd969bf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
test:
strategy:
matrix:
python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
name: py${{ matrix.python }}
runs-on: ubuntu-latest
steps:
Expand All @@ -49,15 +49,17 @@ jobs:
if [[ "$PYVER" == py* ]]; then
tox -e $PYVER
elif [[ "$PYVER" == "3.7" ]]; then
tox -e tf-no-keras
tox -e py${PYVER/./}-linux,tf-no-keras
else
tox -e py${PYVER/./}
[[ "$PYVER" == *3.4 ]] && sed -i '/relative_files/d' .coveragerc
tox -e py${PYVER/./}-linux
fi
env:
PYVER: ${{ matrix.python }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Coveralls Parallel
- if: ${{ matrix.python != 3.4 }}
name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-alpine
COPY dist/*.whl .
RUN pip install -U $(ls *.whl) && rm *.whl
RUN pip install -U $(ls ./*.whl) && rm ./*.whl
ENTRYPOINT ["tqdm"]
1 change: 1 addition & 0 deletions tests/tests_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_main():
sys.stdin = [str(i).encode() for i in _range(N)]
# with closing(UnicodeIO()) as fp:
main(argv=['--log', 'DEBUG'], fp=NULL)
main(argv=['--log=DEBUG'], fp=NULL)
# assert "DEBUG:" in sys.stdout.getvalue()

try:
Expand Down
10 changes: 5 additions & 5 deletions tests/tests_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def elapser(): # NOQA
return spent


def retry_on_except(n=6, check_cpu_time=True):
def retry_on_except(n=3, check_cpu_time=True):
"""decroator for retrying `n` times before raising Exceptions"""
def wrapper(func):
"""actual decorator"""
Expand Down Expand Up @@ -249,7 +249,7 @@ def test_lock_args():
assert_performance(0.5, 'noblock', time_noblock(), 'tqdm', time_tqdm())


@retry_on_except()
@retry_on_except(10)
def test_iter_overhead_hard():
"""Test overhead of iteration based tqdm (hard)"""

Expand All @@ -273,7 +273,7 @@ def test_iter_overhead_hard():
assert_performance(130, 'trange', time_tqdm(), 'range', time_bench())


@retry_on_except()
@retry_on_except(10)
def test_manual_overhead_hard():
"""Test overhead of manual tqdm (hard)"""

Expand All @@ -297,7 +297,7 @@ def test_manual_overhead_hard():
assert_performance(130, 'tqdm', time_tqdm(), 'range', time_bench())


@retry_on_except()
@retry_on_except(10)
def test_iter_overhead_simplebar_hard():
"""Test overhead of iteration based tqdm vs simple progress bar (hard)"""

Expand All @@ -323,7 +323,7 @@ def test_iter_overhead_simplebar_hard():
10, 'trange', time_tqdm(), 'simple_progress', time_bench())


@retry_on_except()
@retry_on_except(10)
def test_manual_overhead_simplebar_hard():
"""Test overhead of manual tqdm vs simple progress bar (hard)"""

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

[coverage]
deps =
Expand Down
9 changes: 0 additions & 9 deletions tqdm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ def cast(val, typ):
raise TqdmTypeError(val + ' : ' + typ)


def isBytes(val):
"""Equivalent of `isinstance(val, six.binary_type)`."""
try:
val.index(b'')
except TypeError:
return False
return True


def posix_pipe(fin, fout, delim=b'\\n', buf_size=256,
callback=lambda float: None, callback_len=True):
"""
Expand Down

0 comments on commit fd969bf

Please sign in to comment.