-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
320 lines (274 loc) · 8.37 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# ds2000 - The Python Library for Rigol DS2000 Oscilloscopes
# Copyright (C) 2018-2021 Michael Sasser <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[tool.poetry]
name = "ds2000"
version = "0.1.0"
description = "The Python Library for Rigol DS2000 Oscilloscopes"
license = "GPL-3.0-or-later"
authors = ["Michael Sasser <[email protected]>"]
maintainers = ["Michael Sasser <[email protected]>"]
readme = "README.md"
repository = "https://github.com/MichaelSasser/ds2000"
homepage = "https://github.com/MichaelSasser/ds2000"
documentation = "https://github.com/MichaelSasser/ds2000"
keywords = ['DS2000', 'Rigol', 'API']
# Look here for all Classifiers:
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
# 'Development Status :: 3 - Alpha',
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Environment :: Console",
"Environment :: Win32 (MS Windows)",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Topic :: Education",
"Topic :: Other/Nonlisted Topic",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
]
[tool.poetry.dependencies]
python = "^3.9"
coloredlogs = "^15.0" # TODO: Delete before first release
# zeroconf = "^0.28.8" # Not used? used by vxi11?
# Extras (func)
numpy = { version = "^1.24.3", optional = true }
matplotlib = { version = "^3.5.1", optional = true }
# Drivers
python-vxi11 = { version = "^0.9.0", optional = true }
pyvisa = { version = "^1.11.3", optional = true }
pyvisa-py = { version = "^0.5.2", optional = true }
# Docs
sphinx-autodoc-typehints = { version = "^1.23.0", optional = true }
Sphinx = { version = "^6.2.1", optional = true }
numpydoc = { version = "^1.1.0", optional = true }
[tool.poetry.extras]
# driver - You only need one
driver-vxi11 = ["python-vxi11"]
driver-pyvisa = ["pyvisa"]
driver-pyvisa-py = ["pyvisa-py"]
driver-all = ["python-vxi11", "pyvisa", "pyvisa-py"] # For developers
# Extras
func = ["numpy", "matplotlib"]
# Docs
docs = ["sphinx", "sphinx-autodoc-typehints", "numpydoc"]
# All
all = ["python-vxi11", "pyvisa", "pyvisa-py", "sphinx", "sphinx_rtd_theme", "sphinx-autodoc-typehints", "numpy", "matplotlib"]
[tool.poetry.dev-dependencies]
pre-commit = "^3.2.2"
pytest = "^6.2.5"
pytest-cov = "^4.0.0"
pytest-instafail = "^0.5.0"
pytest-xdist = { version = "^2.5.0", extras = ["psutil"] }
flake8 = "^3.8.4"
neovim = "^0.3.1"
pydocstyle = "^6.1.1"
pylint = "^2.12.2"
pycodestyle = "^2.6.0"
yapf = "^0.32.0"
vulture = "^2.3"
mypy = "^1.2"
isort = "^5.10.1"
interrogate = "^1.5.0"
coverage = "^6.2"
towncrier = "^21.3.0"
tox = "^3.25.1"
python-language-server = { version = "^0.36.2", extras = ["all"] }
black = { version = "*", allow-prereleases = true }
[tool.black]
line-length = 79
include = '\.pyi?$'
# exclude __init__.py because of ordered importing
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| tests/.*/setup.py
)/
'''
[tool.flake8]
max-line-length = 79
# max-complexity = 12
ignore = "E501"
select = "C,E,F,W,B,B901"
[tool.isort]
line_length = 79
force_single_line = true
atomic = true
float_to_top = true
include_trailing_comma = true
lines_after_imports = 2
lines_between_types = 1
multi_line_output = 3
use_parentheses = true
skip_glob = ["*/setup.py", "*.rst", "*.md", "*.yaml", "*.txt", "*.yml", "*.lock", "*.toml", "*.ini", "Makefile"]
filter_files = true
known_first_party = "ds2000"
known_third_party = [
"pytest",
"vxi11",
"numpy",
"matplotlib",
"sphinx_rtd_theme",
]
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
# ignore-semiprivate = false
# ignore-private = false
# ignore-property-decorators = false
# ignore-module = false
# fail-under = 95
exclude = ["setup.py", "docs", "build"]
# ignore-regex = ["^get$", "^mock_.*", ".*BaseClass.*"]
verbose = 1
# quiet = false
# whitelist-regex = []
# color = true
[tool.vulture]
# exclude = ["file*.py", "dir/"]
# ignore_decorators = ["@app.route", "@require_*"]
# ignore_names = ["visit_*", "do_*"]
make_whitelist = true
min_confidence = 80
# paths = ["myscript.py", "mydir"]
paths = ["ds2000"]
sort_by_size = true
# verbose = true
[tool.towncrier]
package = "ds2000"
package_dir = "ds2000"
filename = "CHANGELOG.rst"
issue_format = "`#{issue} <https://github.com/MichaelSasser/ds2000/issues/{issue}>`_"
directory = "news/"
name = "ds2000"
title_format = "ds2000 {version} ({project_date})"
all_bullets = true # make all fragments bullet points
wrap = false # Wrap text to 79 characters
template = "news/templates/default.rst"
[[tool.towncrier.type]]
directory = "feature"
name = "Features & Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bugfixes"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Removals and Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "behavior"
name = "Behavior Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "dep"
name = "Dependencies"
showcontent = true
[[tool.towncrier.type]]
directory = "trivial"
name = "Trivial Changes"
showcontent = false
[[tool.towncrier.type]]
directory = "misc"
name = "Miscellaneous"
showcontent = false
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.tox]
legacy_tox_ini = """
[pytest]
addopts = -ra
testpaths = tests
xfail_strict = true
filterwarnings =
once::Warning
ignore:::pympler[.*]
# Keep docs in sync with docs env and .readthedocs.yml.
# [gh-actions]
# python =
# 3.9: py39, precommit, changelog, docs
# # 3.10: py310
[tox]
envlist = precommit,py39,docs,changelog,
# py310,
isolated_build = True
[testenv]
allowlist_externals = poetry
# Prevent random setuptools/pip breakages like
# https://github.com/pypa/setuptools/issues/1042 from breaking our builds.
setenv =
VIRTUALENV_NO_DOWNLOAD=1
extras = {env:TOX_AP_TEST_EXTRAS:tests}
commands = poetry run pytest {posargs}
[testenv:py39]
allowlist_externals = poetry
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
basepython = python3.9
install_command = pip install --no-compile {opts} {packages}
setenv =
PYTHONWARNINGS=d
extras = {env:TOX_AP_TEST_EXTRAS:tests}
commands = poetry run coverage run -m pytest {posargs}
[testenv:precommit]
allowlist_externals = poetry
basepython = python3.9
skip_install = true
deps =
pre-commit
passenv = HOMEPATH # needed on Windows
commands =
poetry run pre-commit run --all-files
[testenv:docs]
allowlist_externals = poetry
# Keep basepython in sync with gh-actions and .readthedocs.yml.
basepython = python3.9
# extras = docs, func
# currently disable -n
commands =
poetry run sphinx-build -T -W -b html -d {envtmpdir}/doctrees docs/source docs/build/html
poetry run sphinx-build -T -W -b doctest -d {envtmpdir}/doctrees docs/source docs/build/html
poetry run python -m doctest README.md
[testenv:changelog]
allowlist_externals = poetry
basepython = python3.9
# deps = towncrier
skip_install = true
commands = poetry run towncrier --draft
"""