tox.ini 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # 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, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. [testenv]
  18. commands =
  19. {toxinidir}/superset/bin/superset db upgrade
  20. {toxinidir}/superset/bin/superset init
  21. nosetests tests/load_examples_test.py
  22. nosetests --exclude=load_examples_test {posargs:tests}
  23. deps =
  24. -rrequirements.txt
  25. -rrequirements-dev.txt
  26. setenv =
  27. PYTHONPATH = {toxinidir}
  28. SUPERSET_CONFIG = tests.superset_test_config
  29. SUPERSET_HOME = {envtmpdir}
  30. py36-mysql: SUPERSET__SQLALCHEMY_DATABASE_URI = mysql://mysqluser:mysqluserpassword@localhost/superset?charset=utf8
  31. py36-postgres: SUPERSET__SQLALCHEMY_DATABASE_URI = postgresql+psycopg2://postgresuser:pguserpassword@localhost/superset
  32. py36-sqlite: SUPERSET__SQLALCHEMY_DATABASE_URI = sqlite:////{envtmpdir}/superset.db
  33. whitelist_externals =
  34. npm
  35. [testenv:black]
  36. commands =
  37. black --check setup.py superset tests
  38. deps =
  39. -rrequirements-dev.txt
  40. [testenv:cypress-dashboard]
  41. commands =
  42. npm install -g npm@'>=6.5.0'
  43. pip install -e {toxinidir}/
  44. {toxinidir}/superset-frontend/cypress_build.sh dashboard
  45. deps =
  46. -rrequirements.txt
  47. -rrequirements-dev.txt
  48. setenv =
  49. PYTHONPATH = {toxinidir}
  50. SUPERSET_CONFIG = tests.superset_test_config
  51. SUPERSET_HOME = {envtmpdir}
  52. [testenv:cypress-explore]
  53. commands =
  54. npm install -g npm@'>=6.5.0'
  55. pip install -e {toxinidir}/
  56. {toxinidir}/superset-frontend/cypress_build.sh explore
  57. deps =
  58. -rrequirements.txt
  59. -rrequirements-dev.txt
  60. setenv =
  61. PYTHONPATH = {toxinidir}
  62. SUPERSET_CONFIG = tests.superset_test_config
  63. SUPERSET_HOME = {envtmpdir}
  64. [testenv:cypress-sqllab]
  65. commands =
  66. npm install -g npm@'>=6.5.0'
  67. pip install -e {toxinidir}/
  68. {toxinidir}/superset-frontend/cypress_build.sh sqllab
  69. deps =
  70. -rrequirements.txt
  71. -rrequirements-dev.txt
  72. setenv =
  73. PYTHONPATH = {toxinidir}
  74. SUPERSET_CONFIG = tests.superset_test_config
  75. SUPERSET_HOME = {envtmpdir}
  76. [testenv:cypress-sqllab-backend-persist]
  77. commands =
  78. npm install -g npm@'>=6.5.0'
  79. pip install -e {toxinidir}/
  80. {toxinidir}/superset-frontend/cypress_build.sh sqllab
  81. deps =
  82. -rrequirements.txt
  83. -rrequirements-dev.txt
  84. setenv =
  85. PYTHONPATH = {toxinidir}
  86. SUPERSET_CONFIG = tests.superset_test_config_sqllab_backend_persist
  87. SUPERSET_HOME = {envtmpdir}
  88. [testenv:eslint]
  89. changedir = {toxinidir}/superset-frontend
  90. commands =
  91. npm run lint
  92. deps =
  93. [testenv:fossa]
  94. commands =
  95. {toxinidir}/scripts/fossa.sh
  96. deps =
  97. passenv = *
  98. [testenv:isort]
  99. commands =
  100. isort --check-only --recursive setup.py superset tests
  101. deps =
  102. -rrequirements-dev.txt
  103. [testenv:javascript]
  104. commands =
  105. npm install -g npm@'>=6.5.0'
  106. {toxinidir}/superset-frontend/js_build.sh
  107. deps =
  108. [testenv:license-check]
  109. commands =
  110. {toxinidir}/scripts/check_license.sh
  111. passenv = *
  112. whitelist_externals =
  113. {toxinidir}/scripts/check_license.sh
  114. deps =
  115. [testenv:mypy]
  116. commands =
  117. mypy setup.py superset tests
  118. deps =
  119. -rrequirements-dev.txt
  120. [testenv:py36-mysql]
  121. deps =
  122. -rrequirements.txt
  123. -rrequirements-dev.txt
  124. .[mysql]
  125. [testenv:py36-postgres]
  126. deps =
  127. -rrequirements.txt
  128. -rrequirements-dev.txt
  129. .[postgres]
  130. [testenv:pylint]
  131. commands =
  132. pylint superset
  133. deps =
  134. -rrequirements.txt
  135. -rrequirements-dev.txt
  136. [testenv:docs]
  137. commands =
  138. cp -r superset-frontend/images/ docs/_static/images/
  139. sphinx-build -b html docs _build/html -W
  140. deps =
  141. -rrequirements.txt
  142. -rrequirements-dev.txt
  143. -rdocs/requirements.txt
  144. [tox]
  145. envlist =
  146. fossa
  147. black
  148. cypress-dashboard
  149. cypress-explore
  150. cypress-sqllab
  151. cypress-sqllab-backend-persist
  152. eslint
  153. isort
  154. javascript
  155. mypy
  156. pylint
  157. license-check
  158. docs
  159. skipsdist = true