Skip to content

Commit

Permalink
Merge branch 'release/v5.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Nov 12, 2020
2 parents 7292024 + f4dba7a commit 4b3f2e1
Show file tree
Hide file tree
Showing 19 changed files with 129 additions and 55 deletions.
10 changes: 10 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ PlatformIO Core 5

**A professional collaborative platform for embedded development**

5.0.3 (2020-11-12)
~~~~~~~~~~~~~~~~~~

- 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>`_)
- Generate a working "projectEnvName" for PlatformIO IDE's debugger for VSCode
- Force VSCode's intelliSenseMode to "gcc-x64" when GCC toolchain is used
- 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>`_)
- 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>`_)
- 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>`_)

5.0.2 (2020-10-30)
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs
Submodule docs updated 49 files
+ _static/images/ide/vscode/platformio-ide-vscode-cli-access.png
+4 −0 articles.rst
+4 −1 boards/atmelsam/adafruit_itsybitsy_m4.rst
+4 −1 boards/atmelsam/nano_33_iot.rst
+4 −1 boards/atmelsam/seeed_xiao.rst
+7 −0 boards/index.rst
+133 −0 boards/nordicnrf52/laird_pinnacle_100_dvk.rst
+133 −0 boards/nordicnrf52/ruuvitag.rst
+5 −2 boards/nxplpc/lpc11u68.rst
+125 −0 boards/shakti/parashu.rst
+125 −0 boards/shakti/pinaka.rst
+125 −0 boards/shakti/vajra.rst
+3 −0 boards/ststm32/blackpill_f411ce.rst
+139 −0 boards/ststm32/olimex_f103.rst
+136 −0 boards/ststm32/waveshare_open103z.rst
+9 −0 core/migration.rst
+0 −10 core/userguide/cmd_settings.rst
+3 −11 core/userguide/package/cmd_publish.rst
+0 −4 envvars.rst
+26 −0 frameworks/arduino.rst
+40 −0 frameworks/cmsis.rst
+1 −0 frameworks/index.rst
+40 −0 frameworks/libopencm3.rst
+13 −0 frameworks/mbed.rst
+39 −0 frameworks/shakti-sdk.rst
+27 −0 frameworks/siwisdk.rst
+40 −0 frameworks/stm32cube.rst
+133 −0 frameworks/zephyr.rst
+11 −8 integration/ide/vscode.rst
+4 −0 platforms/atmelavr_extra.rst
+1 −0 platforms/atmelmegaavr.rst
+128 −0 platforms/atmelmegaavr_extra.rst
+5 −2 platforms/atmelsam.rst
+5 −2 platforms/freescalekinetis.rst
+5 −2 platforms/nordicnrf51.rst
+40 −2 platforms/nordicnrf52.rst
+5 −2 platforms/nxpimxrt.rst
+5 −2 platforms/nxplpc.rst
+34 −0 platforms/shakti.rst
+5 −2 platforms/sifive.rst
+5 −2 platforms/siliconlabsefm32.rst
+37 −2 platforms/ststm32.rst
+28 −0 plus/debug-tools/blackmagic.rst
+14 −0 plus/debug-tools/cmsis-dap.rst
+21 −0 plus/debug-tools/ftdi.rst
+49 −0 plus/debug-tools/jlink.rst
+28 −0 plus/debug-tools/stlink.rst
+63 −0 plus/debugging.rst
+32 −17 projectconf/advanced_scripting.rst
2 changes: 1 addition & 1 deletion examples
2 changes: 1 addition & 1 deletion platformio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import sys

VERSION = (5, 0, 2)
VERSION = (5, 0, 3)
__version__ = ".".join([str(s) for s in VERSION])

__title__ = "platformio"
Expand Down
2 changes: 2 additions & 0 deletions platformio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ def get_cid():
uid = None
if os.getenv("C9_UID"):
uid = os.getenv("C9_UID")
elif os.getenv("GITPOD_GIT_USER_NAME"):
uid = os.getenv("GITPOD_GIT_USER_NAME")
elif os.getenv("CHE_API", os.getenv("CHE_API_ENDPOINT")):
try:
uid = json.loads(
Expand Down
18 changes: 11 additions & 7 deletions platformio/commands/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,19 @@ def project_init(
):
if not silent:
if project_dir == os.getcwd():
click.secho("\nThe current working directory", fg="yellow", nl=False)
click.secho(" %s " % project_dir, fg="cyan", nl=False)
click.secho("will be used for the project.", fg="yellow")
click.secho("\nThe current working directory ", fg="yellow", nl=False)
try:
click.secho(project_dir, fg="cyan", nl=False)
except UnicodeEncodeError:
click.secho(json.dumps(project_dir), fg="cyan", nl=False)
click.secho(" will be used for the project.", fg="yellow")
click.echo("")

click.echo(
"The next files/directories have been created in %s"
% click.style(project_dir, fg="cyan")
)
click.echo("The next files/directories have been created in ", nl=False)
try:
click.secho(project_dir, fg="cyan")
except UnicodeEncodeError:
click.secho(json.dumps(project_dir), fg="cyan")
click.echo(
"%s - Put project header files here" % click.style("include", fg="cyan")
)
Expand Down
6 changes: 4 additions & 2 deletions platformio/commands/test/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def cli( # pylint: disable=redefined-builtin
if without_testing:
return

print_testing_summary(results)
print_testing_summary(results, verbose)

command_failed = any(r.get("succeeded") is False for r in results)
if command_failed:
Expand Down Expand Up @@ -222,7 +222,7 @@ def print_processing_footer(result):
)


def print_testing_summary(results):
def print_testing_summary(results, verbose=False):
click.echo()

tabular_data = []
Expand All @@ -236,6 +236,8 @@ def print_testing_summary(results):
failed_nums += 1
status_str = click.style("FAILED", fg="red")
elif result.get("succeeded") is None:
if not verbose:
continue
status_str = "IGNORED"
else:
succeeded_nums += 1
Expand Down
2 changes: 1 addition & 1 deletion platformio/ide/tpls/emacs/.ccls.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% cxx_stds = STD_RE.findall(cxx_flags)
%
%
clang
{{ cxx_path }}

% if cc_stds:
{{"%c"}} -std=c{{ cc_stds[-1] }}
Expand Down
16 changes: 16 additions & 0 deletions platformio/ide/tpls/qtcreator/platformio.pro.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
% import re
%
% cpp_standards_remap = {
% "0x": "11",
% "1y": "14",
% "1z": "17",
% "2a": "20",
% "2b": "23"
% }

win32 {
HOMEDIR += $$(USERPROFILE)
}
Expand Down Expand Up @@ -27,3 +37,9 @@ HEADERS += {{file}}
SOURCES += {{file}}
% end
% end

% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cxx_stds = STD_RE.findall(cxx_flags)
% if cxx_stds:
CONFIG += c++{{ cpp_standards_remap.get(cxx_stds[-1], cxx_stds[-1]) }}
% end
22 changes: 22 additions & 0 deletions platformio/ide/tpls/sublimetext/.ccls.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% import re
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
%
%
{{ cxx_path }}

% if cc_stds:
{{"%c"}} -std=c{{ cc_stds[-1] }}
% end
% if cxx_stds:
{{"%cpp"}} -std=c++{{ cxx_stds[-1] }}
% end

% for include in filter_includes(includes):
-I{{ include }}
% end

% for define in defines:
-D{{ define }}
% end
34 changes: 15 additions & 19 deletions platformio/ide/tpls/sublimetext/platformio.sublime-project.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,84 @@
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"run"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "PlatformIO",
"variants":
[
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"run"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Build"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"run",
"--target",
"upload"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Upload"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"run",
"--target",
"clean"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Clean"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"test"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Test"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
"program"
],
"name": "Upload using Programmer"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"run",
"--target",
"uploadfs"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Upload SPIFFS image"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"update"
],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "Update platforms and libraries"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"-c", "sublimetext",
"upgrade"
],
"name": "Upgrade PlatformIO Core"
Expand Down
4 changes: 3 additions & 1 deletion platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
% end
""
],
"intelliSenseMode": "clang-x64",
% if compiler_type == "gcc":
"intelliSenseMode": "gcc-x64",
% end
% if cc_stds:
"cStandard": "c{{ cc_stds[-1] }}",
% end
Expand Down
6 changes: 6 additions & 0 deletions platformio/ide/tpls/vscode/.vscode/launch.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
"request": "launch",
"name": "PIO Debug",
"executable": "{{ _escape_path(prog_path) }}",
"projectEnvName": "{{ env_name }}",
"toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}",
% if svd_path:
"svdPath": "{{ _escape_path(svd_path) }}",
% end
"preLaunchTask": {
"type": "PlatformIO",
% if len(config.envs()) > 1:
"task": "Pre-Debug ({{ env_name }})"
% else:
"task": "Pre-Debug"
% end
},
"internalConsoleOptions": "openOnSessionStart"
},
Expand All @@ -34,6 +39,7 @@
"request": "launch",
"name": "PIO Debug (skip Pre-Debug)",
"executable": "{{ _escape_path(prog_path) }}",
"projectEnvName": "{{ env_name }}",
"toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}",
% if svd_path:
"svdPath": "{{ _escape_path(svd_path) }}",
Expand Down
25 changes: 14 additions & 11 deletions platformio/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ def on_platformio_exception(e):

def set_caller(caller=None):
caller = caller or getenv("PLATFORMIO_CALLER")
if not caller:
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
caller = "vscode"
elif is_container():
if getenv("C9_UID"):
caller = "C9"
elif getenv("USER") == "cabox":
caller = "CA"
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
caller = "Che"
app.set_session_var("caller_id", caller)
if caller:
return app.set_session_var("caller_id", caller)
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
caller = "vscode"
elif getenv("GITPOD_INSTANCE_ID") or getenv("GITPOD_WORKSPACE_URL"):
caller = "gitpod"
elif is_container():
if getenv("C9_UID"):
caller = "C9"
elif getenv("USER") == "cabox":
caller = "CA"
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
caller = "Che"
return app.set_session_var("caller_id", caller)


class Upgrader(object):
Expand Down
8 changes: 7 additions & 1 deletion platformio/package/manager/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ def _install_dependency(self, dependency, silent=False):
for key, value in dependency.items()
if key in ("authors", "platforms", "frameworks")
}
return self._install(spec, search_filters=search_filters or None, silent=silent)
try:
return self._install(
spec, search_filters=search_filters or None, silent=silent
)
except UnknownPackageError:
pass
return None

def uninstall_dependencies(self, pkg, silent=False):
assert isinstance(pkg, PackageItem)
Expand Down
2 changes: 1 addition & 1 deletion platformio/package/manifest/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ExampleSchema(StrictSchema):
name = fields.Str(
required=True,
validate=[
validate.Length(min=1, max=100),
validate.Length(min=1, max=255),
validate.Regexp(
r"^[a-zA-Z\d\-\_/]+$", error="Only [a-zA-Z0-9-_/] chars are allowed"
),
Expand Down
13 changes: 9 additions & 4 deletions platformio/package/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class PackagePacker(object):
".git/",
".hg/",
".svn/",
]
EXCLUDE_EXTRA = [
# Tests
"tests?",
# Docs
Expand Down Expand Up @@ -120,7 +122,6 @@ def pack(self, dst=None):
src = tmp_dir

src = self.find_source_root(src)

manifest = self.load_manifest(src)
filename = self.get_archive_name(
manifest["name"],
Expand Down Expand Up @@ -188,7 +189,7 @@ def _create_tarball(self, src, dst, manifest):
return dst

def compute_src_filters(self, src, include, exclude):
exclude_default = self.EXCLUDE_DEFAULT[:]
exclude_extra = self.EXCLUDE_EXTRA[:]
# extend with library extra filters
if any(
os.path.isfile(os.path.join(src, name))
Expand All @@ -198,11 +199,15 @@ def compute_src_filters(self, src, include, exclude):
ManifestFileType.MODULE_JSON,
)
):
exclude_default.extend(self.EXCLUDE_LIBRARY_EXTRA)
exclude_extra.extend(self.EXCLUDE_LIBRARY_EXTRA)

result = ["+<%s>" % p for p in include or ["*", ".*"]]
result += ["-<%s>" % p for p in self.EXCLUDE_DEFAULT]
# exclude items declared in manifest
result += ["-<%s>" % p for p in exclude or []]
result += ["-<%s>" % p for p in exclude_default]
# apply extra excludes if no custom "export" field in manifest
if not include and not exclude:
result += ["-<%s>" % p for p in exclude_extra]
# automatically include manifests
result += ["+<%s>" % p for p in self.INCLUDE_DEFAULT]
return result
Loading

0 comments on commit 4b3f2e1

Please sign in to comment.