Skip to content

Commit 6e5fbae

Browse files
committed
Merge branch 'release/v1.1.2'
2 parents 388b53b + 7e3f760 commit 6e5fbae

File tree

8 files changed

+31
-21
lines changed

8 files changed

+31
-21
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
exclude:
1313
- os: macos-latest
1414
python-version: "3.6"
15+
- os: windows-latest
16+
python-version: "3.6"
1517
runs-on: ${{ matrix.os }}
1618
steps:
1719
- uses: actions/checkout@v2

.pylintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ disable=
1010
ungrouped-imports,
1111
invalid-name,
1212
duplicate-code,
13-
bad-continuation,
1413
fixme,
1514
arguments-differ,
1615
useless-object-inheritance,

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, 1, 1)
17+
VERSION = (1, 1, 2)
1818
__version__ = ".".join([str(s) for s in VERSION])
1919

2020
__title__ = "platformio-installer"

pioinstaller/core.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,22 @@ def _check_core_version(piocore_version, version_spec):
232232
def _check_platform_version():
233233
from pioinstaller import penv
234234

235-
state = penv.load_state()
236-
if state.get("platform") != platform.platform(terse=True):
237-
raise exception.InvalidPlatformIOCore(
238-
"PlatformIO Core was installed using another platform `%s`. "
239-
"Your current platform: %s"
240-
% (state.get("platform"), platform.platform(terse=True))
241-
)
235+
platform_state = penv.load_state().get("platform")
236+
if not platform_state or not isinstance(platform_state, dict):
237+
raise exception.PIOInstallerException("Broken platform state")
238+
if platform_state.get("platform") == platform.platform(terse=True):
239+
return True
240+
release_state = platform_state.get("release")
241+
if (
242+
release_state
243+
and release_state.split(".")[0] == (platform.release() or "").split(".")[0]
244+
):
245+
return True
246+
raise exception.InvalidPlatformIOCore(
247+
"PlatformIO Core was installed using another platform `%s`. "
248+
"Your current platform: %s"
249+
% (platform_state.get("platform"), platform.platform(terse=True))
250+
)
242251

243252

244253
def fetch_python_state(python_exe):

pioinstaller/penv.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def create_virtualenv(python_exe, penv_dir):
8686
)
8787
try:
8888
return create_with_remote_venv(python_exe, penv_dir)
89-
except Exception as e: # pylint:disable=broad-except
89+
except Exception as exc: # pylint:disable=broad-except
9090
log.debug(
9191
"Could not create virtualenv with downloaded script. Error: %s",
92-
str(e),
92+
str(exc),
9393
)
9494
return None
9595

@@ -151,7 +151,10 @@ def init_state(python_exe, penv_dir):
151151
"version": python_version,
152152
},
153153
"installer_version": __version__,
154-
"platform": platform.platform(terse=True),
154+
"platform": {
155+
"platform": platform.platform(),
156+
"release": platform.release(),
157+
},
155158
}
156159
return save_state(state, penv_dir)
157160

pioinstaller/python.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ def find_compatible_pythons(
186186
continue
187187
candidates.append(os.path.join(path, exe))
188188
if sys.executable not in candidates:
189-
if sys.version_info >= (3,):
190-
candidates.insert(0, sys.executable)
191-
else:
192-
candidates.append(sys.executable)
189+
candidates.insert(0, sys.executable)
193190
result = []
194191
for item in candidates:
195192
if item in ignore_list:

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
license=__license__,
3636
install_requires=[
3737
# Core
38-
"click==8.0.3",
38+
"click==8.0.4", # >8.0.4 does not support Python 3.6
3939
"requests==2.27.1",
40-
"colorama==0.4.4",
41-
"semantic-version==2.8.5",
42-
"certifi==2021.10.8",
40+
"colorama==0.4.5",
41+
"semantic-version==2.8.5", # >2.8.5 does not support Python 3.6
42+
"certifi==2022.6.15",
4343
# Misc
4444
"wheel==0.37.1",
4545
],

0 commit comments

Comments
 (0)