Skip to content

Commit dec480e

Browse files
committed
Merge branch 'release/v1.1.3'
2 parents 6e5fbae + 59dfc04 commit dec480e

File tree

9 files changed

+45
-42
lines changed

9 files changed

+45
-42
lines changed

Diff for: .github/workflows/main.yml

+15-16
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11-
python-version: [3.6, 3.7, 3.8, 3.9]
12-
exclude:
13-
- os: macos-latest
14-
python-version: "3.6"
15-
- os: windows-latest
16-
python-version: "3.6"
11+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1712
runs-on: ${{ matrix.os }}
1813
steps:
19-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
2015
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v1
16+
uses: actions/setup-python@v4
2217
with:
2318
python-version: ${{ matrix.python-version }}
2419
- name: Check Python
@@ -37,11 +32,15 @@ jobs:
3732
- name: Integration Tests
3833
run: |
3934
make test
40-
# - name: Slack Notification
41-
# uses: homoluctus/slatify@master
42-
# if: failure()
43-
# with:
44-
# type: ${{ job.status }}
45-
# job_name: '*Installer*'
46-
# commit: true
47-
# url: ${{ secrets.SLACK_BUILD_WEBHOOK }}
35+
- name: Pack Installer Script
36+
run: |
37+
make pack
38+
- name: Install PlatformIO Core
39+
run: |
40+
python3 get-platformio.py
41+
if [ "$RUNNER_OS" == "Windows" ]; then
42+
~/.platformio/penv/Scripts/pio.exe system info
43+
else
44+
~/.platformio/penv/bin/pio system info
45+
fi
46+
shell: bash

Diff for: get-platformio.py

+1-1
Large diffs are not rendered by default.

Diff for: pioinstaller/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import logging.config
1616

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

2020
__title__ = "platformio-installer"

Diff for: pioinstaller/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def python():
9090
% (platform.python_version(), util.get_pythonexe_path()),
9191
fg="green",
9292
)
93-
except (exception.IncompatiblePythonError, exception.DistutilsNotFound) as e:
93+
except (exception.IncompatiblePythonError, exception.PythonVenvModuleNotFound) as e:
9494
raise click.ClickException(
9595
"The Python %s (%s) interpreter is not compatible.\nReason: %s"
9696
% (platform.python_version(), util.get_pythonexe_path(), str(e))
@@ -123,7 +123,7 @@ def core_check(ctx, **kwargs):
123123
% (state.get("core_version"), state.get("platformio_exe")),
124124
fg="green",
125125
)
126-
except (exception.InvalidPlatformIOCore) as e:
126+
except exception.InvalidPlatformIOCore as e:
127127
raise click.ClickException(
128128
"Compatible PlatformIO Core not found.\nReason: %s" % str(e)
129129
)

Diff for: pioinstaller/exception.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
class PIOInstallerException(Exception):
17-
1817
MESSAGE = None
1918

2019
def __str__(self): # pragma: no cover
@@ -26,15 +25,12 @@ def __str__(self): # pragma: no cover
2625

2726

2827
class IncompatiblePythonError(PIOInstallerException):
29-
3028
MESSAGE = "{0}"
3129

3230

33-
class DistutilsNotFound(PIOInstallerException):
34-
35-
MESSAGE = "Could not find distutils module"
31+
class PythonVenvModuleNotFound(PIOInstallerException):
32+
MESSAGE = "Could not find Python `venv` module"
3633

3734

3835
class InvalidPlatformIOCore(PIOInstallerException):
39-
4036
MESSAGE = "{0}"

Diff for: pioinstaller/python.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def get_portable_python_url():
9696
systype = util.get_systype()
9797
result = requests.get(
9898
"https://api.registry.platformio.org/v3/packages/"
99-
"platformio/tool/python-portable"
99+
"platformio/tool/python-portable",
100+
timeout=10,
100101
).json()
101102
versions = [
102103
version
@@ -137,9 +138,10 @@ def check():
137138
raise exception.IncompatiblePythonError("Conda is not supported")
138139

139140
try:
140-
__import__("distutils.command")
141+
__import__("venv")
142+
# __import__("distutils.command")
141143
except ImportError:
142-
raise exception.DistutilsNotFound()
144+
raise exception.PythonVenvModuleNotFound()
143145

144146
# portable Python 3 for macOS is not compatible with macOS < 10.13
145147
# https://github.com/platformio/platformio-core-installer/issues/70
@@ -175,7 +177,15 @@ def find_compatible_pythons(
175177
ignore_list = []
176178
for p in ignore_pythons or []:
177179
ignore_list.extend(glob.glob(p))
178-
exenames = ["python3", "python"]
180+
exenames = [
181+
# "python3.11",
182+
"python3.10",
183+
"python3.9",
184+
"python3.8",
185+
"python3.7",
186+
"python3",
187+
"python",
188+
]
179189
if util.IS_WINDOWS:
180190
exenames = ["%s.exe" % item for item in exenames]
181191
log.debug("Current environment PATH %s", os.getenv("PATH"))
@@ -215,10 +225,10 @@ def find_compatible_pythons(
215225
log.debug(error)
216226
except UnicodeDecodeError:
217227
pass
218-
if error and "Could not find distutils module" in error:
228+
if error and "`venv` module" in error:
219229
# pylint:disable=line-too-long
220230
raise click.ClickException(
221-
"""Can not install PlatformIO Core due to a missed `distutils` package in your Python installation.
231+
"""Can not install PlatformIO Core due to a missed `venv` module in your Python installation.
222232
Please install this package manually using the OS package manager. For example:
223233
224234
$ apt-get install python3-venv

Diff for: pioinstaller/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def safe_create_dir(path, raise_exception=False):
9090

9191
def download_file(url, dst, cache=True):
9292
if cache:
93-
content_length = requests.head(url).headers.get("Content-Length")
93+
content_length = requests.head(url, timeout=10).headers.get("Content-Length")
9494
if os.path.isfile(dst) and content_length == os.path.getsize(dst):
9595
log.debug("Getting from cache: %s", dst)
9696
return dst
9797

98-
resp = requests.get(url, stream=True)
98+
resp = requests.get(url, stream=True, timeout=10)
9999
itercontent = resp.iter_content(chunk_size=io.DEFAULT_BUFFER_SIZE)
100100
safe_create_dir(os.path.dirname(dst))
101101
with open(dst, "wb") as fp:

Diff for: setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
install_requires=[
3737
# Core
3838
"click==8.0.4", # >8.0.4 does not support Python 3.6
39-
"requests==2.27.1",
40-
"colorama==0.4.5",
39+
"urllib3<2", # issue 4614: urllib3 v2.0 only supports OpenSSL 1.1.1+
40+
"requests==2.31.0",
41+
"colorama==0.4.6",
4142
"semantic-version==2.8.5", # >2.8.5 does not support Python 3.6
42-
"certifi==2022.6.15",
43+
"certifi==2023.5.7",
4344
# Misc
44-
"wheel==0.37.1",
45+
"wheel==0.40.0",
4546
],
4647
packages=find_packages(),
4748
entry_points={

Diff for: tox.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Copyright 2019-present PlatformIO Labs <[email protected]>
22

3-
[tox]
4-
envlist = py27,py35,py36,py37,py38,py39
5-
63
[testenv]
74
usedevelop = True
85
deps =
9-
py35,py36,py37,py38,py39: black
6+
black
107
isort
118
pylint
129
pytest

0 commit comments

Comments
 (0)