]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cephadm/tox.ini
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / cephadm / tox.ini
index c1d9cf6faf8f143b32ea73ac3c559a7007642a16..2cbfca70f0ed43c68c6b27d0eff6576310fddd1c 100644 (file)
@@ -10,30 +10,31 @@ skipsdist = true
 max-line-length = 100
 inline-quotes = '
 ignore =
-    E501,
+    E501, \
     W503,
 exclude =
-    .tox,
-    .vagrant,
-    __pycache__,
-    *.pyc,
-    templates,
+    .tox, \
+    .vagrant, \
+    __pycache__, \
+    *.pyc, \
+    templates, \
     .eggs
 statistics = True
 
 [autopep8]
 addopts =
-    --max-line-length {[flake8]max-line-length}
-    --ignore "{[flake8]ignore}"
-    --exclude "{[flake8]exclude}"
-    --in-place
-    --recursive
+    --max-line-length {[flake8]max-line-length} \
+    --ignore "{[flake8]ignore}" \
+    --exclude "{[flake8]exclude}" \
+    --in-place \
+    --recursive \
     --ignore-local-config
 
 [testenv]
 skip_install=true
 deps =
-  pyfakefs == 5.0
+  pyfakefs == 4.5.6 ; python_version < "3.7"
+  pyfakefs >= 5, < 6 ; python_version >= "3.7"
   mock
   pytest
 commands=pytest {posargs}
@@ -43,7 +44,7 @@ basepython = python3
 deps =
     mypy
     -c{toxinidir}/../mypy-constrains.txt
-commands = mypy --config-file ../mypy.ini {posargs:cephadm}
+commands = mypy --config-file ../mypy.ini {posargs:cephadm.py}
 
 [testenv:fix]
 basepython = python3
@@ -51,7 +52,7 @@ deps =
     autopep8
 commands =
     python --version
-    autopep8 {[autopep8]addopts} {posargs: cephadm}
+    autopep8 {[autopep8]addopts} {posargs: cephadm.py}
 
 [testenv:flake8]
 basepython = python3
@@ -60,7 +61,17 @@ deps =
     flake8 == 5.0.4
     flake8-quotes
 commands =
-    flake8 --config=tox.ini {posargs:cephadm}
-    bash -c "test $(grep 'docker.io' cephadm | wc -l) == 11"
+    flake8 --config=tox.ini {posargs:cephadm.py}
+    bash -c "test $(grep -c 'docker.io' cephadm.py) == 11"
 # Downstream distributions may choose to alter this "docker.io" number,
 # to make sure no new references to docker.io are creeping in unnoticed.
+
+# coverage env is intentionally left out of the envlist. It is here for developers
+# to run locally to generate and review test coverage of cephadm.
+[testenv:coverage]
+skip_install=true
+deps =
+  {[testenv]deps}
+  pytest-cov
+commands =
+  pytest -v --cov=cephadm --cov-report=term-missing --cov-report=html {posargs}