mirror of https://github.com/jab/bidict.git
drop Py3.4 from Travis, update to latest flake8 + pydocstyle, improve lint_src spelling
This commit is contained in:
parent
638babdde5
commit
5f9cab9acf
|
@ -1,9 +1,12 @@
|
|||
# https://docs.pylint.org/en/latest/technical_reference/features.html
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
# repeated-keyword check is buggy:
|
||||
# https://github.com/PyCQA/pylint/issues/1843#issuecomment-419746286
|
||||
disable = useless-object-inheritance,repeated-keyword
|
||||
disable =
|
||||
# Must inherit from object for Python 2 compatibility.
|
||||
useless-object-inheritance,
|
||||
# repeated-keyword check is buggy:
|
||||
# https://github.com/PyCQA/pylint/issues/1843#issuecomment-419746286
|
||||
repeated-keyword,
|
||||
|
||||
# bidict/_version.py is generated by setuptools_scm
|
||||
ignore = _version.py
|
||||
|
|
39
.travis.yml
39
.travis.yml
|
@ -8,11 +8,6 @@ python: '3.7'
|
|||
dist: 'xenial'
|
||||
|
||||
|
||||
env:
|
||||
global:
|
||||
- 'LINT_SRC="$(ls bidict/*.py tests/*.py tests/*/*.py setup.py)"'
|
||||
|
||||
|
||||
before_install: # Ensure we have the required versions of Python and Pip.
|
||||
- 'echo "TRAVIS_PULL_REQUEST_SHA: $TRAVIS_PULL_REQUEST_SHA"'
|
||||
- 'echo "TRAVIS_COMMIT: $TRAVIS_COMMIT"'
|
||||
|
@ -22,7 +17,7 @@ before_install: # Ensure we have the required versions of Python and Pip.
|
|||
- 'travis_retry git fetch --unshallow'
|
||||
# Install Python on macOS since https://github.com/travis-ci/travis-ci/issues/2312 is WONTFIXed.
|
||||
- |
|
||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
declare -r pyver="${TASK##*-}" # strip all chars up to and including the last -
|
||||
declare -r python="python$pyver"
|
||||
echo "TASK=$TASK -> pyver=$pyver python=$python"
|
||||
|
@ -48,20 +43,29 @@ before_install: # Ensure we have the required versions of Python and Pip.
|
|||
|
||||
|
||||
install: # Install our test dependencies.
|
||||
- 'travis_retry pip install -U --upgrade-strategy=eager .[test$([[ $COVERAGE ]] && echo ",coverage")]'
|
||||
- 'travis_retry pip install -U --upgrade-strategy=eager .[test$([[ "$COVERAGE" ]] && echo ",coverage")]'
|
||||
|
||||
|
||||
before_script:
|
||||
- 'pip list'
|
||||
- |
|
||||
if [[ "$TASK" == lint-* ]]; then
|
||||
shopt -s globstar
|
||||
export LINT_SRC=**/*.py
|
||||
echo "LINT_SRC:" $LINT_SRC
|
||||
fi
|
||||
|
||||
|
||||
script: # Run the test suite.
|
||||
# See tests/hypothesis/_setup_hypothesis.py
|
||||
- 'export HYPOTHESIS_PROFILE=$([[ $TRAVIS_EVENT_TYPE == cron ]] && echo more-examples)'
|
||||
- 'export PYTEST_ADDOPTS=$([[ $COVERAGE ]] && echo "--cov=bidict --cov-config=.coveragerc")'
|
||||
- 'export HYPOTHESIS_PROFILE=$([[ "$TRAVIS_EVENT_TYPE" == cron ]] && echo more-examples)'
|
||||
- 'export PYTEST_ADDOPTS=$([[ "$COVERAGE" ]] && echo "--cov=bidict --cov-config=.coveragerc")'
|
||||
- './run_tests.py'
|
||||
|
||||
|
||||
after_script:
|
||||
- |
|
||||
if [[ $COVERAGE ]]; then
|
||||
if [[ "$COVERAGE" ]]; then
|
||||
echo "Installing codecov..."
|
||||
travis_retry pip install codecov || exit 1
|
||||
echo
|
||||
|
@ -107,19 +111,19 @@ matrix:
|
|||
language: 'generic'
|
||||
|
||||
## Linting, static analysis, code style.
|
||||
- env: 'TASK=flake8'
|
||||
- env: 'TASK=lint-flake8'
|
||||
before_install: 'skip'
|
||||
install: 'travis_retry pip install "flake8<3.7"' # keep in sync with the version in setup.py
|
||||
install: 'travis_retry pip install "flake8<3.8"' # keep in sync with the version in setup.py
|
||||
script: 'flake8 $LINT_SRC'
|
||||
|
||||
- env: 'TASK=pylint'
|
||||
- env: 'TASK=lint-pylint'
|
||||
before_install: 'skip'
|
||||
install: 'travis_retry pip install "pylint<2.3" "hypothesis<4" "pytest<5"' # keep in sync with the versions in setup.py
|
||||
install: 'travis_retry pip install "pylint<2.3" "hypothesis<4" "pytest<5" "Sphinx<2"' # keep in sync with the versions in setup.py
|
||||
script: 'pylint --jobs=0 $LINT_SRC'
|
||||
|
||||
- env: 'TASK=pydocstyle'
|
||||
- env: 'TASK=lint-pydocstyle'
|
||||
before_install: 'skip'
|
||||
install: 'travis_retry pip install "pydocstyle<2.2"' # keep in sync with the version in setup.py
|
||||
install: 'travis_retry pip install "pydocstyle<3.1"' # keep in sync with the version in setup.py
|
||||
script: 'pydocstyle $LINT_SRC'
|
||||
|
||||
## Misc.
|
||||
|
@ -140,9 +144,6 @@ matrix:
|
|||
- python: '3.5'
|
||||
env: 'TASK=test-linux-cpython-3.5'
|
||||
|
||||
- python: '3.4'
|
||||
env: 'TASK=test-linux-cpython-3.4'
|
||||
|
||||
## Misc.
|
||||
- env: 'TASK=docs-linkcheck ALLOW_FAIL=1'
|
||||
before_install: 'skip'
|
||||
|
|
|
@ -25,9 +25,16 @@ on libraries.io to be notified when new versions of bidict are released.
|
|||
0.17.6 (not yet released)
|
||||
-------------------------
|
||||
|
||||
- Stop testing Python 3.4 on CI,
|
||||
and warn when Python 3 < 3.5 is detected
|
||||
rather than Python 3 < 3.3.
|
||||
|
||||
According to `PyPI Stats <https://pypistats.org/packages/bidict>`__,
|
||||
Python 3.4 represents only about 3% of bidict downloads as of January 2019.
|
||||
The latest release of Pip has also deprecated support for Python 3.4.
|
||||
|
||||
- Add Python 2/3-compatible :attr:`bidict.compat.collections_abc` alias.
|
||||
|
||||
- Warn on Python 3 < 3.4 rather than on Python 3 < 3.3.
|
||||
|
||||
|
||||
0.17.5 (2018-11-19)
|
||||
|
|
|
@ -54,8 +54,8 @@ if PY2:
|
|||
|
||||
else:
|
||||
# Assume Python 3 when not PY2, but explicitly check before showing this warning.
|
||||
if PYMAJOR == 3 and PYMINOR < 4: # pragma: no cover
|
||||
warn('Python3 < 3.4 is not officially supported.')
|
||||
if PYMAJOR == 3 and PYMINOR < 5: # pragma: no cover
|
||||
warn('Python3 < 3.5 is not officially supported.')
|
||||
|
||||
import collections.abc as collections_abc # noqa: F401 (imported but unused)
|
||||
from collections.abc import ( # noqa: F401 (imported but unused)
|
||||
|
|
|
@ -31,7 +31,7 @@ import os
|
|||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
|
||||
import bidict # pylint: disable=wrong-import-position
|
||||
import bidict # noqa: E402; pylint: disable=wrong-import-position
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ universal = 1
|
|||
|
||||
# http://flake8.pycqa.org/en/latest/user/configuration.html
|
||||
[flake8]
|
||||
ignore = E126,E128,E265,E731,W504
|
||||
ignore = E126,E128,E266,E265,E731,W504
|
||||
max-line-length = 100
|
||||
|
||||
|
||||
|
|
5
setup.py
5
setup.py
|
@ -76,8 +76,8 @@ DEV_REQ = SETUP_REQS + TEST_REQS + COVERAGE_REQS + DOCS_REQS + [
|
|||
# The following dependencies have a higher chance of suddenly causing CI to fail after updating
|
||||
# even between minor versions so pin to currently-working minor versions. Upgrade to newer
|
||||
# minor versions manually to have a chance to fix any resulting breakage before it hits CI.
|
||||
'flake8 < 3.7',
|
||||
'pydocstyle < 2.2',
|
||||
'flake8 < 3.8',
|
||||
'pydocstyle < 3.1',
|
||||
'pylint < 2.3',
|
||||
]
|
||||
|
||||
|
@ -104,7 +104,6 @@ setup(
|
|||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
|
|
Loading…
Reference in New Issue