forked from snowflakedb/snowflake-sqlalchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
140 lines (128 loc) · 4.05 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
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
[tox]
min_version = 4.0.0b2
envlist = fix_lint,
py{37,38,39,310}{,-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
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}}
ci: SNOWFLAKE_PYTEST_OPTS = -vvv
commands = pytest \
{env:SNOWFLAKE_PYTEST_OPTS:} \
--cov "snowflake.sqlalchemy" \
--junitxml {toxworkdir}/junit.{envname}.xml \
{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
[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
allowlist_externals = /bin/bash
passenv = PROGRAMDATA
deps =
{[testenv]deps}
pre-commit
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
usedevelop = True
commands = python -m pip list --format=columns
python -c "print(r'{envpython}')"
[pytest]
addopts = -ra --strict-markers --ignore=tests/sqlalchemy_test_suite
junit_family = legacy
log_level = info
markers =
# Cloud provider markers
aws: tests for Amazon Cloud storage
azure: tests for Azure Cloud storage
gcp: tests for Google Cloud storage
# 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