-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathpyproject.toml
51 lines (45 loc) · 1.51 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
[tool.black]
line-length = 99
[tool.ruff]
line-length = 99
select = ["E", "F", "W", "I", "TID251"]
ignore = ["E501", "E731"]
exclude = [
"docker.py",
"nextgisweb/raster_layer/test/validate_cloud_optimized_geotiff.py",
]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.isort]
variables = ["_"]
# Absolute imports are more readable, relative ones are circuitous. So, let's
# combine them with the following rules:
#
# 1. Environment (nextgisweb.env), library (nextgisweb.lib.*) and component
# (nextgisweb.*) modules must be imported using absolute imports.
#
# 2. Internal imports, which don't cross these boundaries must use relative
# imports. For example, you can import "nextgisweb.lib.foo.a" from
# "nextgisweb.lib.foo.b" as "from .a import ...", but can't import
# "from ..foo.a import ..." from "nextgisweb.lib.bar.c".
#
# Therefore, NextGIS Web extensions, like nextgisweb_qgis, will have the same
# imports structure and that's nice!
#
# TODO: Do we need some flake8 for that?
extra-standard-library = ["packaging", "pkg_resources", "setuptools"]
section-order = [
"future",
"standard-library",
"third-party",
"nextgisweb_env_lib",
"nextgisweb_comp",
"first-party",
"local-folder",
]
[tool.ruff.isort.sections]
"nextgisweb_env_lib" = ["nextgisweb.env", "nextgisweb.lib"]
"nextgisweb_comp" = ["nextgisweb"]
[tool.ruff.flake8-tidy-imports]
[tool.ruff.flake8-tidy-imports.banned-api]
pkg_resources.msg = "Consider importlib.metadata or nextgisweb.imptool.module_path"