# License: Public Domain / BSD Zero Clause License
# SPDX-License-Identifier: Unlicense OR 0BSD

# ___________________________________________________________________________ #
#### tox
# @see https://tox.readthedocs.io/en/latest/#basic-example
# @see https://tox.readthedocs.io/en/latest/example/package.html
# @see https://github.com/PyCQA/pylint/blob/master/tox.ini

### To run locally ............................................................

# To run
#   tox
# To show flake8 errors, need at least -v (if flake8 is enabled)
#   tox -v
# To run even if flake8 is not enabled by default
#   tox -e flake8
# To run doctests (not integrated yet with tox)
#   pytest -vv hxlm/ --doctest-modules

### To run with travis ........................................................
# @see .travis.yml
# @see https://github.com/tox-dev/tox-travis

### To run with azure-pipelines ...............................................
# @see https://github.com/tox-dev/azure-pipelines-template

### To run with other enviroments .............................................
# While not tested/documented, tox allow other alternatives, like docker
# conda, etc, etc etc
# @see https://github.com/tox-dev

# ___________________________________________________________________________ #
# Here is where thing start
[tox]
# TODO: for now, flake is raising around 100 lint errors
#       re-enable it later (Emerson Rocha, 2021-03-03 07:02 UTC)
; envlist = py37,py38,py39,flake8,benchmark
; envlist = py37,py38,py39
envlist = py37,py38,py39,flake8


isolated_build = True
skip_missing_interpreters = true

[testenv]
# install pytest in the virtualenv where commands will be executed
deps =
    pytest
    pytest-testinfra
    flake8
    libhxl
    pyyaml
    # Note: hug is only used with hxl2tab, hxlquickmeta, hxlquickimport,
    #       its a recommended dependency, but not enforced on typical install
    hug
    # Note: slugify is only used with hxlquickmeta
    #       its a recommended dependency, but not enforced on typical install
    slugify
    # Note: pandas & Orangeis only used by hxlquickmeta,
    #       its a recommended dependency, but not enforced on typical install
    pandas
    Orange3

commands =
    pytest
    # pylint

; [testenv:pylint]
; (...)

# Orange3 dependency seems to broke hxlquickmeta, so we don't intall on py37
[testenv:py37]

deps =
    # same as other, but Orange3 is broken, we will skip it
    pytest
    pytest-testinfra
    flake8
    libhxl
    pyyaml
    hug
    slugify
    # pandas
    # Orange3

[testenv:flake8]
deps = 
    pytest
    flake8
    libhxl
    pyyaml

commands =
    flake8 hxlm/core/
