#
# To convert kubernetes manifest files to RDF, run:
#  tox -e kubernetes
#
[tox]
envlist = py3, safety
skipsdist=True

[testenv]
deps =
  -rrequirements.txt
  -rrequirements-dev.txt

# Uncomment here to set an extra PIP_INDEX_URL
# setenv =
#    PIP_EXTRA_INDEX_URL = https://mypypiserver.org

setenv =
  PYTHONPATH=:.:

passenv =
  TEST_KUBERDF_FILE

# To show pytest logs in console, use
#   tox -- --log-cli-level=DEBUG
commands =
  pytest tests {posargs}

[testenv:docs]
deps = rdflib

commands =
  python scripts/build.py

[testenv:kube-to-rdf]
commands =
  python -m kuberdf {posargs}

[testenv:safety]
deps =
  -rrequirements.txt
  -rrequirements-dev.txt
  safety

setenv =
  PYTHONPATH=:.:

commands =
  safety check --short-report -r requirements.txt

[flake8]
# Ignore long lines in flake8 because
#   they are managed by black and we
#   want to support links.
max-line-length = 150

# Ignore whitespace before ':'
#   because black adds it.
extend-ignore = E203


[testenv:release]
# Release with tox via:
#
#    tox -e release -- $PARAMETERS
#
# passing the repo references you would set via
# twine, eg:
#  --repository-url https://test.pypi.org/legacy/
#
# To pass
deps =
  wheel
  twine

# Limit TWINE_* to this section.
passenv =
  TWINE_USERNAME
  TWINE_PASSWORD
  TWINE_REPOSITORY_URL

commands =
#  rm dist -rf
  python setup.py bdist_wheel  # sdist, or whatever
  twine upload {posargs} dist/*


# Uncomment the following section if you want to
#  test the installation on the test pypi
# [testenv:test-release]
#commands =
#  pip install --index-url=https://test.pypi.org/simple