Skip to content

Commit 923523d

Browse files
committed
Merge branch 'release/v1.2.1'
2 parents f8e30a0 + 5d799b0 commit 923523d

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

get-platformio.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pioinstaller/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import logging.config
1616

17-
VERSION = (1, 2, 0)
17+
VERSION = (1, 2, 1)
1818
__version__ = ".".join([str(s) for s in VERSION])
1919

2020
__title__ = "platformio-installer"

pioinstaller/python.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ def find_compatible_pythons(
179179
for p in ignore_pythons or []:
180180
ignore_list.extend(glob.glob(p))
181181
exenames = [
182-
# "python3.11",
182+
"python3", # system Python
183+
"python3.11",
183184
"python3.10",
184185
"python3.9",
185186
"python3.8",
186187
"python3.7",
187-
"python3",
188188
"python",
189189
]
190190
if util.IS_WINDOWS:
@@ -196,9 +196,14 @@ def find_compatible_pythons(
196196
if not os.path.isfile(os.path.join(path, exe)):
197197
continue
198198
candidates.append(os.path.join(path, exe))
199-
if sys.executable not in candidates:
200-
candidates.insert(0, sys.executable)
199+
200+
if sys.executable in candidates:
201+
candidates.remove(sys.executable)
202+
# put current Python to the top of list
203+
candidates.insert(0, sys.executable)
204+
201205
result = []
206+
missed_venv_module = False
202207
for item in candidates:
203208
if item in ignore_list:
204209
continue
@@ -220,26 +225,29 @@ def find_compatible_pythons(
220225
except UnicodeDecodeError:
221226
pass
222227
except subprocess.CalledProcessError as e:
223-
error = None
224228
try:
225229
error = e.output.decode()
230+
if error and "`venv` module" in error:
231+
missed_venv_module = True
226232
log.debug(error)
227233
except UnicodeDecodeError:
228234
pass
229-
if error and "`venv` module" in error:
230-
# pylint:disable=line-too-long
231-
raise click.ClickException(
232-
"""Can not install PlatformIO Core due to a missed `venv` module in your Python installation.
233-
Please install this package manually using the OS package manager. For example:
234-
235-
$ apt-get install python3-venv
236-
237-
(MAY require administrator access `sudo`)""",
238-
)
239235
except Exception as e: # pylint: disable=broad-except
240236
log.debug(e)
241237

242238
if not result and raise_exception:
239+
if missed_venv_module:
240+
# pylint:disable=line-too-long
241+
raise click.ClickException(
242+
"""Can not install PlatformIO Core due to a missed `venv` module in your Python installation.
243+
Please install this package manually using the OS package manager. For example:
244+
245+
$ apt-get install python3.%d-venv
246+
247+
(MAY require administrator access `sudo`)"""
248+
% (sys.version_info[1]),
249+
)
250+
243251
raise exception.IncompatiblePythonError(
244252
"Could not find compatible Python 3.6 or above in your system."
245253
"Please install the latest official Python 3 and restart installation:\n"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"requests==2.31.0",
4141
"colorama==0.4.6",
4242
"semantic-version==2.8.5", # >2.8.5 does not support Python 3.6
43-
"certifi==2023.5.7",
43+
"certifi==2023.7.22",
4444
# Misc
45-
"wheel==0.40.0",
45+
"wheel==0.41.0",
4646
],
4747
packages=find_packages(),
4848
entry_points={

0 commit comments

Comments
 (0)