-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
216 lines (189 loc) · 6 KB
/
pyproject.toml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[tool.poetry]
name = "pywhy-stats"
version = "0.2dev0"
description = "Statistical methods for Python"
authors = ["PyWhy Community <[email protected]>, <[email protected]>"]
license = "MIT"
documentation = "https://pywhy.github.io/pywhy-stats"
repository = "https://github.com/py-why/pywhy-stats"
readme = "README.md"
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]
keywords = ['independence testing', 'causal statistics', 'conditional independence']
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry-dynamic-versioning]
enable = true
vsc = "git"
[tool.poetry-dynamic-versioning.substitution]
files = ["pywhy_stats/__init__.py"]
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
include = ['pywhy_stats*']
exclude = ['*tests', '*testdata']
[tool.poetry.dependencies]
python = ">=3.8,<3.12"
numpy = "^1.23.0"
scipy = "^1.9.0"
scikit-learn = ">= 1.0"
[tool.poetry.group.style]
optional = true
[tool.poetry.group.style.dependencies]
poethepoet = "^0.16.0"
mypy = "^0.971"
black = {extras = ["jupyter"], version = "^22.12.0"}
isort = "^5.12.0"
flake8 = "^5.0.4"
bandit = "^1.7.4"
pydocstyle = "^6.1.1"
codespell = "^2.1.0"
toml = "^0.10.2"
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
poethepoet = "^0.16.0"
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
memory_profiler = { version = "^0.60.0" }
flaky = "^3.7.0"
causal-learn = "^0.1.3.1" # these packages are only needed for integration testing
bnlearn = "^0.7.12"
dowhy = { version = "^0.8" }
typing-extensions = { version = "*" } # needed in dowhy's package
joblib = { version = "^1.1.0" } # needed in dowhy's package
tqdm = { version = "^4.64.0" } # needed in dowhy's package
pre-commit = "^3.0.4"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
poethepoet = "^0.16.0"
portray = "^1.7.0"
matplotlib = { version = "^3.5" }
numpydoc = { version = "^1.4" }
pydata-sphinx-theme = { version = "^0.9.0" }
sphinx = { version = "^5.1.1" }
sphinxcontrib-bibtex = { version = "^2.4.2" }
sphinx-issues = { version = "^3.0.1" }
sphinx-copybutton = { version = "^0.5.0" }
sphinx-gallery = { version = "^0.11.0" }
sphinx_rtd_theme = { version = "^1.0.0" }
graphviz = { version = "^0.20.1" }
ipython = { version = "^8.10.0" }
nbsphinx = { version = "^0.8" }
bnlearn = { version = "^0.7.12" }
dowhy = { version = "^0.8" }
typing-extensions = { version = "*" } # needed in dowhy's package
joblib = { version = "^1.1.0" } # needed in dowhy's package
tqdm = { version = "^4.64.0" } # needed in dowhy's package
pillow = ">=9.5,<11.0"
cycler = "^0.11.0"
kiwisolver = "^1.4.4"
[tool.poe.tasks]
_flake8 = 'flake8'
_bandit = 'bandit -r pywhy_stats'
_black = 'black .'
_isort = 'isort .'
_black_check = 'black --check pywhy_stats examples'
_isort_check = 'isort --check .'
_pydocstyle = 'pydocstyle .'
_codespell = 'codespell pywhy_stats/ doc/ examples/ --ignore-words=.codespellignore --skip "**/_build/*,**/auto_examples/*"'
_changelog = 'semversioner changelog > CHANGELOG.md'
_apply_version = 'semversioner release'
# Note: Shell commands will only work on systems with POSIX, which
# is not necessarily in Windows
_clean_pyc.shell = """find . -name "*.pyc" | xargs rm -f"""
_clean_so.shell = """
find . -name "*.so" | xargs rm -f
find . -name "*.pyd" | xargs rm -f
"""
_clean_cache.shell = """
find . -name "__pycache__" | xargs rm -rf
"""
_clean_build = 'rm -rf _build build dist pywhy_stats.egg-info'
_clean_ctags = 'rm -f tags'
_clean_test = """
rm -rf .pytest_cache .mypy_cache .ipynb_checkpoints
rm junit-results.xml
rm coverage.xml
rm .coverage
rm examples/*.png
rm examples/*.gv
"""
type_check = 'mypy -p pywhy_stats -p tests --config-file pyproject.toml'
unit_test = 'pytest tests/ --cov=pywhy_stats --cov-report=xml --cov-config=pyproject.toml'
integration_test = 'pytest tests/integration_tests'
build_docs = 'make -C doc clean html'
build_docs_noplot = 'make -C doc clean html-noplot'
[[tool.poe.tasks.clean]]
sequence = ['_clean_cache', '_clean_pyc', '_clean_so', '_clean_build', '_clean_ctags', '_clean_test']
ignore_fail = 'return_non_zero'
[[tool.poe.tasks.lint]]
sequence = ['_flake8', '_bandit', '_codespell', '_pydocstyle']
ignore_fail = 'return_non_zero'
[[tool.poe.tasks.format]]
sequence = ['_black', '_isort']
ignore_fail = 'return_non_zero'
[[tool.poe.tasks.format_check]]
sequence = ['_black_check', '_isort_check']
ignore_fail = 'return_non_zero'
#
# a standard verification sequence for use in pull requests
#
[[tool.poe.tasks.verify]]
sequence = ['format', 'lint', 'type_check', 'unit_test']
ignore_fail = "return_non_zero"
[[tool.poe.tasks.release]]
sequence = ['_changelog', '_apply_version']
[tool.black]
line-length = 100
target-version = ['py38']
include = '\.pyi?$'
extend-exclude = '''
(
__pycache__
| \.github
| setup.py
| docs/
| tests/testdata/
)
'''
[tool.pylint]
max-line-length = 120
disable = ["W0511"]
[tool.isort]
profile = 'black'
multi_line_output = 3
line_length = 100
py_version = 38
extend_skip_glob = ['setup.py', 'docs/*', 'examples/*']
[tool.pydocstyle]
convention = 'numpy'
ignore-decorators = '(copy_doc|property|.*setter|.*getter|pyqtSlot|Slot)'
match = '^(?!setup|__init__|test_).*\.py'
match-dir = '^pywhy_stats.*'
add_ignore = 'D100,D104,D105,D107'
[tool.mypy]
ignore_missing_imports = true
no_site_packages = true
[tool.pytest.ini_options]
minversion = '6.0'
addopts = '--durations 20 --junit-xml=junit-results.xml --verbose'
filterwarnings = []
log_cli = true
log_cli_level = 'ERROR'
[tool.coverage.run]
branch = true
cover_pylib = false
source = ['pywhy_stats']
omit = ['**/__init__.py', '**/tests/**', '**/testdata/**']
[tool.coverage.report]
exclude_lines = ['pragma: no cover', 'if __name__ == .__main__.:']
precision = 2