forked from snowflakedb/snowflake-connector-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
98 lines (91 loc) · 3.79 KB
/
tox.ini
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
[tox]
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}
external_wheels =
; external wheels location can be overwritten in command line
py35: ../../dist/docker/repaired_wheels/*cp35*.whl
py36: ../../dist/docker/repaired_wheels/*cp36*.whl
py37: ../../dist/docker/repaired_wheels/*cp37*.whl
py38: ../../dist/docker/repaired_wheels/*cp38*.whl
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
ci: SNOWFLAKE_PYTEST_OPTS = -vvv
passenv =
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
SF_PROJECT_ROOT
; This is required on windows. Otherwise pwd module won't be imported successfully, see https://github.com/tox-dev/tox/issues/1455
USERNAME
commands =
!pandas-!sso: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}.xml --ignore=test/pandas --ignore=test/sso {posargs} test
pandas: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}.xml {posargs} test/pandas
sso: pytest {env:SNOWFLAKE_PYTEST_OPTS:} --cov "snowflake.connector" --junitxml {env:JUNIT_REPORT_DIR:{toxworkdir}}/junit.{envname}.xml {posargs} test/sso
[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}}/python_connector_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, pypy, pypy3
[testenv:flake8]
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 = /bin/bash -c 'pre-commit run --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
azure: tests for Azure Cloud storage
gcp: tests for Google Cloud storage
aws: tests for Amazon Cloud storage
putget: tests that involve putting or getting files to and from Snowflake
slow: test that take a while to run
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
known_third_party =Cryptodome,OpenSSL,asn1crypto,azure,boto3,botocore,certifi,cryptography,dateutil,generate_test_files,jwt,mock,numpy,pandas,pendulum,pkg_resources,pyasn1,pyasn1_modules,pytest,pytz,requests,setuptools,urllib3