-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
190 lines (175 loc) · 6.78 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
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >=64",
"setuptools-git-versioning",
]
[project]
name = "innerscope"
dynamic = ["version"]
description = "Expose the inner scope of functions"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Erik Welch", email = "[email protected]"},
{name = "Innerscope contributors"},
]
maintainers = [
{name = "Erik Welch", email = "[email protected]"},
]
keywords = [
"introspection",
"dict",
"utility",
"bytecode",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"toolz",
]
[project.urls]
homepage = "https://github.com/eriknw/innerscope"
repository = "https://github.com/eriknw/innerscope"
changelog = "https://github.com/eriknw/innerscope/releases"
[project.optional-dependencies]
test = [
"pytest >=6",
]
[tool.setuptools.packages.find]
include = [
"innerscope*",
"innerscope.*",
]
namespaces = false
[tool.setuptools-git-versioning]
enabled = true
dev_template = "{tag}+{ccount}.g{sha}"
dirty_template = "{tag}+{ccount}.g{sha}.dirty"
[tool.black]
line-length = 100
target-version = ["py38", "py39", "py310", "py311", "py312"]
[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
profile = "black"
skip_gitignore = true
float_to_top = true
default_section = "THIRDPARTY"
known_first_party = "innerscope"
line_length = 100
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = "innerscope/tests"
xfail_strict = true
addopts = [
"--strict-config", # Force error if config is mispelled
"--strict-markers", # Force error if marker is mispelled (must be defined in config)
"-ra", # Print summary of all fails/errors
]
log_cli_level = "info"
filterwarnings = [
"error",
]
[tool.coverage.run]
branch = true
source = ["innerscope"]
[tool.coverage.report]
ignore_errors = false
precision = 1
fail_under = 0
skip_covered = true
skip_empty = true
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
]
[tool.ruff]
# https://github.com/astral-sh/ruff/
line-length = 100
target-version = "py38"
[tool.ruff.lint]
unfixable = [
"F841", # unused-variable (Note: can leave useless expression)
"B905", # zip-without-explicit-strict (Note: prefer `zip(x, y, strict=True)`)
]
select = [
"ALL",
]
external = [
# noqa codes that ruff doesn't know about: https://github.com/charliermarsh/ruff#external
]
ignore = [
# Would be nice to fix these
"D",
# Intentionally ignored
"COM812", # Trailing comma missing
"D203", # 1 blank line required before class docstring (Note: conflicts with D211, which is preferred)
"D400", # First line should end with a period (Note: prefer D415, which also allows "?" and "!")
"F403", # `from .classes import *` used; unable to detect undefined names (Note: used to match networkx)
"N802", # Function name ... should be lowercase
"N803", # Argument name ... should be lowercase (Maybe okay--except in tests)
"N806", # Variable ... in function should be lowercase
"N807", # Function name should not start and end with `__`
"N818", # Exception name ... should be named with an Error suffix (Note: good advice)
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic number used in comparison, consider replacing magic with a constant variable
"PLW2901", # Outer for loop variable ... overwritten by inner assignment target (Note: good advice, but too strict)
"RET502", # Do not implicitly `return None` in function able to return non-`None` value
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET504", # Unnecessary variable assignment before `return` statement
"S110", # `try`-`except`-`pass` detected, consider logging the exception (Note: good advice, but we don't log)
"S112", # `try`-`except`-`continue` detected, consider logging the exception (Note: good advice, but we don't log)
"SIM102", # Use a single `if` statement instead of nested `if` statements (Note: often necessary)
"SIM105", # Use contextlib.suppress(...) instead of try-except-pass (Note: try-except-pass is much faster)
"SIM108", # Use ternary operator ... instead of if-else-block (Note: if-else better for coverage and sometimes clearer)
"TRY003", # Avoid specifying long messages outside the exception class (Note: why?)
# Ignored categories
"C90", # mccabe (Too strict, but maybe we should make things less complex)
"I", # isort (Should we replace `isort` with this?)
"ANN", # flake8-annotations (We don't use annotations yet)
"BLE", # flake8-blind-except (Maybe consider)
"FBT", # flake8-boolean-trap (Why?)
"DJ", # flake8-django (We don't use django)
"EM", # flake8-errmsg (Perhaps nicer, but too much work)
"ICN", # flake8-import-conventions (Doesn't allow "_" prefix such as `_np`)
"PYI", # flake8-pyi (We don't have stub files yet)
"SLF", # flake8-self (We can use our own private variables--sheesh!)
"TID", # flake8-tidy-imports (Rely on isort and our own judgement)
"TCH", # flake8-type-checking (Note: figure out type checking later)
"ARG", # flake8-unused-arguments (Sometimes helpful, but too strict)
"TD", # flake8-todos (Maybe okay to add some of these)
"FIX", # flake8-fixme (like flake8-todos)
"ERA", # eradicate (We like code in comments!)
"PD", # pandas-vet (Intended for scripts that use pandas, not libraries)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports (w/o defining `__all__`)
"innerscope/tests/*py" = [
"S101", "S301", "T201", "D103", "D100", # Allow assert, print, pickle, and no docstring
"A001", "A002", "B018", "C408", "C416", "E702", "E703", "F821", "F841", # Let us test messy code
]
"innerscope/tests/test_repr.py" = ["E501"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false