Skip to content

Commit db30f62

Browse files
committed
Merge branch 'release/v0.3.1'
2 parents 553e755 + 98c382c commit db30f62

File tree

13 files changed

+82
-120
lines changed

13 files changed

+82
-120
lines changed

.appveyor.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, windows-latest, macos-latest]
11+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Check Python
20+
run: |
21+
python -V
22+
which python
23+
echo $PATH
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -U tox pytest
28+
pip install -e .
29+
- name: Python Lint
30+
run: |
31+
tox -e lint
32+
- name: Integration Tests
33+
run: |
34+
make test
35+
# - name: Slack Notification
36+
# uses: homoluctus/slatify@master
37+
# if: failure()
38+
# with:
39+
# type: ${{ job.status }}
40+
# job_name: '*Installer*'
41+
# commit: true
42+
# url: ${{ secrets.SLACK_BUILD_WEBHOOK }}

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@ format:
1212
test:
1313
py.test --verbose --capture=no --exitfirst tests
1414

15-
before-commit: isort format lint test
15+
pack:
16+
pioinstaller pack
17+
18+
before-commit: isort format lint
1619

1720
clean:
1821
find . -name \*.pyc -delete
1922
find . -name __pycache__ -delete
2023
rm -rf .cache
21-
rm -rf build
22-
rm -rf htmlcov
23-
rm -f .coverage
24-
25-
profile:
26-
# Usage $ > make PIOARGS="boards" profile
27-
python -m cProfile -o .tox/.tmp/cprofile.prof $(shell which platformio) ${PIOARGS}
28-
snakeviz .tox/.tmp/cprofile.prof
2924

3025
publish:
3126
python setup.py sdist upload

README.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
PlatformIO Core Installer
22
=========================
33

4-
.. image:: https://travis-ci.org/platformio/platformio-core-installer.svg?branch=develop
5-
:target: https://travis-ci.org/platformio/platformio-core-installer
6-
:alt: Travis.CI Build Status
7-
.. image:: https://ci.appveyor.com/api/projects/status/2crg7e2oxutmk07r/branch/develop?svg=true
8-
:target: https://ci.appveyor.com/project/ivankravets/platformio-core-installer
9-
:alt: AppVeyor.CI Build Status
4+
5+
.. image:: https://github.com/platformio/platformio-core-installer/workflows/CI/badge.svg
6+
:target: https://docs.platformio.org/en/latest/core/installation.html
7+
:alt: CI Build
108
.. image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg
119
:target: https://pypi.python.org/pypi/platformio/
1210
:alt: License

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

2020
__title__ = "platformio-installer"

pioinstaller/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ def python():
9090

9191
@check.command("core")
9292
@click.option("--auto-upgrade/--no-auto-upgrade", is_flag=True, default=True)
93-
@click.option("--version-requirements", default=None)
93+
@click.option("--version-spec", default=None)
9494
@click.option(
9595
"--dump-state",
9696
type=click.Path(
9797
exists=False, file_okay=True, dir_okay=True, writable=True, resolve_path=True
9898
),
9999
)
100100
@click.pass_context
101-
def core_check(ctx, auto_upgrade, version_requirements, dump_state):
101+
def core_check(ctx, auto_upgrade, version_spec, dump_state):
102102
try:
103103
state = core.check(
104104
dev=ctx.obj.get("dev", False),
105105
auto_upgrade=auto_upgrade,
106-
version_requirements=version_requirements,
106+
version_spec=version_spec,
107107
)
108108
if dump_state:
109-
core.dump_state(target=dump_state, state=state)
109+
core.dump_state(target=str(dump_state), state=state)
110110
click.secho(
111111
"Found compatible PlatformIO Core %s -> %s"
112112
% (state.get("core_version"), state.get("platformio_exe")),

pioinstaller/core.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,21 @@ def get_core_dir():
3535
return os.getenv("PLATFORMIO_CORE_DIR")
3636

3737
core_dir = os.path.join(util.expanduser("~"), ".platformio")
38-
if not util.IS_WINDOWS or not util.has_non_ascii_char(core_dir):
38+
if not util.IS_WINDOWS:
3939
return core_dir
4040

4141
win_core_dir = os.path.splitdrive(core_dir)[0] + "\\.platformio"
42-
if not os.path.isdir(win_core_dir):
43-
try:
42+
if os.path.isdir(win_core_dir):
43+
return win_core_dir
44+
try:
45+
if util.has_non_ascii_char(core_dir):
4446
os.makedirs(win_core_dir)
4547
with open(os.path.join(win_core_dir, "file.tmp"), "w") as fp:
4648
fp.write("test")
4749
os.remove(os.path.join(win_core_dir, "file.tmp"))
4850
return win_core_dir
49-
except: # pylint:disable=bare-except
50-
pass
51+
except: # pylint:disable=bare-except
52+
pass
5153

5254
return core_dir
5355

@@ -119,7 +121,7 @@ def install_platformio_core(shutdown_piohome=True, develop=False, ignore_pythons
119121
return True
120122

121123

122-
def check(dev=False, auto_upgrade=False, version_requirements=None):
124+
def check(dev=False, auto_upgrade=False, version_spec=None):
123125
# pylint: disable=bad-option-value, import-outside-toplevel, unused-import, import-error, unused-variable, cyclic-import
124126
from pioinstaller import penv
125127

@@ -166,18 +168,17 @@ def check(dev=False, auto_upgrade=False, version_requirements=None):
166168
}
167169
)
168170

169-
if version_requirements:
171+
if version_spec:
170172
try:
171-
if piocore_version in semantic_version.Spec(version_requirements):
173+
if piocore_version not in semantic_version.Spec(version_spec):
172174
raise exception.InvalidPlatformIOCore(
173175
"PlatformIO Core version %s does not match version requirements %s."
174-
% (str(piocore_version), version_requirements)
176+
% (str(piocore_version), version_spec)
175177
)
176178
except ValueError:
177179
click.secho(
178180
"Invalid version requirements format: %s. "
179-
"More about Semantic Versioning: https://semver.org/"
180-
% version_requirements
181+
"More about Semantic Versioning: https://semver.org/" % version_spec
181182
)
182183

183184
with open(os.path.join(penv.get_penv_dir(), "state.json")) as fp:

pioinstaller/python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
PORTABLE_PYTHONS = {
3030
"windows_x86": "https://dl.bintray.com/platformio/dl-misc/"
31-
"python-portable-windows_x86-3.7.6.tar.gz",
31+
"python-portable-windows_x86-3.7.7.tar.gz",
3232
"windows_amd64": "https://dl.bintray.com/platformio/dl-misc/"
33-
"python-portable-windows_amd64-3.7.6.tar.gz",
33+
"python-portable-windows_amd64-3.7.7.tar.gz",
3434
}
3535

3636

0 commit comments

Comments
 (0)