Dorothydu's picture
Upload 50 random repository samples
9d3c8f5 verified
[tox]
min_version = 4.0.0
envlist = fix_lint,
py{37,38,39,310,311}{,-pandas},
coverage,
skip_missing_interpreters = true
[testenv]
package = external
description = run the tests with pytest under {basepython}
extras =
development
pandas
external_wheels =
py37-ci: dist/*.whl
py38-ci: dist/*.whl
py39-ci: dist/.whl
py310-ci: dist/.whl
py311-ci: dist/.whl
deps = pip
passenv =
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
SF_PROJECT_ROOT
cloud_provider
SF_REGRESS_LOGS
; Github Actions provided environmental variables
GITHUB_ACTIONS
JENKINS_HOME
; This is required on windows. Otherwise pwd module won't be imported successfully,
; see https://github.com/tox-dev/tox/issues/1455
USERNAME
PYTEST_ADDOPTS
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
SQLALCHEMY_WARN_20 = 1
ci: SNOWFLAKE_PYTEST_OPTS = -vvv --tb=long
commands = pytest \
{env:SNOWFLAKE_PYTEST_OPTS:} \
--cov "snowflake.sqlalchemy" \
--junitxml {toxworkdir}/junit_{envname}.xml \
--ignore=tests/sqlalchemy_test_suite \
{posargs:tests}
pytest {env:SNOWFLAKE_PYTEST_OPTS:} \
--cov "snowflake.sqlalchemy" --cov-append \
--junitxml {toxworkdir}/junit_{envname}.xml \
{posargs:tests/sqlalchemy_test_suite}
[testenv:.pkg_external]
deps = build
package_glob = {toxinidir}{/}dist{/}*.whl
commands =
pyproject-build -w . -o {toxinidir}{/}dist
[testenv:coverage]
description = [run locally after tests]: combine coverage data and create report;
generates a diff coverage against origin/main (can be changed by setting DIFF_AGAINST env var)
deps = {[testenv]deps}
coverage
;diff_cover
skip_install = True
passenv = DIFF_AGAINST
setenv = COVERAGE_FILE={toxworkdir}/.coverage
commands = coverage combine
coverage report -m
coverage xml -o {toxworkdir}/coverage.xml
coverage html -d {toxworkdir}/htmlcov
;diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
depends = py37, py38, py39, py310, py311
[testenv:fix_lint]
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
basepython = python3.8
passenv =
PROGRAMDATA
deps =
{[testenv]deps}
tomlkit
pre-commit >= 2.9.0
skip_install = True
commands = pre-commit run --all-files
python -c 'import pathlib; print("hint: run \{\} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))'
[pytest]
addopts = -ra --ignore=tests/sqlalchemy_test_suite
junit_family = legacy
log_level = info
markers =
# Optional dependency groups markers
lambda: AWS lambda tests
pandas: tests for pandas integration
sso: tests for sso optional dependency integration
# Cloud provider markers
aws: tests for Amazon Cloud storage
azure: tests for Azure Cloud storage
gcp: tests for Google Cloud storage
# Test type markers
integ: integration tests
unit: unit tests
skipolddriver: skip for old driver tests
# Other markers
timeout: tests that need a timeout time
internal: tests that could but should only run on our internal CI
external: tests that could but should only run on our external CI
[isort]
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
line_length = 88
known_first_party =snowflake,parameters,generate_test_files
[flake8]
# Notes on ignores:
# - all ignored Ds mean doc issues, these should be cleaned up
ignore = B011,C901,D100,D101,D102,D103,D104,D105,D107,D401,E203,E402,E501,F821,W503
exclude=
build,tool,.tox,parameters.py,parameters_jenkins.py,
# Disable checking virtualenv contents
*venv*
max-line-length = 88
show-source = true
[coverage:report]
skip_covered = False
show_missing = True
[coverage:run]
branch = true
parallel = true
[coverage:paths]
source =
src/snowflake/sqlalchemy
*/snowflake/sqlalchemy
*\snowflake\sqlalchemy
*/snowflake-sqlalchemy
*\snowflake-sqlalchemy