-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
152 lines (143 loc) · 5.1 KB
/
pyproject.toml
File metadata and controls
152 lines (143 loc) · 5.1 KB
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
[build-system]
build-backend = "hatchling.build"
requires = [ "hatch-docstring-description", "hatch-vcs", "hatchling" ]
[project]
name = "session-info2"
readme = "README.md"
keywords = [ "jupyter", "session-info" ]
license = "MPL-2.0"
authors = [ { name = "Philipp A.", email = "flying-sheep@web.de" } ]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Typing :: Typed",
]
dynamic = [ "description", "version" ]
dependencies = []
optional-dependencies.jupyter = [ "ipywidgets" ]
urls.Documentation = "https://session-info2.readthedocs.io/"
urls.Issues = "https://github.com/flying-sheep/session-info2/issues"
urls.Source = "https://github.com/flying-sheep/session-info2"
scripts.session-info = "session_info2.cli:main"
scripts.session-info2 = "session_info2.cli:main" # So `uvx session-info2` works
[dependency-groups]
test = [
"coverage[toml]>=6.5",
"ipykernel",
"jupyter-client",
"pytest",
"pytest-asyncio",
"pytest-md", # For GitHub report
"pytest-subprocess",
"testing-common-database", # Example package as “test data”
]
docs = [
"click>=8.3.1",
"furo",
"hatch",
"ipywidgets",
"myst-nb>=1.3",
"session-info2[notebook]",
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-codeautolink",
]
# Dependencies needed to run the notebook
notebook = [
"numpy",
"session-info",
"session-info2[jupyter]",
]
[tool.hatch]
envs.default.installer = "uv"
envs.docs.dependency-groups = [ "docs" ]
envs.docs.scripts.build = "sphinx-build -W --keep-going -b html docs docs/_build/html {args}"
envs.docs.scripts.open = "python3 -m webbrowser -t docs/_build/html/index.html"
envs.docs.scripts.clean = "git clean -fdX -- {args:docs}"
envs.hatch-test.default-args = []
envs.hatch-test.dependency-groups = [ "test" ]
envs.hatch-test.extra-dependencies = [ "pyinstrument" ]
envs.hatch-test.overrides.matrix.deps.features = [
{ if = [ "all" ], value = "jupyter" },
]
envs.hatch-test.matrix = [ { python = [ "3.14", "3.10" ], deps = [ "all", "min" ] } ]
envs.notebook.dependency-groups = [ "notebook" ]
envs.notebook.extra-dependencies = [ "ipykernel" ]
envs.notebook.scripts.install-kernel = "python -m ipykernel install --user --name=session-info2 --display-name=session-info2 --env COLUMNS 110"
metadata.hooks.docstring-description = {}
version.source = "vcs"
[tool.ruff]
lint.select = [ "ALL" ]
lint.ignore = [
"B019", # functools.cache is fine to use
"C408", # dict(...) calls are good
"COM812", # Incompatible with formatter
"D203", # 0 instead of 1 blank lines before class docstring
"D213", # Multi-line docstring summary should start at the first instead of second line
"FIX002", # TODOs are fine
"ISC001", # Incompatible with formatter
"PLC0415", # Non-top-level imports are fine
"S603", # We don’t want to use `subprocess.run(shell=True)`
"S607", # We don’t run commands with untrusted input
"TD002", # No need to assign TODOs to some person
]
lint.per-file-ignores."**/*.ipynb" = [
"CPY001", # Missing copyright notice in notebook is fine
"I002", # Missing `from __future__ import annotations` is fine
]
lint.per-file-ignores."docs/conf.py" = [
"INP001", # __init__.py
]
lint.per-file-ignores."src/session_info2/cli.py" = [
"T201", # print is fine
]
lint.per-file-ignores."tests/*" = [
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"INP001", # __init__.py
"RUF018", # assert with := is fine
"S101", # Use of assert
]
lint.allowed-confusables = [ "×", "’" ]
lint.flake8-copyright.notice-rgx = "SPDX-License-Identifier: MPL-2\\.0"
lint.isort.known-first-party = [ "session_info2" ]
lint.isort.required-imports = [ "from __future__ import annotations" ]
lint.pylint.max-args = 7
lint.pylint.max-positional-args = 3
[tool.mypy]
strict = true
explicit_package_bases = true
mypy_path = [ "$MYPY_CONFIG_FILE_DIR/stubs", "$MYPY_CONFIG_FILE_DIR/src" ]
[tool.pyright]
stubPath = "./stubs"
reportPrivateUsage = false
[tool.pytest]
strict = true
addopts = [ "--import-mode=importlib" ]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error",
"ignore:Jupyter is migrating its paths:DeprecationWarning",
"ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil",
]
[tool.coverage]
run.branch = true
run.omit = []
run.parallel = true
run.source_pkgs = [ "session_info2", "tests" ]
paths.session_info2 = [ "src/session_info2", "*/session-info2/src/session_info2" ]
paths.tests = [ "tests", "*/session-info2/tests" ]
report.exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", "no cov" ]
[tool.esbonio]
sphinx.pythonCommand = [ "hatch", "-e", "docs", "run", "python" ]