forked from recommenders-team/recommenders
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
99 lines (84 loc) · 3.18 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
[tox]
# py will use whatever the basepython `python` maps to from PATH
# you can use py38, for example, to chosse a different version
# See https://tox.readthedocs.io/en/latest/config.html#tox-environments
envlist = py, cpu, gpu, spark, all
# Default env settings
[testenv]
# similar to 'pip install recommenders-*.whl[test]'
extras = all
commands =
# {posargs} will be substituded by arguments after the `--` when running.
# This will allow running subset of the test suite via tox.
#
# EX: tox -- -m "not spark and not gpu"
# will pass {-m "not spark and not gpu"} to `pytest`
# See https://tox.readthedocs.io/en/latest/example/general.html for more details
pytest {posargs}
[testenv:cpu]
# i.e: 'pip install recommenders-*.whl[dev]'
# with this dependency subset, we should be able to run the test markers:
# 1. "not notebooks and not spark and not gpu" (tests for general sdk utilities)
# 2. "notebooks and not spark and not gpu" (tests for notebook example without extra dependencies)
extras = dev,examples
[testenv:gpu]
# with this dependency subset, we should be able to run the test markers:
# 1. "gpu and not notebook and not spark" (tests for gpu utilities)
# 2. "gpu and notebooks and not spark" (tests for notebooks needing gpu resources)
extras = dev,gpu,examples
[testenv:spark]
# with this dependency subset, we should be able to run the test markers:
# 1. "spark and not notebook and not spark" (test for spark utilities)
# 2. "spark and notebooks and not spark" (tests for notebook using spark)
extras = dev,spark,examples
[testenv:all]
# i.e: 'pip install recommenders-*.whl[all]'
# with this, we should be able to run ANY tests
extras = all
[testenv:flake8]
deps = flake8
skip_install = True
commands = flake8 .
# Configurations for running pytest
[pytest]
log_cli = False
log_format = %(asctime)s %(levelname)s %(message)s
junit_family = xunit2
# This enable custom marker as decorator "@pytest.mark.gpu"
markers =
# markers allow to us to run faster subset of the test:
# EX: pytest -m "not spark and not gpu"
# See https://docs.pytest.org/en/stable/example/markers.html#registering-markers
deeprec: test deeprec model
sequential: test sequential model
notebooks: mark a test as notebooks test
smoke: mark a test as smoke test
integration: mark a test as integration test
gpu: mark a test as gpu test
spark: mark a test as spark test
vw: mark a test as vowpal wabbit test
testpaths =
tests
addopts =
# reports all (except passed tests). See https://docs.pytest.org/en/latest/usage.html#detailed-summary-report
-ra
--durations 10
--cov-append --cov=recommenders --cov-report=term --cov-report=xml --junitxml=junit/test-results.xml
[coverage:report]
skip_empty = true
skip_covered = true
[flake8]
ignore =
W503 # line break before binary operator
E203 # whitespace before ':'
# File-specific flake8 ignore rules
per-file-ignores =
# F403 'from X import *'
# F405 'X' may be undefined, or defined from star imports
recommenders/models/vae/*_vae.py:F403,F405
max-line-length = 180
exclude =
build, dist, docs, examples, contrib,
tests
.env*,.venv* # local virtual environments
.tox