-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
202 lines (181 loc) · 6.04 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "ipysensitivityprofiler"
version = "0.0.1"
authors = [
{ name="Steven H. Berguin", email="stevenberguin@gmail.com" },
]
description = "Jupyter Widgets for visualizing local sensitivity profiles of functions."
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"numpy",
"bqplot",
"jupyter",
"jupyterlab",
"traitlets",
"widgetsnbextension"
]
[project.optional-dependencies]
lint = [
"black",
"docformatter",
"lxml",
"mypy",
"ruff",
"pylint",
]
test = [
"nbmake",
"pytest",
"pytest-cov",
"pytest-html",
]
build = [
"build",
"sphinx", # to build docs
"sphinx_rtd_theme",
"sphinx-toolbox",
"pip",
]
release = [
"twine", # if pkg to be released on pypi
]
[project.urls]
Documentation = "https://shb84.github.io/ipysensitivityprofiler/"
Homepage = "https://github.com/shb84/ipysensitivityprofiler.git"
Issues = "https://github.com/shb84/ipysensitivityprofiler/issues"
[tool.setuptools.packages.find]
where = ["src"] # list of folders that contain the packages (["."] by default)
include = ["ipysensitivityprofiler*"] # package names should match these glob patterns (["*"] by default)
exclude = ["ipysensitivityprofiler.tests*"] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.ruff]
lint.select = [
"ANN", # flake8-annotations
"D", # pydocstyle
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"PL", # pylint
"UP", # pyupgra
"W", # pycodestyle warnings
"NPY", # NumPy-specific rules
]
lint.ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs`
"ANN204", # Missing return type annotation for special method `__init__`
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"PLR0913", # Too many arguments in function definition
"E501", # if it doesn't bother black
"D105",
"D107",
"D205",
"D209",
"D400",
"D203",
"D213", # pydocstyle opinion
"D417", # FIXME Missing argument description
"D413", # Missing blank line after last section ("Parameters")
]
cache-dir = "build/.cache/ruff"
[tool.mypy]
cache_dir = "build/.cache/mypy"
sqlite_cache = true
# settings
allow_redefinition = true
check_untyped_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
show_error_context = true
warn_return_any = false
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = [
"openmdao",
]
ignore_missing_imports = true
########
# pixi #
########
# pixi docs: https://pixi.sh/latest/
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
# [tool.pixi.system-requirements]
# linux="4.18" # optional (use if needed: https://prefix.dev/docs/pixi/configuration#the-system-requirements-table)
[tool.pixi.pypi-dependencies]
ipysensitivityprofiler = { path = ".", editable = true }
[tool.pixi.environments]
default = { features = [], solve-group = "default" }
lint = { features = ["lint"], solve-group = "default" }
test = { features = ["test"], solve-group = "default" }
build = { features = ["build"], solve-group = "default" }
release = { features = ["release"], solve-group = "default" }
lab = { features = ["openmdao"], solve-group = "default" }
[tool.pixi.dependencies]
bqplot = "*"
jupyter = "*"
jupyterlab = "*"
traitlets = "*"
widgetsnbextension = "*"
numpy = "*"
openmdao = "*" # experimenting with openmdao model visualization
matplotlib = "*" # for static plots
[tool.pixi.feature.lint.dependencies]
black = "*"
docformatter = "*"
lxml = "*"
mypy = "*"
ruff = "*"
pylint = "*"
[tool.pixi.feature.test.dependencies]
nbmake = "*"
pytest = "*"
pytest-cov = "*"
pytest-html = "*"
[tool.pixi.feature.openmdao.tasks]
lab = "jupyter lab --no-browser"
env = { cmd = "conda env export -p .pixi/envs/default --no-builds | grep -v '^prefix: ' | grep -v '^name: ' > environment.yml", inputs = ["pixi.lock", "src/**/*.py"], outputs = ["environment.yml"]}
[tool.pixi.feature.lint.tasks]
black = { cmd = "black --quiet src/", inputs = ["src/**/*.py"] }
docformatter = { cmd = "docformatter --in-place src/**/*.py", inputs = ["src/**/*.py"] }
ruff = { cmd = "ruff check src/ --fix", inputs = ["src/**/*.py"] }
mypy = { cmd = "mypy --html-report=build/reports/mypy src/", inputs = ["src/**/*.py"] }
lint = { depends-on = ["docformatter", "black", "ruff", "mypy"] }
[tool.pixi.feature.test.tasks]
test-py = { cmd = """
pytest
-vv
--failed-first
--html=build/reports/pytest/report.html
--self-contained-html
--cov=jenn
--cov-context=test
--cov-report=html:build/reports/pytest
--cov-report=xml:build/reports/pytest/coverage.xml
--cov-report=term-missing:skip-covered
-o=junit_family=xunit2
--junitxml=build/reports/pytest/junit.xml
""", inputs = ["src/**/*.py", "tests/"] }
test-nb = { cmd = "pytest --nbmake --nbmake-timeout=3000 notebooks/*.ipynb", inputs = ["notebooks/*.ipynb"]}
test = { depends-on = ["test-py", "test-nb"] }
[tool.pixi.feature.build.tasks]
build-dist = { cmd = "python -m build --outdir build/dist", inputs = ["src/**/*.py"], outputs = ["build/dist/*.whl", "build/dist/*.tar.gz"] }
build-docs = { cmd = "sphinx-build -b html docs/source build/docs/html", inputs = ["src/**/*.py", "docs/**/*.py", "docs/**/*.rst", "docs/**/*.png"], outputs = ["build/docs/**/*.html"]}
build = { depends-on = ["build-docs", "build-dist"] }
[tool.pixi.feature.release.tasks]
release-testpypi = { cmd = "python -m twine upload build/dist/* --verbose --skip-existing --repository testpypi", inputs = ["src/**/*.py"] }
release-pypi = { cmd = "python -m twine upload build/dist/* --verbose --skip-existing", inputs = ["src/**/*.py"] }