Asib27's picture
try 1
065fee7 verified
raw
history blame
16.4 kB
# This tox file is intended for use with any generic development feed. The only requirement is that the development feed
# contain azure* prefixed packages. It does this by assuming that `PIP_INDEX_URL` environment variable is set to target the dev feed
# specifically. Notice that in the [testenv] config, we explicitly set PIP_EXTRA_INDEX_URL to pypi.
# In all cases, whenever we install an azure-* package from a requirement (read: not a specific file), the only source will be from the dev feed.
# once we've downloaded these dependencies, only then do we install other packages from pypi.
[tox]
requires=
# Ensure that we're running a version of tox compatible with this config
# 4.4.10 is the lower bound because it incorporates a fix for a bug with `--root`:
# https://github.com/tox-dev/tox/pull/2962
tox>=4.4.10
# note that this envlist is the default set of environments that will run if a target environment is not selected.
envlist = whl,sdist
[tools]
deps =
-r {repository_root}/eng/test_tools.txt
[coverage:paths]
source =
azure
**/azure
microsoft
**/microsoft
[base]
deps =
-rdev_requirements.txt
{[tools]deps}
[dependencytools]
deps =
-r {repository_root}/eng/dependency_tools.txt
[packaging]
pkgs =
wheel==0.43.0
packaging==23.1
urllib3==1.26.15
tomli==2.0.1
[pytest]
ignore_args=--ignore=.tox --ignore=build --ignore=.eggs
default_args = -rsfE --junitxml={tox_root}/test-junit-{envname}.xml --verbose --cov-branch --durations=10 --ignore=azure {[pytest]ignore_args} --log-cli-level={pytest_log_level}
[testenv]
parallel_show_output =True
skip_install = true
skipsdist = true
usedevelop = false
passenv = *
download=true
requires=
{[packaging]pkgs}
setenv =
SPHINX_APIDOC_OPTIONS=members,undoc-members,inherited-members
PIP_EXTRA_INDEX_URL=https://pypi.python.org/simple
PROXY_URL=http://localhost:5000
VIRTUALENV_WHEEL=0.37.0
VIRTUALENV_PIP=24.0
VIRTUALENV_SETUPTOOLS=67.6.0
deps = {[base]deps}
install_command = python -m pip install {opts} {packages} --cache-dir {tox_root}/../.tox_pip_cache_{envname}
commands =
python -m pip --version
python {repository_root}/eng/tox/create_package_and_install.py -d {envtmpdir} -p {tox_root} -w {envtmpdir}
python -m pip freeze
pytest {[pytest]default_args} {posargs} {tox_root}
[testenv:pylint]
description=Lints a package with pylint (version {[testenv:pylint]pylint_version})
pylint_version=3.1.0
skipsdist = true
skip_install = true
usedevelop = false
setuptools_enable=
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
setenv =
{[testenv]setenv}
{[testenv:pylint]setuptools_enable}
PROXY_URL=http://localhost:5002
deps =
-rdev_requirements.txt
commands =
python -m pip install pylint=={[testenv:pylint]pylint_version}
python -m pip install azure-pylint-guidelines-checker==0.4.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/run_pylint.py -t {tox_root}
[testenv:next-pylint]
description=Lints a package with pylint (version {[testenv:next-pylint]pylint_version})
pylint_version=3.2.5
skipsdist = true
skip_install = true
usedevelop = false
setuptools_enable=
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
setenv =
{[testenv]setenv}
{[testenv:pylint]setuptools_enable}
PROXY_URL=http://localhost:5002
deps =
-rdev_requirements.txt
PyGitHub>=1.59.0
commands =
python -m pip install pylint=={[testenv:next-pylint]pylint_version}
python -m pip install azure-pylint-guidelines-checker==0.4.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/run_pylint.py -t {tox_root} --next=True
[testenv:ruff]
description=Lints a package with ruff
skipsdist = true
skip_install = true
usedevelop = false
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5022
deps =
{[base]deps}
ruff
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/run_ruff.py -t {tox_root}
[testenv:mypy]
description=Typechecks a package with mypy (version {[testenv:mypy]mypy_version})
mypy_version=1.9.0
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5003
deps =
{[base]deps}
mypy=={[testenv:mypy]mypy_version}
types-chardet==5.0.4.6
types-requests==2.31.0.6
types-six==1.16.21.9
types-redis==4.6.0.7
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/create_dependencies_and_install.py -p {tox_root}
python {repository_root}/eng/tox/run_mypy.py -t {tox_root}
[testenv:next-mypy]
description=Typechecks a package with the latest version of mypy
mypy_version=1.10.1
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5020
deps =
{[base]deps}
mypy=={[testenv:next-mypy]mypy_version}
types-chardet==5.0.4.6
types-requests==2.31.0.6
types-six==1.16.21.9
types-redis==4.6.0.7
PyGitHub>=1.59.0
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/create_dependencies_and_install.py -p {tox_root}
python {repository_root}/eng/tox/run_mypy.py -t {tox_root} --next=True
[testenv:pyright]
description=Typechecks a package with pyright (version {[testenv:pyright]pyright_version})
pyright_version=1.1.359
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5018
deps =
{[base]deps}
pyright=={[testenv:pyright]pyright_version}
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/create_dependencies_and_install.py -p {tox_root}
python {repository_root}/eng/tox/run_pyright.py -t {tox_root}
[testenv:next-pyright]
description=Typechecks a package with the latest version of static type-checker pyright
pyright_version=1.1.371
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5021
deps =
{[base]deps}
pyright=={[testenv:next-pyright]pyright_version}
PyGitHub>=1.59.0
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/create_dependencies_and_install.py -p {tox_root}
python {repository_root}/eng/tox/run_pyright.py -t {tox_root} --next=True
[testenv:verifytypes]
description=Verifies the "type completeness" of a package with pyright
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5019
deps =
{[base]deps}
pyright==1.1.287
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/create_dependencies_and_install.py -p {tox_root}
python {repository_root}/eng/tox/run_verifytypes.py -t {tox_root}
[testenv:whl_no_aio]
description=Builds a wheel without aio and runs tests
skipsdist = true
skip_install = true
deps =
{[base]deps}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5004
commands =
- python -m pip uninstall aiohttp --yes
python {repository_root}/eng/tox/create_package_and_install.py -d {envtmpdir} -p {tox_root} -w {envtmpdir}
python {repository_root}/eng/tox/try_import.py aiohttp -p {tox_root}
python -m pip freeze
pytest {[pytest]default_args} --ignore-glob='*async*.py' {posargs} --no-cov {tox_root}
[testenv:whl]
description=Builds a wheel and runs tests
[testenv:sdist]
description=Builds a source distribution and runs tests
skipsdist = true
skip_install = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5005
deps =
{[base]deps}
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir} \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python -m pip freeze
pytest {posargs} --no-cov {[pytest]ignore_args} {tox_root}
[testenv:develop]
description=Tests a package
skipsdist = false
skip_install = false
usedevelop = true
deps =
{[base]deps}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5006
commands =
pytest {posargs} --ignore=.tox {tox_root}
[testenv:sphinx]
description="Builds a package's documentation with sphinx"
skipsdist = true
skip_install = true
passenv = *
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5007
deps =
{[base]deps}
sphinx==7.3.7
sphinx_rtd_theme==1.3.0
myst_parser==2.0.0
sphinxcontrib-jquery==4.1
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/eng/tox/prep_sphinx_env.py -d {envtmpdir}/dist -t {tox_root}
python {repository_root}/eng/tox/run_sphinx_apidoc.py -w {envtmpdir}/dist -r {tox_root}
python {repository_root}/eng/tox/run_sphinx_build.py \
-w {envtmpdir}/dist/unzipped/docgen \
-o {envtmpdir}/dist/site \
-r {tox_root}
[testenv:depends]
description = Ensures all modules in a target package can be successfully imported
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5008
deps =
{[packaging]pkgs}
commands =
python -m pip install {repository_root}/tools/azure-sdk-tools --no-deps
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir} \
-p {tox_root} \
-w {envtmpdir}
python -m pip freeze
python {repository_root}/eng/tox/import_all.py -t {tox_root}
[testenv:verifywhl]
description=Verify directories included in whl and contents in manifest file
skipsdist = true
skip_install = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5009
deps =
{[packaging]pkgs}
commands =
python -m pip install {repository_root}/tools/azure-sdk-tools --no-deps
python {repository_root}/eng/tox/create_package_and_install.py -d {envtmpdir} -p {tox_root} --skip-install True
python {repository_root}/eng/tox/verify_whl.py -d {envtmpdir} -t {tox_root}
[testenv:verifysdist]
description=Verify directories included in sdist and contents in manifest file. Also ensures that py.typed configuration is correct within the setup.py
skipsdist = true
skip_install = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5010
deps =
{[packaging]pkgs}
commands =
python -m pip install {repository_root}/tools/azure-sdk-tools --no-deps
python {tox_root}/setup.py --q sdist -d {envtmpdir}
python {repository_root}/eng/tox/verify_sdist.py -d {envtmpdir} -t {tox_root}
[testenv:devtest]
description=Tests a package against dependencies installed from a dev index
deps = {[base]deps}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5011
commands =
python {repository_root}/eng/tox/create_package_and_install.py -d {envtmpdir} -p {tox_root}
python {repository_root}/eng/tox/install_dev_build_dependency.py -t {tox_root}
pytest {[pytest]default_args} --ignore=.tox {posargs} {tox_root}
[deptestcommands]
commands =
python {repository_root}/eng/tox/install_depend_packages.py -t {tox_root} -d {env:DEPENDENCY_TYPE:} -w {envtmpdir}
python {repository_root}/eng/tox/create_package_and_install.py -d {envtmpdir} -p {tox_root} -w {envtmpdir} --pre-download-disabled
python -m pip freeze
python {repository_root}/eng/tox/verify_installed_packages.py --packages-file {envtmpdir}/packages.txt
pytest {[pytest]default_args} {posargs} --no-cov {tox_root}
[testenv:latestdependency]
description=Tests a package against the released, upper-bound versions of its azure dependencies
deps =
{[dependencytools]deps}
{[tools]deps}
passenv = *
setenv =
{[testenv]setenv}
DEPENDENCY_TYPE=Latest
PROXY_URL=http://localhost:5012
commands =
{[deptestcommands]commands}
[testenv:mindependency]
description=Tests a package against the released, lower-bound versions of its azure dependencies
deps =
azure-mgmt-keyvault<7.0.0
azure-mgmt-resource<15.0.0
azure-mgmt-storage<15.0.0
{[dependencytools]deps}
{[tools]deps}
passenv = *
setenv =
{[testenv]setenv}
DEPENDENCY_TYPE=Minimum
PROXY_URL=http://localhost:5013
commands =
{[deptestcommands]commands}
[testenv:apistub]
description=Generate an api stub of a package ( for https://apiview.dev )
skipsdist = true
skip_install = true
usedevelop = false
changedir = {envtmpdir}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5014
deps =
{[base]deps}
commands =
# install API stub generator
python -m pip install -r {repository_root}/eng/apiview_reqs.txt --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
python -m pip freeze
python {repository_root}/eng/tox/run_apistubgen.py -t {tox_root} -w {envtmpdir} {posargs}
[testenv:bandit]
description=Runs bandit, a tool to find common security issues, against a package
skipsdist = true
skip_install = true
usedevelop = false
changedir = {envtmpdir}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5015
deps =
{[base]deps}
importlib-metadata<5.0
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir} \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python -m pip freeze
python {repository_root}/eng/tox/run_bandit.py -t {tox_root}
[testenv:samples]
description="Runs a package's samples"
skipsdist = false
skip_install = false
usedevelop = false
changedir = {envtmpdir}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5016
deps =
{[base]deps}
subprocess32; python_version < '3.5'
commands =
python -m pip freeze
python {repository_root}/scripts/devops_tasks/test_run_samples.py -t {tox_root}
[testenv:verify_keywords]
description="Ensures that the classifiers for a given package align with azure-sdk requirements."
skipsdist = true
skip_install = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5005
deps =
{[base]deps}
commands =
sdk_verify_keywords -t {tox_root}
[testenv:breaking]
description=Runs the breaking changes checker against a package
skipsdist = true
skip_install = true
usedevelop = true
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5017
deps =
{[base]deps}
jsondiff==1.2.0
-e {repository_root}/scripts/breaking_changes_checker
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir}/dist \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python {repository_root}/scripts/breaking_changes_checker/detect_breaking_changes.py -t {tox_root} {posargs}
[testenv:black]
description=Runs the code formatter black
skip_install=true
deps=
black==24.4.0
commands=
black --config {repository_root}/eng/black-pyproject.toml {posargs}
[testenv:generate]
description=Regenerate the code
skip_install=true
deps =
{[base]deps}
tomli==2.0.1
commands=
python -m packaging_tools.generate_client
[testenv:optional]
skipsdist = true
skip_install = true
usedevelop = true
changedir = {toxinidir}
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5018
commands =
{envbindir}/python -m pip install {toxinidir}/../../../tools/azure-sdk-tools[build]
python {repository_root}/eng/tox/run_optional.py -t {toxinidir} --temp={envtmpdir} {posargs}