tox.ini 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. [tox]
  18. envlist = local-ci, auto-lint, lint, doc-build, doc-build-multi, code-test, integrate-test, local-integrate-test, py{36,37,38,39,310,311}
  19. [testenv]
  20. allowlist_externals =
  21. make
  22. git
  23. [testenv:auto-lint]
  24. extras = style
  25. commands =
  26. python -m isort .
  27. python -m black .
  28. python -m autoflake --in-place --remove-all-unused-imports --ignore-init-module-imports --recursive .
  29. [testenv:lint]
  30. extras = style
  31. commands =
  32. python -m isort --check .
  33. python -m black --check .
  34. python -m flake8
  35. python -m autoflake --remove-all-unused-imports --ignore-init-module-imports --check --recursive .
  36. [testenv:code-test]
  37. extras = test
  38. # Run both tests and coverage
  39. commands =
  40. python -m pytest --cov=pydolphinscheduler --cov-config={toxinidir}/.coveragerc tests/
  41. [testenv:doc-build]
  42. extras = doc
  43. commands =
  44. make -C {toxinidir}/docs clean
  45. make -C {toxinidir}/docs html
  46. [testenv:doc-build-multi]
  47. extras = doc
  48. commands =
  49. # Get all tags for `multiversion` subcommand
  50. git fetch --tags
  51. make -C {toxinidir}/docs clean
  52. make -C {toxinidir}/docs multiversion
  53. [testenv:integrate-test]
  54. extras = test
  55. commands =
  56. python -m pytest tests/integration/
  57. [testenv:local-integrate-test]
  58. extras = test
  59. setenv =
  60. skip_launch_docker = true
  61. commands =
  62. {[testenv:integrate-test]commands}
  63. # local-ci do not build `doc-build-multi`
  64. [testenv:local-ci]
  65. extras = dev
  66. commands =
  67. {[testenv:lint]commands}
  68. {[testenv:code-test]commands}
  69. {[testenv:doc-build]commands}