forked from snowflakedb/snowflake-connector-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
124 lines (115 loc) · 4.53 KB
/
tox.ini
File metadata and controls
124 lines (115 loc) · 4.53 KB
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
[coverage:report]
skip_covered = False
show_missing = True
[coverage:run]
branch = true
parallel = true
omit = */snowflake/connector/tool/*
[coverage:paths]
source = src/snowflake/connector
*/.tox/*/lib/python*/site-packages/snowflake/connector
*/.tox\*\Lib\site-packages\snowflake\connector
*/src/snowflake/connector
*\src\snowflake\connector
[tox]
minversion = 3.7
envlist = fix_lint,
py{35,36,37,38}{-pandas,-sso,},
coverage
skip_missing_interpreters = true
requires =
tox-external-wheels>=0.1.6
[testenv]
description = run the tests with pytest under {basepython}
extras =
development
pandas: pandas
sso: secure-local-storage
deps =
pip >= 19.3.1
install_command = python -m pip install -U {opts} {packages}
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
ci: SNOWFLAKE_PYTEST_OPTS = -vvv --color=yes
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
CLIENT_LOG_DIR_PATH_DOCKER
commands =
!pandas-!sso-!lambda-!extras: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}-{env:cloud_provider:unknown}.xml --ignore=test/pandas --ignore=test/sso --ignore=test/lambda {posargs} test
pandas: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}-{env:cloud_provider:unknown}.xml {posargs} test/pandas
sso: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}-{env:cloud_provider:unknown}.xml {posargs} test/sso
lambda: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}-{env:cloud_provider:unknown}.xml {posargs} test/lambda
extras: python test/extras/run.py
[testenv:coverage]
description = [run locally after tests]: combine coverage data and create report;
; generates a diff coverage against origin/master (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 {env:COV_REPORT_DIR:{toxworkdir}}/coverage.xml
coverage html -d {env:COV_REPORT_DIR:{toxworkdir}}/htmlcov
; diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
depends = py35, py36, py37, py38
[testenv:flake8]
; DEPRECATED
description = check code style with flake8
skip_install = true
deps = flake8
commands = flake8 {posargs}
[testenv:fix_lint]
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
passenv =
PROGRAMDATA
deps =
{[testenv]deps}
pre-commit >= 1.14.4, < 2
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"))'
[testenv:dev]
description = create dev environment
extras = pandas, development, sso
usedevelop = True
commands = python -m pip list --format=columns
python -c "print(r'{envpython}')"
[pytest]
addopts = -ra --strict-markers
junit_family=legacy
markers =
arrow: tests involving arrow format
pandas: tests for pandas integration
aws: tests for Amazon Cloud storage
azure: tests for Azure Cloud storage
gcp: tests for Google Cloud storage
timeout: tests that need a timeout timer
internal
[isort]
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
line_length = 120
known_first_party =snowflake,parameters,generate_test_files
known_third_party =Cryptodome,OpenSSL,asn1crypto,boto3,botocore,certifi,cryptography,dateutil,jwt,mock,numpy,pandas,pendulum,pkg_resources,pyasn1,pyasn1_modules,pytest,pytz,requests,setuptools,urllib3
[flake8]
ignore=F821,W504,E501,E402,E122,E127,E126,E128,E131,E731,E125,E722x,D100,D101,D102,D103,D104,D105,D107,D401,D204
exclude=
build,tool,.tox,parameters.py,parameters_jenkins.py,
# Disable checking virtualenv contents
*venv*
max-line-length = 120
show-source = true