Skip to content

Commit

Permalink
Merge branch 'release/v5.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 15, 2021
2 parents 326c249 + 9dbdf7f commit 1b11771
Show file tree
Hide file tree
Showing 41 changed files with 398 additions and 232 deletions.
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ PlatformIO Core 5

**A professional collaborative platform for embedded development**

5.2.4 (2021-12-15)
~~~~~~~~~~~~~~~~~~

- Added support for a new ``headers`` field in `library.json <https://docs.platformio.org/en/latest/librarymanager/config.html>`__ (declare a list of header files that can be included in a project source files using ``#include <...>`` directive)
- Improved tab completion support for Bash, ZSH, and Fish shells (`issue #4114 <https://github.com/platformio/platformio-core/issues/4114>`_)
- Improved support for projects located on a network share (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_, `issue #3926 <https://github.com/platformio/platformio-core/issues/3926>`_, `issue #4099 <https://github.com/platformio/platformio-core/issues/4099>`_)
- Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 <https://github.com/platformio/platformio-core/issues/3865>`_)
- Upgraded build engine to the SCons 4.3 (`release notes <https://github.com/SCons/scons/blob/rel_4.3.0/CHANGES.txt>`__)
- Fixed an issue with the CLion project generator when a macro contains a space (`issue #4102 <https://github.com/platformio/platformio-core/issues/4102>`_)
- Fixed an issue with the NetBeans project generator when the path to PlatformIO contains a space (`issue #4096 <https://github.com/platformio/platformio-core/issues/4096>`_)
- Fixed an issue when the system environment variable does not override a project configuration option (`issue #4125 <https://github.com/platformio/platformio-core/issues/4125>`_)
- Fixed an issue when referencing ``*_dir`` option from a custom project configuration environment (`issue #4110 <https://github.com/platformio/platformio-core/issues/4110>`_)
- Fixed an issue with the CLion template that generated a broken CMake file if user's home directory contained an unescaped backslash (`issue #4071 <https://github.com/platformio/platformio-core/issues/4071>`_)
- Fixed an issue with wrong detecting Windows architecture when Python 32bit is used (`issue #4134 <https://github.com/platformio/platformio-core/issues/4134>`_)

5.2.3 (2021-11-05)
~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PlatformIO
==========
PlatformIO Core
===============

.. image:: https://github.com/platformio/platformio-core/workflows/Core/badge.svg
:target: https://docs.platformio.org/page/core/index.html
Expand Down
2 changes: 1 addition & 1 deletion docs
Submodule docs updated 51 files
+0 −68 _static/css/extra.css
+1 −0 _templates/footer.html
+0 −207 articles.rst
+1 −1 boards/atmelavr/controllino_maxi.rst
+1 −1 boards/atmelavr/controllino_maxi_automation.rst
+1 −1 boards/atmelavr/controllino_mega.rst
+1 −1 boards/atmelavr/controllino_mini.rst
+1 −4 boards/chipsalliance/swervolf_nexys.rst
+1 −1 boards/espressif8266/wifi_slot.rst
+1 −1 boards/index.rst
+2 −2 boards/ststm32/disco_h735ig.rst
+2 −2 boards/ststm32/olimexino_stm32f3.rst
+2 −2 boards/ststm32/prntr_v2.rst
+2 −2 boards/ststm32/st3dp001_eval.rst
+3 −3 boards/ststm32/vccgnd_f407zg_mini.rst
+9 −9 boards/titiva/lptm4c123gh6pm.rst
+1 −1 core/index.rst
+12 −0 core/userguide/cmd_check.rst
+0 −3 core/userguide/lib/cmd_search.rst
+6 −14 core/userguide/system/completion/cmd_install.rst
+6 −13 core/userguide/system/completion/cmd_uninstall.rst
+14 −14 frameworks/arduino.rst
+10 −10 frameworks/cmsis.rst
+12 −12 frameworks/libopencm3.rst
+12 −12 frameworks/stm32cube.rst
+7 −7 frameworks/stm32cube_extra.rst
+2 −33 frameworks/zephyr.rst
+0 −1 index.rst
+0 −2 integration/ide/atom.rst
+0 −2 integration/ide/eclipse.rst
+0 −2 integration/ide/netbeans.rst
+0 −2 integration/ide/vim.rst
+109 −93 librarymanager/config.rst
+0 −73 platforms/chipsalliance.rst
+9 −0 platforms/espressif32.rst
+31 −12 platforms/espressif32_extra.rst
+34 −14 platforms/espressif8266_extra.rst
+1 −1 platforms/gd32v.rst
+12 −12 platforms/ststm32.rst
+4 −4 platforms/titiva.rst
+6 −6 plus/debug-tools/blackmagic.rst
+5 −5 plus/debug-tools/cmsis-dap.rst
+0 −3 plus/debug-tools/digilent-hs1.rst
+6 −6 plus/debug-tools/jlink.rst
+6 −6 plus/debug-tools/stlink.rst
+2 −2 plus/debug-tools/ti-icdi.rst
+0 −3 plus/debug-tools/verilator.rst
+0 −3 plus/debug-tools/whisper.rst
+8 −8 plus/debugging.rst
+3 −3 projectconf/index.rst
+28 −0 projectconf/section_env_check.rst
4 changes: 2 additions & 2 deletions platformio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import sys

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

__title__ = "platformio"
Expand Down Expand Up @@ -50,7 +50,7 @@
"contrib-piohome": "~3.4.0",
"contrib-pysite": "~2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
"tool-unity": "~1.20500.0",
"tool-scons": "~4.40200.0",
"tool-scons": "~4.40300.0",
"tool-cppcheck": "~1.260.0",
"tool-clangtidy": "~1.120001.0",
"tool-pvs-studio": "~7.14.0",
Expand Down
8 changes: 0 additions & 8 deletions platformio/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
from platformio.commands import PlatformioCLI
from platformio.compat import IS_CYGWIN, ensure_python3

try:
import click_completion # pylint: disable=import-error

click_completion.init()
except: # pylint: disable=bare-except
pass


@click.command(
cls=PlatformioCLI, context_settings=dict(help_option_names=["-h", "--help"])
Expand Down Expand Up @@ -74,7 +67,6 @@ def cli(ctx, force, caller, no_ansi):
def process_result(ctx, result, *_, **__):
_process_result(ctx, result)


except (AttributeError, TypeError): # legacy support for CLick > 8.0.1

@cli.resultcallback()
Expand Down
2 changes: 1 addition & 1 deletion platformio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def projects_dir_validate(projects_dir):
assert os.path.isdir(projects_dir)
return os.path.realpath(projects_dir)
return os.path.abspath(projects_dir)


DEFAULT_SETTINGS = {
Expand Down
29 changes: 15 additions & 14 deletions platformio/builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@
PROJECT_LIBDEPS_DIR=config.get("platformio", "libdeps_dir"),
PROJECT_INCLUDE_DIR=config.get("platformio", "include_dir"),
PROJECT_SRC_DIR=config.get("platformio", "src_dir"),
PROJECTSRC_DIR=config.get("platformio", "src_dir"), # legacy for dev/platform
PROJECTSRC_DIR="$PROJECT_SRC_DIR", # legacy for dev/platform
PROJECT_TEST_DIR=config.get("platformio", "test_dir"),
PROJECT_DATA_DIR=config.get("platformio", "data_dir"),
PROJECTDATA_DIR=config.get("platformio", "data_dir"), # legacy for dev/platform
PROJECTDATA_DIR="$PROJECT_DATA_DIR", # legacy for dev/platform
PROJECT_BUILD_DIR=config.get("platformio", "build_dir"),
BUILD_CACHE_DIR=config.get("platformio", "build_cache_dir"),
LIBSOURCE_DIRS=[
Expand All @@ -128,15 +128,20 @@
],
)

if (
compat.IS_WINDOWS
and sys.version_info >= (3, 8)
and env["PROJECT_DIR"].startswith("\\\\")
):
if int(ARGUMENTS.get("ISATTY", 0)):
# pylint: disable=protected-access
click._compat.isatty = lambda stream: True

if compat.IS_WINDOWS and sys.version_info >= (3, 8) and os.getcwd().startswith("\\\\"):
click.secho("!!! WARNING !!!\t\t" * 3, fg="red")
click.secho(
"Your project is located on a mapped network drive but the "
"current command-line shell does not support the UNC paths.",
fg="yellow",
)
click.secho(
"There is a known issue with Python 3.8+ and mapped network drives on "
"Windows.\nSee a solution at:\n"
"https://github.com/platformio/platformio-core/issues/3417",
"Please move your project to a physical drive or check this workaround: "
"https://bit.ly/3kuU5mP\n",
fg="yellow",
)

Expand All @@ -145,10 +150,6 @@
os.makedirs(env.subst("$BUILD_CACHE_DIR"))
env.CacheDir("$BUILD_CACHE_DIR")

if int(ARGUMENTS.get("ISATTY", 0)):
# pylint: disable=protected-access
click._compat.isatty = lambda stream: True

is_clean_all = "cleanall" in COMMAND_LINE_TARGETS
if env.GetOption("clean") or is_clean_all:
env.PioClean(is_clean_all)
Expand Down
12 changes: 5 additions & 7 deletions platformio/builder/tools/pioide.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def _dump_includes(env):
env.subst("$PROJECT_SRC_DIR"),
]
includes["build"].extend(
[os.path.realpath(env.subst(item)) for item in env.get("CPPPATH", [])]
[os.path.abspath(env.subst(item)) for item in env.get("CPPPATH", [])]
)

# installed libs
includes["compatlib"] = []
for lb in env.GetLibBuilders():
includes["compatlib"].extend(
[os.path.realpath(inc) for inc in lb.get_include_dirs()]
[os.path.abspath(inc) for inc in lb.get_include_dirs()]
)

# includes from toolchains
Expand All @@ -56,9 +56,7 @@ def _dump_includes(env):
os.path.join(toolchain_dir, "*", "include*"),
]
for g in toolchain_incglobs:
includes["toolchain"].extend(
[os.path.realpath(inc) for inc in glob.glob(g)]
)
includes["toolchain"].extend([os.path.abspath(inc) for inc in glob.glob(g)])

# include Unity framework if there are tests in project
includes["unity"] = []
Expand Down Expand Up @@ -132,7 +130,7 @@ def _dump_defines(env):
def _get_svd_path(env):
svd_path = env.GetProjectOption("debug_svd_path")
if svd_path:
return os.path.realpath(svd_path)
return os.path.abspath(svd_path)

if "BOARD" not in env:
return None
Expand All @@ -147,7 +145,7 @@ def _get_svd_path(env):
# default file from ./platform/misc/svd folder
p = env.PioPlatform()
if os.path.isfile(os.path.join(p.get_dir(), "misc", "svd", svd_path)):
return os.path.realpath(os.path.join(p.get_dir(), "misc", "svd", svd_path))
return os.path.abspath(os.path.join(p.get_dir(), "misc", "svd", svd_path))
return None


Expand Down
10 changes: 5 additions & 5 deletions platformio/builder/tools/piolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class LibBuilderBase(object):
def __init__(self, env, path, manifest=None, verbose=False):
self.env = env.Clone()
self.envorigin = env.Clone()
self.path = os.path.realpath(env.subst(path))
self.path = os.path.abspath(env.subst(path))
self.verbose = verbose

try:
Expand Down Expand Up @@ -290,7 +290,7 @@ def process_extra_options(self):
if self.extra_script:
self.env.SConscriptChdir(1)
self.env.SConscript(
os.path.realpath(self.extra_script),
os.path.abspath(self.extra_script),
exports={"env": self.env, "pio_lib_builder": self},
)
self.env.ProcessUnFlags(self.build_unflags)
Expand Down Expand Up @@ -750,14 +750,14 @@ def _has_arduino_manifest(self):
def include_dir(self):
if "includeDir" in self._manifest.get("build", {}):
with fs.cd(self.path):
return os.path.realpath(self._manifest.get("build").get("includeDir"))
return os.path.abspath(self._manifest.get("build").get("includeDir"))
return LibBuilderBase.include_dir.fget(self) # pylint: disable=no-member

@property
def src_dir(self):
if "srcDir" in self._manifest.get("build", {}):
with fs.cd(self.path):
return os.path.realpath(self._manifest.get("build").get("srcDir"))
return os.path.abspath(self._manifest.get("build").get("srcDir"))
return LibBuilderBase.src_dir.fget(self) # pylint: disable=no-member

@property
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches
found_incompat = False

for storage_dir in env.GetLibSourceDirs():
storage_dir = os.path.realpath(storage_dir)
storage_dir = os.path.abspath(storage_dir)
if not os.path.isdir(storage_dir):
continue
for item in sorted(os.listdir(storage_dir)):
Expand Down
2 changes: 1 addition & 1 deletion platformio/builder/tools/piomisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def GetExtraScripts(env, scope):
if not items:
return items
with fs.cd(env.subst("$PROJECT_DIR")):
return [os.path.realpath(item) for item in items]
return [os.path.abspath(item) for item in items]


def exists(_):
Expand Down
4 changes: 2 additions & 2 deletions platformio/builder/tools/platformio.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
for k in ("CPPPATH", "LIBPATH"):
for i, p in enumerate(result.get(k, [])):
if os.path.isdir(p):
result[k][i] = os.path.realpath(p)
result[k][i] = os.path.abspath(p)

# fix relative path for "-include"
for i, f in enumerate(result.get("CCFLAGS", [])):
if isinstance(f, tuple) and f[0] == "-include":
result["CCFLAGS"][i] = (f[0], env.File(os.path.realpath(f[1].get_path())))
result["CCFLAGS"][i] = (f[0], env.File(os.path.abspath(f[1].get_path())))

return result

Expand Down
2 changes: 1 addition & 1 deletion platformio/clients/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def list_packages(self, query=None, filters=None, page=None):
if page:
params["page"] = int(page)
return self.fetch_json_data(
"get", "/v3/packages", params=params, cache_valid="1h"
"get", "/v3/search", params=params, cache_valid="1h"
)

def get_package(self, type_, owner, name, version=None):
Expand Down
2 changes: 1 addition & 1 deletion platformio/commands/check/defect.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def as_dict(self):
"severity": self.SEVERITY_LABELS[self.severity],
"category": self.category,
"message": self.message,
"file": os.path.realpath(self.file),
"file": os.path.abspath(self.file),
"line": self.line,
"column": self.column,
"callstack": self.callstack,
Expand Down
6 changes: 3 additions & 3 deletions platformio/commands/check/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ def get_project_target_files(patterns):

def _add_file(path):
if path.endswith(header_extensions):
result["headers"].append(os.path.realpath(path))
result["headers"].append(os.path.abspath(path))
elif path.endswith(c_extension):
result["c"].append(os.path.realpath(path))
result["c"].append(os.path.abspath(path))
elif path.endswith(cpp_extensions):
result["c++"].append(os.path.realpath(path))
result["c++"].append(os.path.abspath(path))

for pattern in patterns:
for item in glob.glob(pattern, recursive=True):
Expand Down
4 changes: 2 additions & 2 deletions platformio/commands/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
for i, p in enumerate(value):
if p.startswith("~"):
value[i] = fs.expanduser(p)
value[i] = os.path.realpath(value[i])
value[i] = os.path.abspath(value[i])
if not glob.glob(value[i], recursive=True):
invalid_path = p
break
Expand Down Expand Up @@ -162,7 +162,7 @@ def _exclude_contents(dst_dir, patterns):
for p in patterns:
contents += glob.glob(os.path.join(glob.escape(dst_dir), p), recursive=True)
for path in contents:
path = os.path.realpath(path)
path = os.path.abspath(path)
if os.path.isdir(path):
fs.rmtree(path)
elif os.path.isfile(path):
Expand Down
2 changes: 1 addition & 1 deletion platformio/commands/home/rpc/handlers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _get_project_data():
# skip non existing folders and resolve full path
for key in ("envLibdepsDirs", "libExtraDirs"):
data[key] = [
fs.expanduser(d) if d.startswith("~") else os.path.realpath(d)
fs.expanduser(d) if d.startswith("~") else os.path.abspath(d)
for d in data[key]
if os.path.isdir(d)
]
Expand Down
2 changes: 1 addition & 1 deletion platformio/commands/home/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ async def on_disconnect(self, websocket, close_code):
async def _handle_rpc(self, websocket, data):
# pylint: disable=no-member
response = await self.factory.manager.get_response_for_payload(data)
if response.error:
if response.error and response.error.data:
click.secho("Error: %s" % response.error.data, fg="red", err=True)
await websocket.send_text(self.factory.manager.serialize(response.body))
2 changes: 1 addition & 1 deletion platformio/commands/remote/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@click.pass_context
def cli(ctx, agent):
ctx.obj = agent
inject_contrib_pysite(verify_openssl=True)
inject_contrib_pysite()


@cli.group("agent", short_help="Start a new agent or list active")
Expand Down
Loading

0 comments on commit 1b11771

Please sign in to comment.