Skip to content

Commit

Permalink
Fix travis CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nitmir committed Jul 26, 2023
1 parent cf93da2 commit 551ed93
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 40 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
language: python
matrix:
include:
- python: "3.4"
- python: "3.9"
env: TOX_ENV=flake8
- python: "3.4"
- python: "3.9"
env: TOX_ENV=check_rst
- python: "3.4"
env: TOX_ENV=py34
- python: "3.5"
env: TOX_ENV=py35
- python: "3.4"
- python: "3.9"
env: TOX_ENV=py39
- python: "3.9"
env: TOX_ENV=coverage
cache:
directories:
Expand All @@ -22,4 +20,3 @@ script:
- tox -e $TOX_ENV
after_script:
- cat tox_log/*.log

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ publish_pypi_release:
python setup.py sdist upload --sign

test_venv/bin/python:
virtualenv -p python3 test_venv
python3 -m venv test_venv
test_venv/bin/pip3 install -U -r requirements-dev.txt

test_venv: test_venv/bin/python
Expand Down
5 changes: 3 additions & 2 deletions policyd_rate_limit/policyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ def action(self, connection, request):
if config.debug or time.time() - self.last_deprecation_warning > 60:
sys.stderr.write(
"WARNING: the 'count_mode' parameter is set to 0. "
"This is DEPRECATED. 'count_mode' should be set to 1 and postfix config"
" edited as stated in the README or policyd-rate-limit.yaml(5)\n"
"This is DEPRECATED. 'count_mode' should be set to 1 and postfix"
" config edited as stated in the README or "
"policyd-rate-limit.yaml(5)\n"
)
sys.stderr.flush()
self.last_deprecation_warning = time.time()
Expand Down
9 changes: 5 additions & 4 deletions policyd_rate_limit/tests/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ def test_main_afinet_socket(self):
with test_utils.lauch(self.base_config) as cfg:
self.base_test(cfg)

def test_main_afinet6_socket(self):
self.base_config["SOCKET"] = ["::1", 27184]
with test_utils.lauch(self.base_config) as cfg:
self.base_test(cfg)
# travis CI has no IPv6 support
#def test_main_afinet6_socket(self):
# self.base_config["SOCKET"] = ["::1", 27184]
# with test_utils.lauch(self.base_config) as cfg:
# self.base_test(cfg)

def test_no_debug_no_report(self):
self.base_config["debug"] = False
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pyyaml
pytest
pytest-pythonpath
pytest-warnings
coverage

28 changes: 4 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,19 @@ envlist=
check_rst,
py3


[flake8]
max-line-length=100


[base]
deps = -r{toxinidir}/requirements-dev.txt

[post_cmd]
commands=
find {toxworkdir} -name '*.pyc' -delete
find {toxworkdir} -name __pycache__ -delete
mkdir -p {toxinidir}/tox_logs/
bash -c "mv {toxworkdir}/{envname}/log/* {toxinidir}/tox_logs/"
whitelist_externals=
find
bash
mkdir

[testenv]
commands=
py.test -rw {posargs:policyd_rate_limit/tests/}
coverage report
{[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals}


[testenv:flake8]
Expand All @@ -35,8 +25,6 @@ deps=flake8
skip_install=True
commands=
flake8 {toxinidir}/policyd_rate_limit {toxinidir}/policyd-rate-limit
{[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals}


[testenv:check_rst]
Expand All @@ -47,20 +35,14 @@ deps=
skip_install=True
commands=
rst2html.py --strict {toxinidir}/README.rst /dev/null
{[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals}


[testenv:py3]
basepython=python3
deps = {[base]deps}

[testenv:py34]
basepython=python3.4
deps = {[base]deps}

[testenv:py35]
basepython=python3.5
[testenv:py39]
basepython=python3.9
deps = {[base]deps}


Expand All @@ -78,5 +60,3 @@ commands=
coverage report
coverage html
{toxinidir}/.update_coverage "{toxinidir}" "policyd-rate-limit"
{[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals}

0 comments on commit 551ed93

Please sign in to comment.