1[build-system]
2    requires = ["setuptools>=64"]
3    build-backend = "setuptools.build_meta"
4
5[project]
6    name = "esptool"
7    authors = [
8        {name = "Fredrik Ahlberg (themadinventor)"},
9        {name = "Angus Gratton (projectgus)"},
10        {name = "Espressif Systems"}
11    ]
12    readme = {file = "README.md", content-type = "text/markdown"}
13    license = {text = "GPLv2+"}
14    description = "A serial utility to communicate & flash code to Espressif chips."
15    classifiers = [
16        "Development Status :: 5 - Production/Stable",
17        "Intended Audience :: Developers",
18        "Natural Language :: English",
19        "Operating System :: POSIX",
20        "Operating System :: Microsoft :: Windows",
21        "Operating System :: MacOS :: MacOS X",
22        "Topic :: Software Development :: Embedded Systems",
23        "Environment :: Console",
24        "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
25        "Programming Language :: Python :: 3.7",
26        "Programming Language :: Python :: 3.8",
27        "Programming Language :: Python :: 3.9",
28        "Programming Language :: Python :: 3.10",
29        "Programming Language :: Python :: 3.11",
30        "Programming Language :: Python :: 3.12",
31    ]
32    requires-python = ">=3.7"
33    dynamic = ["version", "scripts"]
34
35    dependencies = [
36        "bitstring>=3.1.6,!=4.2.0",
37        "cryptography>=2.1.4",
38        "ecdsa>=0.16.0",
39        "pyserial>=3.3",
40        "reedsolo>=1.5.3,<1.8",
41        "PyYAML>=5.1",
42        "intelhex",
43        'argcomplete>=3; sys_platform != "win32"',
44    ]
45
46[project.urls]
47    Homepage = "https://github.com/espressif/esptool/"
48    Documentation = "https://docs.espressif.com/projects/esptool/"
49    Source = "https://github.com/espressif/esptool/"
50    Tracker = "https://github.com/espressif/esptool/issues/"
51    Changelog = "https://github.com/espressif/esptool/blob/master/CHANGELOG.md"
52
53[project.optional-dependencies]
54    dev = [
55        "pyelftools",
56        "coverage~=6.0",
57        "pre-commit",
58        "pytest",
59        "pytest-rerunfailures",
60        "requests",
61        "commitizen",
62    ]
63    hsm = ["python-pkcs11"]
64
65[tool.setuptools]
66    include-package-data = true
67
68[tool.setuptools.package-data]
69    "*" = ["esptool/targets/stub_flasher/1/*", "esptool/targets/stub_flasher/2/*"]
70
71[tool.setuptools.packages]
72    find = {exclude = ["ci*", "test*", "docs*"]}
73
74[tool.setuptools.dynamic]
75    version = {attr = "esptool.__init__.__version__"}
76
77[tool.commitizen]
78    version = "4.8.1"
79    update_changelog_on_bump = true
80    tag_format = "v$version"
81    changelog_start_rev = "v4.2.1"
82    changelog_merge_prerelease = true
83    annotated_tag = true
84    bump_message = "change: Update version to $new_version"
85    version_files = [
86        "esptool/__init__.py:__version__"
87    ]
88    change_type_order = [
89        "BREAKING CHANGE",
90        "New Features",
91        "Bug Fixes",
92        "Code Refactoring",
93        "Performance Improvements"
94    ]
95
96[tool.commitizen.change_type_map]
97    feat = "New Features"
98    fix = "Bug Fixes"
99    refactor = "Code Refactoring"
100    perf = "Performance Improvements"
101
102[tool.codespell]
103    skip = '*.bin,*test/images/efuse/*,*docs/en/espefuse/inc/*'
104    ignore-words-list = 'bloc,ser,dout,exten'
105    write-changes = false
106
107[tool.mypy]
108    disallow_incomplete_defs = false # Disallows defining functions with incomplete type annotations
109    disallow_untyped_defs    = false # Disallows defining functions without type annotations or with incomplete type annotations
110    ignore_missing_imports   = true  # Suppress error messages about imports that cannot be resolved
111    python_version           = "3.7" # Specifies the Python version used to parse and check the target program
112    warn_no_return           = true  # Shows errors for missing return statements on some execution paths
113    warn_return_any          = true  # Shows a warning when returning a value with type Any from a function declared with a non- Any return type
114
115[tool.ruff]
116    # https://docs.astral.sh/ruff/settings/
117    # Exclude a variety of commonly ignored directories.
118    exclude = [
119        ".eggs",
120        ".git",
121        "__pycache__"
122    ]
123
124    line-length = 88
125
126    select = ['E', 'F', 'W']
127    ignore = ["E203"]
128
129    target-version = "py37"
130
131[tool.ruff.lint]
132    # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
133    # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
134    # McCabe complexity (`C901`) by default.
135    select = ["E4", "E7", "E9", "F"]
136    ignore = []
137
138    # Allow fix for all enabled rules (when `--fix`) is provided.
139    fixable = ["ALL"]
140    unfixable = []
141
142    # Allow unused variables when underscore-prefixed.
143    dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
144
145[tool.ruff.lint.per-file-ignores]
146    # tests often manipulate sys.path before importing the main tools, so ignore import order violations
147    "test/*.py" = ["E402"]
148
149    # multiple spaces after ',' and long lines - used for visual layout of eFuse data
150    "espefuse/efuse/*/mem_definition.py" =  ["E241", "E501"]
151    "espefuse/efuse/*/operations.py" =   ["E241", "E501", "F401"]
152    "espefuse/efuse/*/fields.py" =   ["E241", "E501"]
153
154    # ignore long lines - used for RS encoding pairs
155    "test/test_modules.py" = ["E501"]
156
157    # don't check for unused imports in __init__.py files
158    "__init__.py" = ["F401"]
159
160    # allow definition from star imports in docs config
161    "docs/conf_common.py" =  ["F405"]
162
163[tool.ruff.format]
164    quote-style = "double"
165    indent-style = "space"
166    docstring-code-format = true
167