| [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 |
| JENKINS_HOME |
| |
| |
| 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 |
| |
| 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 |
| |
| 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 |
|
|
| [pytest] |
| addopts = -ra --ignore=tests/sqlalchemy_test_suite |
| junit_family = legacy |
| log_level = info |
| markers = |
| |
| lambda: AWS lambda tests |
| pandas: tests for pandas integration |
| sso: tests for sso optional dependency integration |
| |
| aws: tests for Amazon Cloud storage |
| azure: tests for Azure Cloud storage |
| gcp: tests for Google Cloud storage |
| |
| integ: integration tests |
| unit: unit tests |
| skipolddriver: skip for old driver tests |
| |
| 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] |
| |
| |
| 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, |
| |
| *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 |
|
|