mostly linting

This commit is contained in:
Casper da Costa-Luis 2020-11-15 21:57:29 +00:00
parent 1a2976ae61
commit fd969bfd74
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
6 changed files with 14 additions and 20 deletions

View File

@ -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:
@ -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

View File

@ -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"]

View File

@ -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:

View File

@ -61,7 +61,7 @@ def relative_timer():
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"""
@ -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)"""
@ -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)"""
@ -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)"""
@ -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)"""

View File

@ -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 =

View File

@ -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):
"""