Skip to content

Commit

Permalink
Do not use tox on travis - make CI faster
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Stepanov <penguinolog@gmail.com>
  • Loading branch information
penguinolog committed Sep 6, 2018
1 parent b5f8827 commit 8d22200
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 45 deletions.
78 changes: 42 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,31 @@ language: python
os: linux
install:
- &upgrade_python_toolset pip install --upgrade pip setuptools wheel
- pip install tox
- pip install coveralls
script: []
- &install_test_deps pip install --upgrade pytest pytest-sugar
- &install_deps pip install -r CI_REQUIREMENTS.txt
- pip install --upgrade pytest-cov coveralls

_helpers:
- &install_cython pip install --upgrade Cython
- &build_package python setup.py bdist_wheel
- &install_built pip install exec_helpers --no-index -f dist
- &test_no_cov py.test -vv test
- &test_cythonized
install:
- *upgrade_python_toolset
- *install_test_deps
- *install_deps
- *install_cython
script:
- *build_package
- *install_built
- *test_no_cov
after_success: skip

script:
- pip install -e .
- py.test -vv --cov-config .coveragerc --cov-report= --cov=exec_helpers test
- coverage report -m --fail-under 90
after_success:
- coveralls

Expand All @@ -15,50 +37,41 @@ jobs:
- stage: test
name: "Python 3.4"
python: 3.4
script:
- tox -e py34
- stage: test
name: "Python 3.5"
python: 3.5
script:
- tox -e py35
- stage: test
name: "Python 3.6"
python: 3.6
script:
- tox -e py36
- stage: test
name: "Python 3.7"
python: 3.7
dist: xenial
sudo: true
script:
- tox -e py37
- stage: test
name: "PyPy3"
python: pypy3.5
script:
- tox -e pypy3

- stage: Static analisys
name: "PyLint"
python: 3.6
services: []
install:
- *upgrade_python_toolset
- pip install tox
- *install_deps
- pip install --upgrade "pylint >= 2.0"
script:
- tox -e pylint
- pylint exec_helpers
after_success: skip
- stage: Static analisys
name: "Bandit"
python: 3.6
services: []
install:
- *upgrade_python_toolset
- pip install tox
- pip install --upgrade bandit
script:
- tox -e bandit
- bandit -r exec_helpers
after_success: skip
- stage: Static analisys
name: "MyPy"
Expand All @@ -68,55 +81,48 @@ jobs:
services: []
install:
- *upgrade_python_toolset
- pip install tox
- *install_deps
- pip install --upgrade "mypy >= 0.620"
script:
- tox -e mypy
- mypy --strict exec_helpers
after_success: skip

- stage: Test cythonized
name: "Python 3.4"
python: 3.4
script:
- tox -e py34-nocov
after_success: skip
<<: *test_cythonized
- stage: Test cythonized
name: "Python 3.5"
python: 3.5
script:
- tox -e py35-nocov
after_success: skip
<<: *test_cythonized
- stage: Test cythonized
name: "Python 3.6"
python: 3.6
script:
- tox -e py36-nocov
after_success: skip
<<: *test_cythonized
- stage: Test cythonized
name: "Python 3.7"
python: 3.7
dist: xenial
sudo: true
script:
- tox -e py37-nocov
after_success: skip
<<: *test_cythonized

- stage: Code style check
name: "PEP8"
python: 3.6
install:
- *upgrade_python_toolset
- pip install tox
- pip install --upgrade flake8
script:
- tox -e pep8
- flake8
after_success: skip
- stage: Code style check
name: "PEP257"
python: 3.6
install:
- *upgrade_python_toolset
- pip install tox
- pip install --upgrade pydocstyle
script:
- tox -e pep257
- pydocstyle exec_helpers
after_success: skip

- stage: deploy
Expand All @@ -132,7 +138,7 @@ jobs:
- ./tools/run_docker.sh "exec_helpers"
before_deploy:
- pip install -r build_requirements.txt
- python setup.py bdist_wheel
- *build_package
deploy:
- provider: pypi
# `skip_cleanup: true` is required to preserve binary wheels, built
Expand Down
4 changes: 2 additions & 2 deletions exec_helpers/_ssh_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __init__(
auth: typing.Optional[ssh_auth.SSHAuth] = None,
verbose: bool = True,
) -> None:
"""SSHClient helper.
"""Main SSH Client helper.
:param host: remote hostname
:type host: str
Expand Down Expand Up @@ -387,7 +387,7 @@ def __str__(self) -> str: # pragma: no cover

@property
def _ssh(self) -> paramiko.SSHClient:
"""ssh client object getter for inheritance support only.
"""Ssh client object getter for inheritance support only.
Attention: ssh client object creation and change
is allowed only by __init__ and reconnect call.
Expand Down
2 changes: 1 addition & 1 deletion exec_helpers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
logger: logging.Logger,
log_mask_re: typing.Optional[str] = None,
) -> None:
"""ExecHelper global API.
"""Global ExecHelper API.
:param log_mask_re: regex lookup rule to mask command for logger.
all MATCHED groups will be replaced by '<*masked*>'
Expand Down
2 changes: 1 addition & 1 deletion exec_helpers/ssh_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __get_public_key(key: typing.Union[paramiko.RSAKey, None])-> typing.Optional

@property
def public_key(self) -> typing.Optional[str]:
"""public key for stored private key if presents else None.
"""Public key for stored private key if presents else None.
:rtype: str
"""
Expand Down
4 changes: 2 additions & 2 deletions exec_helpers/ssh_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _path_esc(path: str) -> str:
return path.replace(' ', '\ ')

def mkdir(self, path: str) -> None:
"""run 'mkdir -p path' on remote.
"""Run 'mkdir -p path' on remote.
:type path: str
"""
Expand All @@ -50,7 +50,7 @@ def mkdir(self, path: str) -> None:
self.execute("mkdir -p {}\n".format(self._path_esc(path)))

def rm_rf(self, path: str) -> None:
"""run 'rm -rf path' on remote.
"""Run 'rm -rf path' on remote.
:type path: str
"""
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ exclude =
__init__.py,
docs
ignore =
show-pep8 = True
show-source = True
count = True
max-line-length = 120

[pydocstyle]
ignore = D401, D203, D213

[aliases]
test=pytest
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ commands = flake8

[testenv:pep257]
deps =
pep257
pydocstyle
usedevelop = False
commands = pep257 exec_helpers
commands = pydocstyle exec_helpers

[testenv:install]
deps =
Expand All @@ -102,12 +102,15 @@ exclude =
build,
__init__.py,
docs

ignore =
show-pep8 = True
show-source = True
count = True
max-line-length = 120

[pydocstyle]
ignore = D401, D203, D213

[testenv:docs]
deps =
sphinx
Expand Down

0 comments on commit 8d22200

Please sign in to comment.