Skip to content

Commit 3b9289a

Browse files
committed
no-jira: Update Test Requirements
** This reverts 879fe0e in favor of using a specific version of setuptools. ** Most people consider the deprecation of setuptools `tests_require` in 40.0.0 (this still causes errors). Previous versions also give errors but for different missing features. Setuptools 45.0.0 appears new enough to get rid of said errors while still including the `tests_require` feature. Considering 45.0.0 the sweetspot. This simplifies the travis config changes and setup.py changes. This also ensures we stick to specific versions.
1 parent 8dcb4e6 commit 3b9289a

File tree

4 files changed

+10
-57
lines changed

4 files changed

+10
-57
lines changed

.pylintrc

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
# Python code to execute, usually for sys.path manipulation such as
66
# pygtk.require().
7-
init-hook="import sys; sys.path.append('roles/openshift_node/library');sys.path.append('roles/openshift_node/callback_plugins')"
7+
#init-hook=
88

99
# Add files or directories to the ignore list. They should be base names, not
1010
# paths.
1111
ignore=CVS,setup.py,ini_file.py,profile_tasks.py,seboolean.py,sysctl.py
12-
ignore-paths=^.*test/.*$, ^tests/.*$, ^git/.*$, ^.tox/.*$
1312

1413
# Pickle collected data for later comparisons.
1514
persistent=no
@@ -61,7 +60,7 @@ confidence=
6160
# --enable=similarities". If you want to run only the classes checker, but have
6261
# no Warning level messages displayed, use"--disable=all --enable=classes
6362
# --disable=W"
64-
disable=fixme,locally-disabled,file-ignored,duplicate-code,consider-using-f-string,use-dict-literal,unnecessary-negation
63+
disable=fixme,locally-disabled,file-ignored,duplicate-code
6564

6665

6766
[REPORTS]
@@ -360,8 +359,6 @@ max-public-methods=20
360359
# Maximum number of boolean expressions in a if statement
361360
max-bool-expr=5
362361

363-
# Maximum number of arguments for a function (default=5)
364-
max-positional-arguments=10
365362

366363
[IMPORTS]
367364

setup.py

-16
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,6 @@ def run(self):
380380
print("Unsupported command for openshift-ansible")
381381

382382

383-
test_requirements_file = os.path.abspath(os.path.dirname(__file__)) + "/test-requirements.txt"
384-
with open(test_requirements_file, "r") as file:
385-
test_requirements = [
386-
line.rstrip() for line in file if not line.startswith("#")
387-
]
388-
389-
requirements_file = os.path.abspath(os.path.dirname(__file__)) + "/requirements.txt"
390-
with open(requirements_file, "r") as file:
391-
test_requirements.extend([
392-
line.rstrip() for line in file if not line.startswith("#")
393-
])
394-
395383
setup(
396384
name='openshift-ansible',
397385
license="Apache 2.0",
@@ -408,8 +396,4 @@ def run(self):
408396
'ansible_syntax': OpenShiftAnsibleSyntaxCheck,
409397
},
410398
packages=[],
411-
tests_require=test_requirements,
412-
extras_require={
413-
"test": test_requirements,
414-
}
415399
)

test-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pylint==2.4.4
99
pytest==5.4.1
1010
setuptools-lint==0.6.0
1111
yamllint==1.20.0
12+
setuptools==45.0.0

tox.ini

+7-36
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,10 @@
11
[tox]
2-
envlist = unit,flake8,pylint,yamllint,ansible_syntax
2+
envlist =
3+
py39-{unit,flake8,pylint,yamllint,ansible_syntax}
34
skipsdist=True
45
skip_missing_interpreters=True
56

67
[testenv]
7-
description = run unit tests
8-
basepython = python3.9
9-
deps =
10-
-rrequirements.txt
11-
-rtest-requirements.txt
12-
commands =
13-
pytest {posargs}
14-
15-
[testenv:pylint]
16-
description = run linter on project python files
17-
basepython = python3.9
18-
deps =
19-
-rrequirements.txt
20-
pylint: pylint>=3.3.1
21-
commands =
22-
pylint . --recursive=y --rcfile .pylintrc --fail-under=9.0
23-
24-
[testenv:flake8]
25-
basepython = python3.9
26-
deps =
27-
-rrequirements.txt
28-
-rtest-requirements.txt
29-
commands =
30-
flake8 {posargs}
31-
32-
[testenv:yamllint]
33-
basepython = python3.9
34-
deps =
35-
-rrequirements.txt
36-
-rtest-requirements.txt
37-
commands =
38-
python setup.py yamllint
39-
40-
[testenv:ansible_syntax]
418
skip_install=True
429
setenv =
4310
ANSIBLE_CONFIG = ./ansible.cfg
@@ -51,4 +18,8 @@ deps =
5118
-rtest-requirements.txt
5219

5320
commands =
54-
python setup.py ansible_syntax
21+
unit: pytest {posargs}
22+
flake8: flake8 {posargs}
23+
pylint: python setup.py lint
24+
yamllint: python setup.py yamllint
25+
ansible_syntax: python setup.py ansible_syntax

0 commit comments

Comments
 (0)