forked from BCG-X-Official/artkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
127 lines (112 loc) · 3.54 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
[tox]
# We distinguish two test environments: one with default versions for all dependencies,
# and one with custom versions that are explicitly set in the environment.
#
# - py3 is the default environment, which uses the default versions of all dependencies.
# This is a default name used by tox to denote the default test environment,
# [testenv] (see below)
# - py3-custom-deps is the custom environment, which uses the versions of dependencies
# that are explicitly defined in pyproject.toml for the min and max matrix tests.
# The definition is below in section [testenv:py3-custom-deps]
# This custom environment inherits all settings from the default environment, except
# the dependencies, which it overrides.
envlist = py3, py3-custom-deps
skip_missing_interpreters = true
isolated_build = true
minversion = 3.11
distshare= {toxinidir}/dist/tox
[testenv]
changedir = .
passenv = *
setenv =
PYTHONPATH = {toxinidir}{:}{toxinidir}/test
PIP_DISABLE_PIP_VERSION_CHECK = 1
# We change the install command to build packages from source that depend on numpy's
# binary API.
# This is necessary to prevent the notorious "RuntimeError: module compiled against API
# version 0x… but this version of numpy is 0x…" error.
install_command =
python -m pip install {opts} {packages} --no-binary '{env:ARTKIT_NO_BINARY}'
extras =
testing
commands =
# print all installed packages to stdout
python -m pip freeze
# run the tests
pytest test/ -s
deps=
# optional dependencies, using default package versions
aiohttp
anthropic
google-generativeai
groq
openai
torch
transformers
[testenv:py3-custom-deps]
# This environment uses custom versions of dependencies that are explicitly set in the
# environment. The versions are defined in the environment variables ARTKIT_V_*
# based on the min and max versions for the matrix tests in pyproject.toml.
deps =
matplotlib{env:ARTKIT_V_MATPLOTLIB}
pandas{env:ARTKIT_V_PANDAS}
fluxus{env:ARTKIT_V_FLUXUS}
gamma-pytools{env:ARTKIT_V_GAMMA_PYTOOLS}
typing_inspect{env:ARTKIT_V_TYPING_INSPECT}
# force specific versions of 3rd party libraries for matrix tests
aiohttp{env:ARTKIT_V_AIOHTTP}
anthropic{env:ARTKIT_V_ANTHROPIC}
google-generativeai{env:ARTKIT_V_GOOGLE_GENERATIVEAI}
groq{env:ARTKIT_V_GROQ}
openai{env:ARTKIT_V_OPENAI}
torch{env:ARTKIT_V_TORCH}
transformers{env:ARTKIT_V_TRANSFORMERS}
[flake8]
# Max line length for code
max-line-length = 88
# Max line length for docstrings
max-doc-length = 88
show-source = true
ignore =
# line too long (140 > 88 characters)
E501,
# line break after binary operator
W504,
# invalid escape sequence '\.'
W605,
# do not assign a lambda expression, use a def
E731,
# ignore not easy to read variables like i l I etc
E741,
# Unnecessary (dict/list/tuple) call - rewrite as a literal
C408,
# Module level import not at top of file
E402,
# Ignores below are added to prevent conflicts with Black formatter
# Missing whitespace after ',', ';', or ':'
E231,
# space before :
E203,
# line break before binary operator
W503,
per-file-ignores =
__init__.py: F401, F403, F405
api.py: F401, F403
exclude =
.eggs/*.py,
venv/*,
.venv/*,
.git/*
[isort]
profile=black
src_paths=src,test
known_local_folder=test
known_first_party=pytools
known_third_party=numpy,pandas,joblib,matplot
case_sensitive = True
[pytest]
pythonpath=src
testpaths=test/artkit_test
log_cli_level=DEBUG
log_cli=true
cache_dir=.pytest_cache