Skip to content

Commit 1b11771

Browse files
committed
Merge branch 'release/v5.2.4'
2 parents 326c249 + 9dbdf7f commit 1b11771

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+398
-232
lines changed

HISTORY.rst

+15
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ PlatformIO Core 5
88

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

11+
5.2.4 (2021-12-15)
12+
~~~~~~~~~~~~~~~~~~
13+
14+
- 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)
15+
- Improved tab completion support for Bash, ZSH, and Fish shells (`issue #4114 <https://github.com/platformio/platformio-core/issues/4114>`_)
16+
- 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>`_)
17+
- Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 <https://github.com/platformio/platformio-core/issues/3865>`_)
18+
- Upgraded build engine to the SCons 4.3 (`release notes <https://github.com/SCons/scons/blob/rel_4.3.0/CHANGES.txt>`__)
19+
- Fixed an issue with the CLion project generator when a macro contains a space (`issue #4102 <https://github.com/platformio/platformio-core/issues/4102>`_)
20+
- 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>`_)
21+
- 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>`_)
22+
- Fixed an issue when referencing ``*_dir`` option from a custom project configuration environment (`issue #4110 <https://github.com/platformio/platformio-core/issues/4110>`_)
23+
- 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>`_)
24+
- Fixed an issue with wrong detecting Windows architecture when Python 32bit is used (`issue #4134 <https://github.com/platformio/platformio-core/issues/4134>`_)
25+
1126
5.2.3 (2021-11-05)
1227
~~~~~~~~~~~~~~~~~~
1328

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PlatformIO
2-
==========
1+
PlatformIO Core
2+
===============
33

44
.. image:: https://github.com/platformio/platformio-core/workflows/Core/badge.svg
55
:target: https://docs.platformio.org/page/core/index.html

docs

Submodule docs updated 51 files

platformio/__init__.py

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

1515
import sys
1616

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

2020
__title__ = "platformio"
@@ -50,7 +50,7 @@
5050
"contrib-piohome": "~3.4.0",
5151
"contrib-pysite": "~2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
5252
"tool-unity": "~1.20500.0",
53-
"tool-scons": "~4.40200.0",
53+
"tool-scons": "~4.40300.0",
5454
"tool-cppcheck": "~1.260.0",
5555
"tool-clangtidy": "~1.120001.0",
5656
"tool-pvs-studio": "~7.14.0",

platformio/__main__.py

-8
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
from platformio.commands import PlatformioCLI
2525
from platformio.compat import IS_CYGWIN, ensure_python3
2626

27-
try:
28-
import click_completion # pylint: disable=import-error
29-
30-
click_completion.init()
31-
except: # pylint: disable=bare-except
32-
pass
33-
3427

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

77-
7870
except (AttributeError, TypeError): # legacy support for CLick > 8.0.1
7971

8072
@cli.resultcallback()

platformio/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def projects_dir_validate(projects_dir):
3333
assert os.path.isdir(projects_dir)
34-
return os.path.realpath(projects_dir)
34+
return os.path.abspath(projects_dir)
3535

3636

3737
DEFAULT_SETTINGS = {

platformio/builder/main.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@
115115
PROJECT_LIBDEPS_DIR=config.get("platformio", "libdeps_dir"),
116116
PROJECT_INCLUDE_DIR=config.get("platformio", "include_dir"),
117117
PROJECT_SRC_DIR=config.get("platformio", "src_dir"),
118-
PROJECTSRC_DIR=config.get("platformio", "src_dir"), # legacy for dev/platform
118+
PROJECTSRC_DIR="$PROJECT_SRC_DIR", # legacy for dev/platform
119119
PROJECT_TEST_DIR=config.get("platformio", "test_dir"),
120120
PROJECT_DATA_DIR=config.get("platformio", "data_dir"),
121-
PROJECTDATA_DIR=config.get("platformio", "data_dir"), # legacy for dev/platform
121+
PROJECTDATA_DIR="$PROJECT_DATA_DIR", # legacy for dev/platform
122122
PROJECT_BUILD_DIR=config.get("platformio", "build_dir"),
123123
BUILD_CACHE_DIR=config.get("platformio", "build_cache_dir"),
124124
LIBSOURCE_DIRS=[
@@ -128,15 +128,20 @@
128128
],
129129
)
130130

131-
if (
132-
compat.IS_WINDOWS
133-
and sys.version_info >= (3, 8)
134-
and env["PROJECT_DIR"].startswith("\\\\")
135-
):
131+
if int(ARGUMENTS.get("ISATTY", 0)):
132+
# pylint: disable=protected-access
133+
click._compat.isatty = lambda stream: True
134+
135+
if compat.IS_WINDOWS and sys.version_info >= (3, 8) and os.getcwd().startswith("\\\\"):
136+
click.secho("!!! WARNING !!!\t\t" * 3, fg="red")
137+
click.secho(
138+
"Your project is located on a mapped network drive but the "
139+
"current command-line shell does not support the UNC paths.",
140+
fg="yellow",
141+
)
136142
click.secho(
137-
"There is a known issue with Python 3.8+ and mapped network drives on "
138-
"Windows.\nSee a solution at:\n"
139-
"https://github.com/platformio/platformio-core/issues/3417",
143+
"Please move your project to a physical drive or check this workaround: "
144+
"https://bit.ly/3kuU5mP\n",
140145
fg="yellow",
141146
)
142147

@@ -145,10 +150,6 @@
145150
os.makedirs(env.subst("$BUILD_CACHE_DIR"))
146151
env.CacheDir("$BUILD_CACHE_DIR")
147152

148-
if int(ARGUMENTS.get("ISATTY", 0)):
149-
# pylint: disable=protected-access
150-
click._compat.isatty = lambda stream: True
151-
152153
is_clean_all = "cleanall" in COMMAND_LINE_TARGETS
153154
if env.GetOption("clean") or is_clean_all:
154155
env.PioClean(is_clean_all)

platformio/builder/tools/pioide.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ def _dump_includes(env):
3232
env.subst("$PROJECT_SRC_DIR"),
3333
]
3434
includes["build"].extend(
35-
[os.path.realpath(env.subst(item)) for item in env.get("CPPPATH", [])]
35+
[os.path.abspath(env.subst(item)) for item in env.get("CPPPATH", [])]
3636
)
3737

3838
# installed libs
3939
includes["compatlib"] = []
4040
for lb in env.GetLibBuilders():
4141
includes["compatlib"].extend(
42-
[os.path.realpath(inc) for inc in lb.get_include_dirs()]
42+
[os.path.abspath(inc) for inc in lb.get_include_dirs()]
4343
)
4444

4545
# includes from toolchains
@@ -56,9 +56,7 @@ def _dump_includes(env):
5656
os.path.join(toolchain_dir, "*", "include*"),
5757
]
5858
for g in toolchain_incglobs:
59-
includes["toolchain"].extend(
60-
[os.path.realpath(inc) for inc in glob.glob(g)]
61-
)
59+
includes["toolchain"].extend([os.path.abspath(inc) for inc in glob.glob(g)])
6260

6361
# include Unity framework if there are tests in project
6462
includes["unity"] = []
@@ -132,7 +130,7 @@ def _dump_defines(env):
132130
def _get_svd_path(env):
133131
svd_path = env.GetProjectOption("debug_svd_path")
134132
if svd_path:
135-
return os.path.realpath(svd_path)
133+
return os.path.abspath(svd_path)
136134

137135
if "BOARD" not in env:
138136
return None
@@ -147,7 +145,7 @@ def _get_svd_path(env):
147145
# default file from ./platform/misc/svd folder
148146
p = env.PioPlatform()
149147
if os.path.isfile(os.path.join(p.get_dir(), "misc", "svd", svd_path)):
150-
return os.path.realpath(os.path.join(p.get_dir(), "misc", "svd", svd_path))
148+
return os.path.abspath(os.path.join(p.get_dir(), "misc", "svd", svd_path))
151149
return None
152150

153151

platformio/builder/tools/piolib.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class LibBuilderBase(object):
125125
def __init__(self, env, path, manifest=None, verbose=False):
126126
self.env = env.Clone()
127127
self.envorigin = env.Clone()
128-
self.path = os.path.realpath(env.subst(path))
128+
self.path = os.path.abspath(env.subst(path))
129129
self.verbose = verbose
130130

131131
try:
@@ -290,7 +290,7 @@ def process_extra_options(self):
290290
if self.extra_script:
291291
self.env.SConscriptChdir(1)
292292
self.env.SConscript(
293-
os.path.realpath(self.extra_script),
293+
os.path.abspath(self.extra_script),
294294
exports={"env": self.env, "pio_lib_builder": self},
295295
)
296296
self.env.ProcessUnFlags(self.build_unflags)
@@ -750,14 +750,14 @@ def _has_arduino_manifest(self):
750750
def include_dir(self):
751751
if "includeDir" in self._manifest.get("build", {}):
752752
with fs.cd(self.path):
753-
return os.path.realpath(self._manifest.get("build").get("includeDir"))
753+
return os.path.abspath(self._manifest.get("build").get("includeDir"))
754754
return LibBuilderBase.include_dir.fget(self) # pylint: disable=no-member
755755

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

763763
@property
@@ -1024,7 +1024,7 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches
10241024
found_incompat = False
10251025

10261026
for storage_dir in env.GetLibSourceDirs():
1027-
storage_dir = os.path.realpath(storage_dir)
1027+
storage_dir = os.path.abspath(storage_dir)
10281028
if not os.path.isdir(storage_dir):
10291029
continue
10301030
for item in sorted(os.listdir(storage_dir)):

platformio/builder/tools/piomisc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def GetExtraScripts(env, scope):
376376
if not items:
377377
return items
378378
with fs.cd(env.subst("$PROJECT_DIR")):
379-
return [os.path.realpath(item) for item in items]
379+
return [os.path.abspath(item) for item in items]
380380

381381

382382
def exists(_):

platformio/builder/tools/platformio.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
207207
for k in ("CPPPATH", "LIBPATH"):
208208
for i, p in enumerate(result.get(k, [])):
209209
if os.path.isdir(p):
210-
result[k][i] = os.path.realpath(p)
210+
result[k][i] = os.path.abspath(p)
211211

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

217217
return result
218218

platformio/clients/registry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def list_packages(self, query=None, filters=None, page=None):
117117
if page:
118118
params["page"] = int(page)
119119
return self.fetch_json_data(
120-
"get", "/v3/packages", params=params, cache_valid="1h"
120+
"get", "/v3/search", params=params, cache_valid="1h"
121121
)
122122

123123
def get_package(self, type_, owner, name, version=None):

platformio/commands/check/defect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def as_dict(self):
8686
"severity": self.SEVERITY_LABELS[self.severity],
8787
"category": self.category,
8888
"message": self.message,
89-
"file": os.path.realpath(self.file),
89+
"file": os.path.abspath(self.file),
9090
"line": self.line,
9191
"column": self.column,
9292
"callstack": self.callstack,

platformio/commands/check/tools/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ def get_project_target_files(patterns):
201201

202202
def _add_file(path):
203203
if path.endswith(header_extensions):
204-
result["headers"].append(os.path.realpath(path))
204+
result["headers"].append(os.path.abspath(path))
205205
elif path.endswith(c_extension):
206-
result["c"].append(os.path.realpath(path))
206+
result["c"].append(os.path.abspath(path))
207207
elif path.endswith(cpp_extensions):
208-
result["c++"].append(os.path.realpath(path))
208+
result["c++"].append(os.path.abspath(path))
209209

210210
for pattern in patterns:
211211
for item in glob.glob(pattern, recursive=True):

platformio/commands/ci.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
3333
for i, p in enumerate(value):
3434
if p.startswith("~"):
3535
value[i] = fs.expanduser(p)
36-
value[i] = os.path.realpath(value[i])
36+
value[i] = os.path.abspath(value[i])
3737
if not glob.glob(value[i], recursive=True):
3838
invalid_path = p
3939
break
@@ -162,7 +162,7 @@ def _exclude_contents(dst_dir, patterns):
162162
for p in patterns:
163163
contents += glob.glob(os.path.join(glob.escape(dst_dir), p), recursive=True)
164164
for path in contents:
165-
path = os.path.realpath(path)
165+
path = os.path.abspath(path)
166166
if os.path.isdir(path):
167167
fs.rmtree(path)
168168
elif os.path.isfile(path):

platformio/commands/home/rpc/handlers/project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _get_project_data():
9393
# skip non existing folders and resolve full path
9494
for key in ("envLibdepsDirs", "libExtraDirs"):
9595
data[key] = [
96-
fs.expanduser(d) if d.startswith("~") else os.path.realpath(d)
96+
fs.expanduser(d) if d.startswith("~") else os.path.abspath(d)
9797
for d in data[key]
9898
if os.path.isdir(d)
9999
]

platformio/commands/home/rpc/server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ async def on_disconnect(self, websocket, close_code):
9292
async def _handle_rpc(self, websocket, data):
9393
# pylint: disable=no-member
9494
response = await self.factory.manager.get_response_for_payload(data)
95-
if response.error:
95+
if response.error and response.error.data:
9696
click.secho("Error: %s" % response.error.data, fg="red", err=True)
9797
await websocket.send_text(self.factory.manager.serialize(response.body))

platformio/commands/remote/command.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@click.pass_context
3838
def cli(ctx, agent):
3939
ctx.obj = agent
40-
inject_contrib_pysite(verify_openssl=True)
40+
inject_contrib_pysite()
4141

4242

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

0 commit comments

Comments
 (0)