-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
128 lines (106 loc) · 3.69 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
[build-system]
# Minimum requirements for the build system to execute
requires = ["setuptools>=61.0.0", "wheel"]
# default value of build-backend is "setuptools.build_meta"
build-backend = "setuptools.build_meta"
[project]
name = "packaging-demo-avr"
authors = [{ name = "Amit Vikram Raj", email = "avr13405@gmail.com" }]
description = "Demo for Python Packaging"
readme = "README.md"
requires-python = ">=3.8"
keywords = [
"python", "bash", "makefile", "pypi", "ci-cd", "setuptools", "wheels",
"package-development", "github-actions", "pypi-package", "pre-commit-hooks",
"pyproject-toml", "gitactions-workflow", "github-actions-enabled", "pre-commit-ci",
"pre-commit-config"
]
license = { text = "MIT" }
classifiers = ["Programming Language :: Python :: 3"]
dependencies = ["numpy", "fastapi", 'importlib-metadata; python_version<"3.10"']
dynamic = ["version"]
# version = "0.0.3"
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
[project.urls]
# Ref: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
Repository = "https://github.com/avr2002/python-packaging"
Documentation = "https://github.com/avr2002/python-packaging/blob/main/README.md"
[tool.setuptools.dynamic]
# every while making changes in package, you can change the verison in one of these files
# version = {attr = "packaging_demo.VERSION"} # version read by 'packaging_demo/__init__.py' file
version = {file = ["version.txt"]} # version read by 'version.txt' file in root folder
# include-package-data defaults to true, not needed to add in toml file
[tool.setuptools]
include-package-data = true
# adding data files in our package; moving from MANIFEST.in to toml file
[tool.setuptools.package-data]
packaging_demo = ["**/*.json"]
[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
release = ["build", "twine"]
static-code-qa = ["pre-commit"]
# for developement
dev = ["ruff", "mypy", "black", "packaging-demo-avr[test, release, static-code-qa]"]
# plugin based architecture
colors = ["rich"]
# install all dependencies
all = ["packaging-demo-avr[dev, colors]"]
# Registering custom marks in pytest to avoid warnings
# https://docs.pytest.org/en/stable/how-to/mark.html
[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]
# Adding ruff.toml to pyproject.toml
[tool.ruff]
line-length = 119
[tool.ruff.lint]
# 1. Enable flake8-bugbear (`B`) rules, in addition to the defaults.
select = ["E", "F", "B", "ERA"]
# 2. Avoid enforcing line-length violations (`E501`)
ignore = ["E501"]
# 3. Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in select subdirectories.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]
# copying isort configurations from .isort.cfg to pyproject.toml
[tool.isort]
profile = "black"
multi_line_output = "VERTICAL_HANGING_INDENT"
force_grid_wrap = 2
line_length = 99
# copying balck config from .black.toml to pyproject.toml
[tool.black]
line-length = 119
exclude = ".venv"
# copying flake8 config from .flake8 to pyproject.toml
[tool.flake8]
max-line-length = 119
docstring-convention = "all"
extend-ignore = [
"D107",
"D212",
"E501",
"W503",
"W605",
"D203",
"D100",
"E305",
"E701",
"DAR101",
"DAR201",]
exclude = [".venv"]
# radon
radon-max-cc = 10
# copying pylint config from .pylintrc to pyproject.toml
[tool.pylint."messages control"]
disable = [
"line-too-long",
"trailing-whitespace",
"missing-function-docstring",
"consider-using-f-string",
"import-error",
"too-few-public-methods",
"redefined-outer-name",]