Skip to content

Commit 4b3f2e1

Browse files
committed
Merge branch 'release/v5.0.3'
2 parents 7292024 + f4dba7a commit 4b3f2e1

File tree

19 files changed

+129
-55
lines changed

19 files changed

+129
-55
lines changed

HISTORY.rst

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ PlatformIO Core 5
88

99
**A professional collaborative platform for embedded development**
1010

11+
5.0.3 (2020-11-12)
12+
~~~~~~~~~~~~~~~~~~
13+
14+
- Added an error selector for `Sublime Text <https://docs.platformio.org/page/integration/ide/sublimetext.html>`__ build runner (`issue #3733 <https://github.com/platformio/platformio-core/issues/3733>`_)
15+
- Generate a working "projectEnvName" for PlatformIO IDE's debugger for VSCode
16+
- Force VSCode's intelliSenseMode to "gcc-x64" when GCC toolchain is used
17+
- Print ignored test suites and environments in the test summary report only in verbose mode (`issue #3726 <https://github.com/platformio/platformio-core/issues/3726>`_)
18+
- Fixed an issue when the package manager tries to install a built-in library from the registry (`issue #3662 <https://github.com/platformio/platformio-core/issues/3662>`_)
19+
- Fixed an issue when `pio package pack <https://docs.platformio.org/page/core/userguide/package/cmd_pack.html>`__ ignores some folders (`issue #3730 <https://github.com/platformio/platformio-core/issues/3730>`_)
20+
1121
5.0.2 (2020-10-30)
1222
~~~~~~~~~~~~~~~~~~
1323

docs

platformio/__init__.py

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

1515
import sys
1616

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

2020
__title__ = "platformio"

platformio/app.py

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ def get_cid():
255255
uid = None
256256
if os.getenv("C9_UID"):
257257
uid = os.getenv("C9_UID")
258+
elif os.getenv("GITPOD_GIT_USER_NAME"):
259+
uid = os.getenv("GITPOD_GIT_USER_NAME")
258260
elif os.getenv("CHE_API", os.getenv("CHE_API_ENDPOINT")):
259261
try:
260262
uid = json.loads(

platformio/commands/project.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,19 @@ def project_init(
149149
):
150150
if not silent:
151151
if project_dir == os.getcwd():
152-
click.secho("\nThe current working directory", fg="yellow", nl=False)
153-
click.secho(" %s " % project_dir, fg="cyan", nl=False)
154-
click.secho("will be used for the project.", fg="yellow")
152+
click.secho("\nThe current working directory ", fg="yellow", nl=False)
153+
try:
154+
click.secho(project_dir, fg="cyan", nl=False)
155+
except UnicodeEncodeError:
156+
click.secho(json.dumps(project_dir), fg="cyan", nl=False)
157+
click.secho(" will be used for the project.", fg="yellow")
155158
click.echo("")
156159

157-
click.echo(
158-
"The next files/directories have been created in %s"
159-
% click.style(project_dir, fg="cyan")
160-
)
160+
click.echo("The next files/directories have been created in ", nl=False)
161+
try:
162+
click.secho(project_dir, fg="cyan")
163+
except UnicodeEncodeError:
164+
click.secho(json.dumps(project_dir), fg="cyan")
161165
click.echo(
162166
"%s - Put project header files here" % click.style("include", fg="cyan")
163167
)

platformio/commands/test/command.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def cli( # pylint: disable=redefined-builtin
177177
if without_testing:
178178
return
179179

180-
print_testing_summary(results)
180+
print_testing_summary(results, verbose)
181181

182182
command_failed = any(r.get("succeeded") is False for r in results)
183183
if command_failed:
@@ -222,7 +222,7 @@ def print_processing_footer(result):
222222
)
223223

224224

225-
def print_testing_summary(results):
225+
def print_testing_summary(results, verbose=False):
226226
click.echo()
227227

228228
tabular_data = []
@@ -236,6 +236,8 @@ def print_testing_summary(results):
236236
failed_nums += 1
237237
status_str = click.style("FAILED", fg="red")
238238
elif result.get("succeeded") is None:
239+
if not verbose:
240+
continue
239241
status_str = "IGNORED"
240242
else:
241243
succeeded_nums += 1

platformio/ide/tpls/emacs/.ccls.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% cxx_stds = STD_RE.findall(cxx_flags)
55
%
66
%
7-
clang
7+
{{ cxx_path }}
88

99
% if cc_stds:
1010
{{"%c"}} -std=c{{ cc_stds[-1] }}

platformio/ide/tpls/qtcreator/platformio.pro.tpl

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
% import re
2+
%
3+
% cpp_standards_remap = {
4+
% "0x": "11",
5+
% "1y": "14",
6+
% "1z": "17",
7+
% "2a": "20",
8+
% "2b": "23"
9+
% }
10+
111
win32 {
212
HOMEDIR += $$(USERPROFILE)
313
}
@@ -27,3 +37,9 @@ HEADERS += {{file}}
2737
SOURCES += {{file}}
2838
% end
2939
% end
40+
41+
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
42+
% cxx_stds = STD_RE.findall(cxx_flags)
43+
% if cxx_stds:
44+
CONFIG += c++{{ cpp_standards_remap.get(cxx_stds[-1], cxx_stds[-1]) }}
45+
% end
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
% import re
2+
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
3+
% cc_stds = STD_RE.findall(cc_flags)
4+
% cxx_stds = STD_RE.findall(cxx_flags)
5+
%
6+
%
7+
{{ cxx_path }}
8+
9+
% if cc_stds:
10+
{{"%c"}} -std=c{{ cc_stds[-1] }}
11+
% end
12+
% if cxx_stds:
13+
{{"%cpp"}} -std=c++{{ cxx_stds[-1] }}
14+
% end
15+
16+
% for include in filter_includes(includes):
17+
-I{{ include }}
18+
% end
19+
20+
% for define in defines:
21+
-D{{ define }}
22+
% end

platformio/ide/tpls/sublimetext/platformio.sublime-project.tpl

+15-19
Original file line numberDiff line numberDiff line change
@@ -5,88 +5,84 @@
55
"cmd":
66
[
77
"{{ platformio_path }}",
8-
"-f", "-c", "sublimetext",
8+
"-c", "sublimetext",
99
"run"
1010
],
11+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
1112
"name": "PlatformIO",
1213
"variants":
1314
[
1415
{
1516
"cmd":
1617
[
1718
"{{ platformio_path }}",
18-
"-f", "-c", "sublimetext",
19+
"-c", "sublimetext",
1920
"run"
2021
],
22+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
2123
"name": "Build"
2224
},
2325
{
2426
"cmd":
2527
[
2628
"{{ platformio_path }}",
27-
"-f", "-c", "sublimetext",
29+
"-c", "sublimetext",
2830
"run",
2931
"--target",
3032
"upload"
3133
],
34+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
3235
"name": "Upload"
3336
},
3437
{
3538
"cmd":
3639
[
3740
"{{ platformio_path }}",
38-
"-f", "-c", "sublimetext",
41+
"-c", "sublimetext",
3942
"run",
4043
"--target",
4144
"clean"
4245
],
46+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
4347
"name": "Clean"
4448
},
4549
{
4650
"cmd":
4751
[
4852
"{{ platformio_path }}",
49-
"-f", "-c", "sublimetext",
53+
"-c", "sublimetext",
5054
"test"
5155
],
56+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
5257
"name": "Test"
5358
},
5459
{
5560
"cmd":
5661
[
5762
"{{ platformio_path }}",
58-
"-f", "-c", "sublimetext",
59-
"run",
60-
"--target",
61-
"program"
62-
],
63-
"name": "Upload using Programmer"
64-
},
65-
{
66-
"cmd":
67-
[
68-
"{{ platformio_path }}",
69-
"-f", "-c", "sublimetext",
63+
"-c", "sublimetext",
7064
"run",
7165
"--target",
7266
"uploadfs"
7367
],
68+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
7469
"name": "Upload SPIFFS image"
7570
},
7671
{
7772
"cmd":
7873
[
7974
"{{ platformio_path }}",
80-
"-f", "-c", "sublimetext",
75+
"-c", "sublimetext",
8176
"update"
8277
],
78+
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
8379
"name": "Update platforms and libraries"
8480
},
8581
{
8682
"cmd":
8783
[
8884
"{{ platformio_path }}",
89-
"-f", "-c", "sublimetext",
85+
"-c", "sublimetext",
9086
"upgrade"
9187
],
9288
"name": "Upgrade PlatformIO Core"

platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@
118118
% end
119119
""
120120
],
121-
"intelliSenseMode": "clang-x64",
121+
% if compiler_type == "gcc":
122+
"intelliSenseMode": "gcc-x64",
123+
% end
122124
% if cc_stds:
123125
"cStandard": "c{{ cc_stds[-1] }}",
124126
% end

platformio/ide/tpls/vscode/.vscode/launch.json.tpl

+6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@
1919
"request": "launch",
2020
"name": "PIO Debug",
2121
"executable": "{{ _escape_path(prog_path) }}",
22+
"projectEnvName": "{{ env_name }}",
2223
"toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}",
2324
% if svd_path:
2425
"svdPath": "{{ _escape_path(svd_path) }}",
2526
% end
2627
"preLaunchTask": {
2728
"type": "PlatformIO",
29+
% if len(config.envs()) > 1:
30+
"task": "Pre-Debug ({{ env_name }})"
31+
% else:
2832
"task": "Pre-Debug"
33+
% end
2934
},
3035
"internalConsoleOptions": "openOnSessionStart"
3136
},
@@ -34,6 +39,7 @@
3439
"request": "launch",
3540
"name": "PIO Debug (skip Pre-Debug)",
3641
"executable": "{{ _escape_path(prog_path) }}",
42+
"projectEnvName": "{{ env_name }}",
3743
"toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}",
3844
% if svd_path:
3945
"svdPath": "{{ _escape_path(svd_path) }}",

platformio/maintenance.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,20 @@ def on_platformio_exception(e):
7373

7474
def set_caller(caller=None):
7575
caller = caller or getenv("PLATFORMIO_CALLER")
76-
if not caller:
77-
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
78-
caller = "vscode"
79-
elif is_container():
80-
if getenv("C9_UID"):
81-
caller = "C9"
82-
elif getenv("USER") == "cabox":
83-
caller = "CA"
84-
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
85-
caller = "Che"
86-
app.set_session_var("caller_id", caller)
76+
if caller:
77+
return app.set_session_var("caller_id", caller)
78+
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
79+
caller = "vscode"
80+
elif getenv("GITPOD_INSTANCE_ID") or getenv("GITPOD_WORKSPACE_URL"):
81+
caller = "gitpod"
82+
elif is_container():
83+
if getenv("C9_UID"):
84+
caller = "C9"
85+
elif getenv("USER") == "cabox":
86+
caller = "CA"
87+
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
88+
caller = "Che"
89+
return app.set_session_var("caller_id", caller)
8790

8891

8992
class Upgrader(object):

platformio/package/manager/library.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ def _install_dependency(self, dependency, silent=False):
127127
for key, value in dependency.items()
128128
if key in ("authors", "platforms", "frameworks")
129129
}
130-
return self._install(spec, search_filters=search_filters or None, silent=silent)
130+
try:
131+
return self._install(
132+
spec, search_filters=search_filters or None, silent=silent
133+
)
134+
except UnknownPackageError:
135+
pass
136+
return None
131137

132138
def uninstall_dependencies(self, pkg, silent=False):
133139
assert isinstance(pkg, PackageItem)

platformio/package/manifest/schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class ExampleSchema(StrictSchema):
141141
name = fields.Str(
142142
required=True,
143143
validate=[
144-
validate.Length(min=1, max=100),
144+
validate.Length(min=1, max=255),
145145
validate.Regexp(
146146
r"^[a-zA-Z\d\-\_/]+$", error="Only [a-zA-Z0-9-_/] chars are allowed"
147147
),

platformio/package/pack.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class PackagePacker(object):
4646
".git/",
4747
".hg/",
4848
".svn/",
49+
]
50+
EXCLUDE_EXTRA = [
4951
# Tests
5052
"tests?",
5153
# Docs
@@ -120,7 +122,6 @@ def pack(self, dst=None):
120122
src = tmp_dir
121123

122124
src = self.find_source_root(src)
123-
124125
manifest = self.load_manifest(src)
125126
filename = self.get_archive_name(
126127
manifest["name"],
@@ -188,7 +189,7 @@ def _create_tarball(self, src, dst, manifest):
188189
return dst
189190

190191
def compute_src_filters(self, src, include, exclude):
191-
exclude_default = self.EXCLUDE_DEFAULT[:]
192+
exclude_extra = self.EXCLUDE_EXTRA[:]
192193
# extend with library extra filters
193194
if any(
194195
os.path.isfile(os.path.join(src, name))
@@ -198,11 +199,15 @@ def compute_src_filters(self, src, include, exclude):
198199
ManifestFileType.MODULE_JSON,
199200
)
200201
):
201-
exclude_default.extend(self.EXCLUDE_LIBRARY_EXTRA)
202+
exclude_extra.extend(self.EXCLUDE_LIBRARY_EXTRA)
202203

203204
result = ["+<%s>" % p for p in include or ["*", ".*"]]
205+
result += ["-<%s>" % p for p in self.EXCLUDE_DEFAULT]
206+
# exclude items declared in manifest
204207
result += ["-<%s>" % p for p in exclude or []]
205-
result += ["-<%s>" % p for p in exclude_default]
208+
# apply extra excludes if no custom "export" field in manifest
209+
if not include and not exclude:
210+
result += ["-<%s>" % p for p in exclude_extra]
206211
# automatically include manifests
207212
result += ["+<%s>" % p for p in self.INCLUDE_DEFAULT]
208213
return result

0 commit comments

Comments
 (0)