tox.ini 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [tox]
  2. minversion = 4.0.2
  3. envlist = py3,pep8,cover
  4. skipsdist = True
  5. [vars]
  6. all_path = {toxinidir}
  7. [testenv]
  8. usedevelop = True
  9. setenv = VIRTUAL_ENV={envdir}
  10. deps =
  11. -r{toxinidir}/test-requirements.txt
  12. -r{toxinidir}/requirements.txt
  13. git+https://github.com/cloudbase/python-coriolisclient.git
  14. commands = stestr run --slowest --exclude-regex coriolis.tests.integration {posargs}
  15. [testenv:fmt]
  16. description = Format the code based on the coding style standards.
  17. deps =
  18. ruff
  19. commands =
  20. ruff check --fix {[vars]all_path}
  21. ruff format {[vars]all_path}
  22. [testenv:pep8]
  23. description = Verify the coding style (pep8).
  24. deps =
  25. ruff
  26. flake8>=7.0.0
  27. pyflakes>=3.2.0
  28. hacking>=7.0.0,<7.1.0
  29. commands =
  30. ruff format --diff {[vars]all_path}
  31. ruff check {[vars]all_path}
  32. flake8 {[vars]all_path}
  33. [testenv:cover]
  34. setenv =
  35. {[testenv]setenv}
  36. PYTHON=coverage run --source coriolis --parallel-mode
  37. commands =
  38. stestr run --no-subunit-trace --exclude-regex coriolis.tests.integration {posargs}
  39. coverage combine
  40. coverage report --fail-under=82 --skip-covered
  41. coverage html -d cover
  42. coverage xml -o cover/coverage.xml
  43. [testenv:integration]
  44. # Must be run as root: sudo -E tox -e integration
  45. # Requires losetup support (loop devices).
  46. #
  47. # To test with external providers, set CORIOLIS_SOURCE_PROVIDER_PACKAGE
  48. # and / or CORIOLIS_DESTINATION_PROVIDER_PACKAGE to a local path or
  49. # pip-compatible specifier (git+file://, git+https://, etc.) for the
  50. # provider package to install, and run:
  51. # sudo -E CORIOLIS_SOURCE_PROVIDER_PACKAGE=/path/to/provider-a \
  52. # CORIOLIS_DESTINATION_PROVIDER_PACKAGE=/path/to/provider-b \
  53. # tox -e integration
  54. setenv =
  55. {[testenv]setenv}
  56. PBR_VERSION = 0.0.1
  57. passenv =
  58. CORIOLIS_*
  59. LD_LIBRARY_PATH
  60. deps =
  61. {[testenv]deps}
  62. git+https://github.com/cloudbase/python-coriolisclient.git
  63. {env:CORIOLIS_SOURCE_PROVIDER_PACKAGE:}
  64. {env:CORIOLIS_DESTINATION_PROVIDER_PACKAGE:}
  65. commands = stestr run --slowest --concurrency=1 --test-path coriolis/tests/integration/ {posargs}
  66. [testenv:venv]
  67. commands = {posargs}
  68. [coverage:run]
  69. source = coriolis
  70. omit = coriolis/tests/*
  71. [flake8]
  72. # E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
  73. # E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
  74. #
  75. # E501 (line too long) is left to ruff line-length option
  76. # E203 (whitespace before ':') conflicts with how ruff formats slices.
  77. # H301: Do not import more than one module per line (*)
  78. # H306: Alphabetically order your imports by the full module path
  79. ignore = E125,E251,W503,W504,E305,E731,E117,W605,F632,H401,H403,H404,H405,H202,E501,E203,H301,H306
  80. exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools