1
- # SPDX-FileCopyrightText: 2014-2023 Fredrik Ahlberg, Angus Gratton,
2
- # Espressif Systems (Shanghai) CO LTD, other contributors as noted.
3
- #
4
- # SPDX-License-Identifier: GPL-2.0-or-later
5
-
6
- import io
7
1
import os
8
- import re
9
- import sys
10
-
11
- try :
12
- from setuptools import find_packages , setup
13
- except ImportError :
14
- print (
15
- "Package setuptools is missing from your Python installation. "
16
- "Please see the installation section in the esptool documentation"
17
- " for instructions on how to install it."
18
- )
19
- sys .exit (1 )
20
-
21
-
22
- # Example code to pull version from esptool module with regex, taken from
23
- # https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
24
- def read (* names , ** kwargs ):
25
- with io .open (
26
- os .path .join (os .path .dirname (__file__ ), * names ),
27
- encoding = kwargs .get ("encoding" , "utf8" ),
28
- ) as fp :
29
- return fp .read ()
30
-
31
-
32
- def find_version (* file_paths ):
33
- version_file = read (* file_paths )
34
- version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" , version_file , re .M )
35
- if version_match :
36
- return version_match .group (1 )
37
- raise RuntimeError ("Unable to find version string." )
38
-
2
+ from setuptools import setup
39
3
40
4
if os .name != "nt" :
41
5
scripts = ["esptool.py" , "espefuse.py" , "espsecure.py" , "esp_rfc2217_server.py" ]
@@ -51,87 +15,7 @@ def find_version(*file_paths):
51
15
],
52
16
}
53
17
54
-
55
- long_description = """
56
- ==========
57
- esptool.py
58
- ==========
59
- A Python-based, open-source, platform-independent utility to communicate with \
60
- the ROM bootloader in Espressif chips.
61
-
62
- The esptool.py project is `hosted on github <https://github.com/espressif/esptool>`_.
63
-
64
- Documentation
65
- -------------
66
- Visit online `esptool documentation <https://docs.espressif.com/projects/esptool/>`_ \
67
- or run ``esptool.py -h``.
68
-
69
- Contributing
70
- ------------
71
- Please see the `contributions guide \
72
- <https://docs.espressif.com/projects/esptool/en/latest/contributing.html>`_.
73
- """
74
-
75
18
setup (
76
- name = "esptool" ,
77
- version = find_version ("esptool/__init__.py" ),
78
- description = "A serial utility to communicate & flash code to Espressif chips." ,
79
- long_description = long_description ,
80
- url = "https://github.com/espressif/esptool/" ,
81
- project_urls = {
82
- "Documentation" : "https://docs.espressif.com/projects/esptool/" ,
83
- "Source" : "https://github.com/espressif/esptool/" ,
84
- "Tracker" : "https://github.com/espressif/esptool/issues/" ,
85
- },
86
- author = "Fredrik Ahlberg (themadinventor) & Angus Gratton (projectgus) "
87
- "& Espressif Systems" ,
88
- author_email = "" ,
89
- license = "GPLv2+" ,
90
- classifiers = [
91
- "Development Status :: 5 - Production/Stable" ,
92
- "Intended Audience :: Developers" ,
93
- "Natural Language :: English" ,
94
- "Operating System :: POSIX" ,
95
- "Operating System :: Microsoft :: Windows" ,
96
- "Operating System :: MacOS :: MacOS X" ,
97
- "Topic :: Software Development :: Embedded Systems" ,
98
- "Environment :: Console" ,
99
- "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)" ,
100
- "Programming Language :: Python :: 3.7" ,
101
- "Programming Language :: Python :: 3.8" ,
102
- "Programming Language :: Python :: 3.9" ,
103
- "Programming Language :: Python :: 3.10" ,
104
- "Programming Language :: Python :: 3.11" ,
105
- "Programming Language :: Python :: 3.12" ,
106
- ],
107
- python_requires = ">=3.7" ,
108
- setup_requires = (["wheel" ] if "bdist_wheel" in sys .argv else []),
109
- extras_require = {
110
- "dev" : [
111
- "pyelftools" ,
112
- "coverage~=6.0" ,
113
- "pre-commit" ,
114
- "pytest" ,
115
- "pytest-rerunfailures" ,
116
- "requests" ,
117
- "commitizen" ,
118
- ],
119
- "hsm" : [
120
- "python-pkcs11" ,
121
- ],
122
- },
123
- install_requires = [
124
- "bitstring>=3.1.6" ,
125
- "cryptography>=2.1.4" ,
126
- "ecdsa>=0.16.0" ,
127
- "pyserial>=3.3" ,
128
- "reedsolo>=1.5.3,<1.8" ,
129
- "PyYAML>=5.1" ,
130
- "intelhex" ,
131
- ],
132
- packages = find_packages (),
133
- include_package_data = True ,
134
- package_data = {"" : ["esptool/targets/stub_flasher/*.json" ]},
135
- entry_points = entry_points ,
136
19
scripts = scripts ,
20
+ entry_points = entry_points ,
137
21
)
0 commit comments