<commit_before>[tox]
minversion = 3.8.0
requires =
    tox-pyenv
envlist =
    py39
    py38
    py37
    py36
ignore_basepython_conflict = True
skip_missing_interpreters = True
skipdist = True

[gh-actions]
python =
    3.6: py36
    3.7: py37
    3.8: py38
    3.9: py39


[testenv]
usedevelop = True
# hide deps from stdout https://github.com/tox-dev/tox/issues/601
# list_dependencies_command=echo
extras =
    cli
    opt
deps =
    -r requirements.txt
    -r test-requirements.txt
sitepackages=False
commands=
    git clean -xdf jira tests
    python -m pip check
    python make_local_jira_user.py
    python -m pytest {posargs}
setenv =
    PIP_LOG={envdir}/pip.log
    PIP_DISABLE_PIP_VERSION_CHECK=1
    # Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
    PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
    CI_JIRA_URL=http://localhost:2990/jira
    CI_JIRA_ADMIN=admin
    CI_JIRA_ADMIN_PASSWORD=<PASSWORD>
    CI_JIRA_USER=jira_user
    CI_JIRA_USER_PASSWORD=<PASSWORD>
    CI_JIRA_ISSUE=Task
passenv =
    CI
    CI_JIRA_*
    CURL_CA_BUNDLE
    PIP_*
    REQUESTS_CA_BUNDLE
    SSL_CERT_FILE
    TWINE_*
    XDG_CACHE_HOME
    # For Windows users, getpass.get_user() needs USERNAME
    USERNAME
envars =
    PIP_DISABLE_PIP_VERSION_CHECK=1
    PIP_USER=no
whitelist_externals =
    git

[testenv:deps]
description = Update dependency lock files
# Force it to use oldest supported version of python or we would lose ability
# to get pinning correctly.
basepython = python3.6
deps =
    pip-tools >= 6.1.0
commands =
    pip-compile -o requirements.txt setup.cfg --extra cli,docs,opt,async
    pip-compile -o test-requirements.txt setup.cfg test-requirements.in

[testenv:docs]
extras =
    docs
# changedir=docs
usedevelop = False
skipdist = False
setenv =
    PYTHONHTTPSVERIFY=0
commands =
    sphinx-build \
      -a -n -v -W --keep-going \
      -b html --color \
      -d "{toxworkdir}/docs_doctree" \
      docs/ "{toxworkdir}/docs_out"

    # Print out the output docs dir and a way to serve html:
    python -c \
    'import pathlib; '\
    'docs_dir = pathlib.Path(r"{toxworkdir}") / "docs_out"; index_file = docs_dir / "index.html"; print(f"\nDocumentation available under `file://\{index_file\}`\n\nTo serve docs, use `python3 -m http.server --directory \{docs_dir\} 0`\n")'

[testenv:pkg]
deps =
    collective.checkdocs>=0.2
    build>=0.3.0
    pip>=19.2.3
    setuptools>=41.4
    twine>=2.0.0
    wheel>=0.33.6
commands =
    git clean -xdf dist
    python setup.py check -m -s
    # disabled due to errors with older setuptools:
    # python setup.py sdist bdist_wheel
    python -m build --wheel --sdist .
    python -m twine check dist/*

[testenv:lint]
deps = pre-commit>=1.17.0
commands=
    python -m pre_commit run --color=always {posargs:--all}
extras =
skip_install = true
usedevelop = false

[testenv:maintenance]
# this will obliterate your jira instance, used to clean the CI server
commands=
    python examples/maintenance.py

[testenv:publish]
description = Publish package
envdir = {toxworkdir}/pkg
deps = {[testenv:pkg]deps}
commands =
    {[testenv:pkg]commands}
    twine upload dist/*<commit_msg>Cleanup tox.ini publish (#1028)<commit_after>[tox]
minversion = 3.8.0
requires =
    tox-pyenv
envlist =
    py39
    py38
    py37
    py36
ignore_basepython_conflict = True
skip_missing_interpreters = True
skipdist = True

[gh-actions]
python =
    3.6: py36
    3.7: py37
    3.8: py38
    3.9: py39


[testenv]
usedevelop = True
# hide deps from stdout https://github.com/tox-dev/tox/issues/601
# list_dependencies_command=echo
extras =
    cli
    opt
deps =
    -r requirements.txt
    -r test-requirements.txt
sitepackages=False
commands=
    git clean -xdf jira tests
    python -m pip check
    python make_local_jira_user.py
    python -m pytest {posargs}
setenv =
    PIP_LOG={envdir}/pip.log
    PIP_DISABLE_PIP_VERSION_CHECK=1
    # Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
    PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
    CI_JIRA_URL=http://localhost:2990/jira
    CI_JIRA_ADMIN=admin
    CI_JIRA_ADMIN_PASSWORD=<PASSWORD>
    CI_JIRA_USER=jira_user
    CI_JIRA_USER_PASSWORD=<PASSWORD>
    CI_JIRA_ISSUE=Task
passenv =
    CI
    CI_JIRA_*
    CURL_CA_BUNDLE
    PIP_*
    REQUESTS_CA_BUNDLE
    SSL_CERT_FILE
    TWINE_*
    XDG_CACHE_HOME
    # For Windows users, getpass.get_user() needs USERNAME
    USERNAME
envars =
    PIP_DISABLE_PIP_VERSION_CHECK=1
    PIP_USER=no
whitelist_externals =
    git

[testenv:deps]
description = Update dependency lock files
# Force it to use oldest supported version of python or we would lose ability
# to get pinning correctly.
basepython = python3.6
deps =
    pip-tools >= 6.1.0
commands =
    pip-compile -o requirements.txt setup.cfg --extra cli,docs,opt,async
    pip-compile -o test-requirements.txt setup.cfg test-requirements.in

[testenv:docs]
extras =
    docs
# changedir=docs
usedevelop = False
skipdist = False
setenv =
    PYTHONHTTPSVERIFY=0
commands =
    sphinx-build \
      -a -n -v -W --keep-going \
      -b html --color \
      -d "{toxworkdir}/docs_doctree" \
      docs/ "{toxworkdir}/docs_out"

    # Print out the output docs dir and a way to serve html:
    python -c \
    'import pathlib; '\
    'docs_dir = pathlib.Path(r"{toxworkdir}") / "docs_out"; index_file = docs_dir / "index.html"; print(f"\nDocumentation available under `file://\{index_file\}`\n\nTo serve docs, use `python3 -m http.server --directory \{docs_dir\} 0`\n")'

[testenv:pkg]
deps =
    build>=0.3.1.post1
    pip>=21.1.1
    setuptools>=56.2.0
    twine>=3.4.1
    wheel>=0.36.2
commands =
    git clean -xdf dist
    python setup.py check -m -s
    # disabled due to errors with older setuptools:
    # python setup.py sdist bdist_wheel
    python -m build --wheel --sdist .
    python -m twine check dist/*
usedevelop = false

[testenv:lint]
deps = pre-commit>=1.17.0
commands=
    python -m pre_commit run --color=always {posargs:--all}
extras =
skip_install = true
usedevelop = false

[testenv:maintenance]
# this will obliterate your jira instance, used to clean the CI server
commands=
    python examples/maintenance.py

[testenv:publish]
description = Publish package
envdir = {toxworkdir}/pkg
deps = {[testenv:pkg]deps}
commands =
    {[testenv:pkg]commands}
    twine upload dist/*
usedevelop = false
{'fraction_non_alphanumeric': 0.10462211118051218, 'fraction_numerical': 0.025296689569019364, 'mean_word_length': 3.1536964980544746, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5224314', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2362, 'n_words': 561}