1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
|
# 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.45.1
packaging==24.2
urllib3==2.2.3
tomli==2.2.1
[pytest]
ignore_args=--ignore=.tox --ignore=build --ignore=.eggs --ignore=samples
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.45.1
VIRTUALENV_PIP=24.0
VIRTUALENV_SETUPTOOLS=75.3.2
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}
python {repository_root}/eng/tox/run_coverage.py -t {tox_root} -r {repository_root}
[testenv:pylint]
description=Lints a package with pylint (version {[testenv:pylint]pylint_version})
pylint_version=3.2.7
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.5.6 --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.3.6
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.5.6 --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.14.1
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.14.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.391
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.391
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==8.2.0
sphinx_rtd_theme==3.0.2
myst_parser==4.0.1
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:next-sphinx]
description="Builds a package's documentation with the next version of sphinx"
skipsdist = true
skip_install = true
passenv = *
setenv =
{[testenv]setenv}
PROXY_URL=http://localhost:5023
deps =
{[base]deps}
sphinx==8.2.0
sphinx_rtd_theme==3.0.2
myst_parser==4.0.1
sphinxcontrib-jquery==4.1
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/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}
commands =
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
-rdev_requirements.txt
commands=
python {repository_root}/eng/tox/run_black.py -t {tox_root}
[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}
|