From b537004a75f4985630b5aec19699e48d4d186746 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 26 Sep 2024 13:40:24 +0300 Subject: [PATCH 01/36] Bump version to 6.1.17a1 --- platformio/__init__.py | 2 +- platformio/dependencies.py | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index ff315caf..0e4bb5a5 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, 16) +VERSION = (6, 1, "17a1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/dependencies.py b/platformio/dependencies.py index 331c1bdb..0a81f868 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import platform - from platformio.compat import is_proxy_set @@ -52,12 +50,10 @@ def get_pip_dependencies(): ] extra = [] - # issue #4702; Broken "requests/charset_normalizer" on macOS ARM - if platform.system() == "Darwin" and "arm" in platform.machine().lower(): - extra.append( - 'chardet >= 3.0.2,<6; platform_system == "Darwin" and "arm" in platform_machine' - ) + extra.append( + 'chardet >= 3.0.2,<6; platform_system == "Darwin" and "arm" in platform_machine' + ) # issue 4614: urllib3 v2.0 only supports OpenSSL 1.1.1+ try: From 647b131d9b417b7f117cf73f962c8ac325470ef8 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Oct 2024 12:22:54 +0300 Subject: [PATCH 02/36] Sync docs --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index dd3d549b..53a19d3c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit dd3d549bdbfac9a30eadeb32e37cbd6f6c6591f7 +Subproject commit 53a19d3c6fa5dd4212f9a3d773b46cbb41125ac7 From 33fadd028daca378eea54264b9971dbb262d3f34 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 13 Oct 2024 11:54:21 +0300 Subject: [PATCH 03/36] Sync docs --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 53a19d3c..badc12a5 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 53a19d3c6fa5dd4212f9a3d773b46cbb41125ac7 +Subproject commit badc12a5d835ee9740fa09db0af0b2bba5d00124 From 3a576612306f12fcdfa951f37aea23353a80303c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 13 Oct 2024 21:46:22 +0300 Subject: [PATCH 04/36] Switch to the stable Python 3.13 for CI --- .github/workflows/core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 29a6ae16..2f841588 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.11", "3.12", "3.13.0-rc.2"] + python-version: ["3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} From cade63fba570ffb7381f5e24350fddd41c64c0f4 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Tue, 15 Oct 2024 15:41:10 -0400 Subject: [PATCH 05/36] Allow Starlette 0.40.x (#5000) This release of Starlette contains a fix for a security bug: - GHSA-f96h-pmfr-66vw: https://github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw - CVE-2024-47874: https://nvd.nist.gov/vuln/detail/CVE-2024-47874 --- platformio/dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/dependencies.py b/platformio/dependencies.py index 0a81f868..e3584533 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -43,7 +43,7 @@ def get_pip_dependencies(): home = [ # PIO Home requirements "ajsonrpc == 1.2.*", - "starlette >=0.19, <0.40", + "starlette >=0.19, <0.41", 'uvicorn == 0.16.0; python_version < "3.7"', 'uvicorn >=0.16, <0.31; python_version >= "3.7"', "wsproto == 1.*", From a4276b4ea63e8701cfa9c05d820d5dfe61c17409 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 Oct 2024 22:43:13 +0300 Subject: [PATCH 06/36] Update dependencies.py --- platformio/dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/dependencies.py b/platformio/dependencies.py index e3584533..d946b91c 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -43,7 +43,7 @@ def get_pip_dependencies(): home = [ # PIO Home requirements "ajsonrpc == 1.2.*", - "starlette >=0.19, <0.41", + "starlette >=0.19, <0.42", 'uvicorn == 0.16.0; python_version < "3.7"', 'uvicorn >=0.16, <0.31; python_version >= "3.7"', "wsproto == 1.*", From 3e20abec908fb383ffd91e7e37cb5a855a7e376c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Oct 2024 11:10:58 +0300 Subject: [PATCH 07/36] Disable temporary "test_custom_testing_command" --- tests/commands/test_test.py | 110 ++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/tests/commands/test_test.py b/tests/commands/test_test.py index 29ff20ab..49715ea2 100644 --- a/tests/commands/test_test.py +++ b/tests/commands/test_test.py @@ -246,67 +246,67 @@ int main(int argc, char *argv[]) { ) -@pytest.mark.skipif( - sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)" -) -def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path): - project_dir = tmp_path / "project" - project_dir.mkdir() - (project_dir / "platformio.ini").write_text( - """ -[env:uno] -platform = atmelavr -framework = arduino -board = uno +# @pytest.mark.skipif( +# sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)" +# ) +# def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path): +# project_dir = tmp_path / "project" +# project_dir.mkdir() +# (project_dir / "platformio.ini").write_text( +# """ +# [env:uno] +# platform = atmelavr +# framework = arduino +# board = uno -platform_packages = - platformio/tool-simavr @ ^1 -test_speed = 9600 -test_testing_command = - ${platformio.packages_dir}/tool-simavr/bin/simavr - -m - atmega328p - -f - 16000000L - ${platformio.build_dir}/${this.__env__}/firmware.elf -""" - ) - test_dir = project_dir / "test" / "test_dummy" - test_dir.mkdir(parents=True) - (test_dir / "test_main.cpp").write_text( - """ -#include -#include +# platform_packages = +# platformio/tool-simavr @ ^1 +# test_speed = 9600 +# test_testing_command = +# ${platformio.packages_dir}/tool-simavr/bin/simavr +# -m +# atmega328p +# -f +# 16000000L +# ${platformio.build_dir}/${this.__env__}/firmware.elf +# """ +# ) +# test_dir = project_dir / "test" / "test_dummy" +# test_dir.mkdir(parents=True) +# (test_dir / "test_main.cpp").write_text( +# """ +# #include +# #include -void setUp(void) { - // set stuff up here -} +# void setUp(void) { +# // set stuff up here +# } -void tearDown(void) { - // clean stuff up here -} +# void tearDown(void) { +# // clean stuff up here +# } -void dummy_test(void) { - TEST_ASSERT_EQUAL(1, 1); -} +# void dummy_test(void) { +# TEST_ASSERT_EQUAL(1, 1); +# } -void setup() { - UNITY_BEGIN(); - RUN_TEST(dummy_test); - UNITY_END(); -} +# void setup() { +# UNITY_BEGIN(); +# RUN_TEST(dummy_test); +# UNITY_END(); +# } -void loop() { - delay(1000); -} -""" - ) - result = clirunner.invoke( - pio_test_cmd, - ["-d", str(project_dir), "--without-uploading"], - ) - validate_cliresult(result) - assert "dummy_test" in result.output +# void loop() { +# delay(1000); +# } +# """ +# ) +# result = clirunner.invoke( +# pio_test_cmd, +# ["-d", str(project_dir), "--without-uploading"], +# ) +# validate_cliresult(result) +# assert "dummy_test" in result.output def test_unity_setup_teardown(clirunner, validate_cliresult, tmpdir): From f5ab0e5ddd7568de06f7df7f616e4c2f04abb02d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Oct 2024 12:32:52 +0300 Subject: [PATCH 08/36] Resolve an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces // Resolve #4998 --- HISTORY.rst | 5 ++++ platformio/builder/main.py | 6 ++-- platformio/builder/tools/piobuild.py | 42 ++++++++++++++-------------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index dcfc498a..df159f44 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,11 @@ Unlock the true potential of embedded software development with PlatformIO's collaborative ecosystem, embracing declarative principles, test-driven methodologies, and modern toolchains for unrivaled success. +6.1.17 (2024-??-??) +~~~~~~~~~~~~~~~~~~~ + +* Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) + 6.1.16 (2024-09-26) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/main.py b/platformio/builder/main.py index ea8b202b..880ca155 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -147,13 +147,13 @@ if env.subst("$BUILD_CACHE_DIR"): if not int(ARGUMENTS.get("PIOVERBOSE", 0)): click.echo("Verbose mode can be enabled via `-v, --verbose` option") +if not os.path.isdir(env.subst("$BUILD_DIR")): + os.makedirs(env.subst("$BUILD_DIR")) + # Dynamically load dependent tools if "compiledb" in COMMAND_LINE_TARGETS: env.Tool("compilation_db") -if not os.path.isdir(env.subst("$BUILD_DIR")): - os.makedirs(env.subst("$BUILD_DIR")) - env.LoadProjectOptions() env.LoadPioPlatform() diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index b3d650a5..840c6f90 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -58,6 +58,7 @@ def GetBuildType(env): def BuildProgram(env): + env.ProcessCompileDbToolchainOption() env.ProcessProgramDeps() env.ProcessProjectDeps() @@ -90,6 +91,26 @@ def BuildProgram(env): return program +def ProcessCompileDbToolchainOption(env): + if "compiledb" not in COMMAND_LINE_TARGETS: + return + # Resolve absolute path of toolchain + for cmd in ("CC", "CXX", "AS"): + if cmd not in env: + continue + if os.path.isabs(env[cmd]) or '"' in env[cmd]: + continue + env[cmd] = where_is_program(env.subst("$%s" % cmd), env.subst("${ENV['PATH']}")) + if " " in env[cmd]: # issue #4998: Space in compilator path + env[cmd] = f'"{env[cmd]}"' + + if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"): + print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping") + for scope, includes in env.DumpIntegrationIncludes().items(): + if scope in ("toolchain",): + env.Append(CPPPATH=includes) + + def ProcessProgramDeps(env): def _append_pio_macros(): core_version = pepver_to_semver(__version__) @@ -126,27 +147,6 @@ def ProcessProgramDeps(env): # remove specified flags env.ProcessUnFlags(env.get("BUILD_UNFLAGS")) - env.ProcessCompileDbToolchainOption() - - -def ProcessCompileDbToolchainOption(env): - if "compiledb" in COMMAND_LINE_TARGETS: - # Resolve absolute path of toolchain - for cmd in ("CC", "CXX", "AS"): - if cmd not in env: - continue - if os.path.isabs(env[cmd]): - continue - env[cmd] = where_is_program( - env.subst("$%s" % cmd), env.subst("${ENV['PATH']}") - ) - - if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"): - print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping") - for scope, includes in env.DumpIntegrationIncludes().items(): - if scope in ("toolchain",): - env.Append(CPPPATH=includes) - def ProcessProjectDeps(env): plb = env.ConfigureProjectLibBuilder() From a94e5bd5ab0c87e8f514da6593852cc62a7ba30c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Oct 2024 12:33:15 +0300 Subject: [PATCH 09/36] Bump version to 6.1.17a2 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 0e4bb5a5..85c5a899 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, "17a1") +VERSION = (6, 1, "17a2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 07e7dc47174679fdc6402e899df450a154fd242d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 2 Dec 2024 20:38:05 +0200 Subject: [PATCH 10/36] Update deps --- platformio/dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/dependencies.py b/platformio/dependencies.py index d946b91c..90fe16d4 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -45,7 +45,7 @@ def get_pip_dependencies(): "ajsonrpc == 1.2.*", "starlette >=0.19, <0.42", 'uvicorn == 0.16.0; python_version < "3.7"', - 'uvicorn >=0.16, <0.31; python_version >= "3.7"', + 'uvicorn >=0.16, <0.33; python_version >= "3.7"', "wsproto == 1.*", ] From fe2fd5e880151c02061d800c26d35ccc135281e9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 2 Dec 2024 21:32:10 +0200 Subject: [PATCH 11/36] Sync docs --- docs | 2 +- examples | 2 +- tests/commands/pkg/test_install.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs b/docs index badc12a5..2502cca2 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit badc12a5d835ee9740fa09db0af0b2bba5d00124 +Subproject commit 2502cca21a23dbb2b74f9a5ff5ff80f94d62b2f1 diff --git a/examples b/examples index 2585734b..4953bbab 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 2585734bbf4aaef813079900072aa50bda9a04b9 +Subproject commit 4953bbabae6cccecbd5a4852519f2f91816c9f77 diff --git a/tests/commands/pkg/test_install.py b/tests/commands/pkg/test_install.py index 0b837993..f0033fee 100644 --- a/tests/commands/pkg/test_install.py +++ b/tests/commands/pkg/test_install.py @@ -446,7 +446,7 @@ def test_custom_project_libraries( ) assert pkgs_to_specs(lm.get_installed()) == [ PackageSpec("ArduinoJson@5.13.4"), - PackageSpec("Nanopb@0.4.9"), + PackageSpec("Nanopb@0.4.91"), ] assert config.get("env:devkit", "lib_deps") == [ "bblanchon/ArduinoJson@^5", From f3c27eadf680336b2a97ff1390d4a98429433d13 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 2 Dec 2024 21:32:44 +0200 Subject: [PATCH 12/36] Switch to named argument (PY 3.13+) --- platformio/package/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/package/version.py b/platformio/package/version.py index 909d83e1..6e06b6e0 100644 --- a/platformio/package/version.py +++ b/platformio/package/version.py @@ -44,7 +44,7 @@ def cast_version_to_semver(value, force=True, raise_exception=False): def pepver_to_semver(pepver): return cast_version_to_semver( - re.sub(r"(\.\d+)\.?(dev|a|b|rc|post)", r"\1-\2.", pepver, 1) + re.sub(r"(\.\d+)\.?(dev|a|b|rc|post)", r"\1-\2.", pepver, count=1) ) From c1afb364e9039fac2838bd000227b0a1871a07a6 Mon Sep 17 00:00:00 2001 From: Maximilian Gerhardt Date: Mon, 9 Dec 2024 19:07:27 +0100 Subject: [PATCH 13/36] Allow HTTP 203 as successful response (#5043) Fixes downloading library dependencies from Azure Devops repositories. --- platformio/package/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/package/download.py b/platformio/package/download.py index 17cc1f30..d8ad5648 100644 --- a/platformio/package/download.py +++ b/platformio/package/download.py @@ -34,7 +34,7 @@ class FileDownloader: url, stream=True, ) - if self._http_response.status_code != 200: + if self._http_response.status_code not in (200, 203): raise PackageException( "Got the unrecognized status code '{0}' when downloaded {1}".format( self._http_response.status_code, url From dd3fe909a1e4c020e5657f78cda0b4a7ebb42aed Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 16:32:43 +0200 Subject: [PATCH 14/36] Better handling of the missed args for exec command // Resolve #5047 --- platformio/package/commands/exec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/package/commands/exec.py b/platformio/package/commands/exec.py index 41386d5e..849a9320 100644 --- a/platformio/package/commands/exec.py +++ b/platformio/package/commands/exec.py @@ -54,7 +54,7 @@ def package_exec_cmd(obj, package, call, args): os.environ["PIO_PYTHON_EXE"] = get_pythonexe_path() # inject current python interpreter on Windows - if args[0].endswith(".py"): + if args and args[0].endswith(".py"): args = [os.environ["PIO_PYTHON_EXE"]] + list(args) if not os.path.exists(args[1]): args[1] = where_is_program(args[1]) From 014ac79c87896e7b97376121aeed2b6dfd1cdf33 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 19:46:11 +0200 Subject: [PATCH 15/36] Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags` // Resolve #5004 --- HISTORY.rst | 1 + platformio/builder/tools/piobuild.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index df159f44..5163a245 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. ~~~~~~~~~~~~~~~~~~~ * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) +* Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags `__ option (`issue #5004 `_) 6.1.16 (2024-09-26) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index 840c6f90..e1a310bd 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -219,6 +219,11 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches if os.path.isdir(p): result[k][i] = os.path.abspath(p) + # fix relative LIBs + for i, l in enumerate(result.get("LIBS", [])): + if isinstance(l, FS.File): + result["LIBS"][i] = os.path.abspath(l.get_path()) + # fix relative path for "-include" for i, f in enumerate(result.get("CCFLAGS", [])): if isinstance(f, tuple) and f[0] == "-include": From 1fd3a4061fd8409812003d73f1947d3e2ba3f020 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:47:23 +0100 Subject: [PATCH 16/36] add support for `tar.xz` tarballs (#4974) * tar.xz * add magic bytes for `tar.xz` --- platformio/package/meta.py | 2 +- platformio/package/unpack.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/package/meta.py b/platformio/package/meta.py index d7fdfdfa..e4398cff 100644 --- a/platformio/package/meta.py +++ b/platformio/package/meta.py @@ -396,7 +396,7 @@ class PackageSpec: # pylint: disable=too-many-instance-attributes parts.path.endswith(".git"), # Handle GitHub URL (https://github.com/user/package) parts.netloc in ("github.com", "gitlab.com", "bitbucket.com") - and not parts.path.endswith((".zip", ".tar.gz")), + and not parts.path.endswith((".zip", ".tar.gz", ".tar.xz")), ] hg_conditions = [ # Handle Developer Mbed URL diff --git a/platformio/package/unpack.py b/platformio/package/unpack.py index f819fd2f..ea140ae9 100644 --- a/platformio/package/unpack.py +++ b/platformio/package/unpack.py @@ -152,6 +152,7 @@ class FileUnpacker: magic_map = { b"\x1f\x8b\x08": TARArchiver, b"\x42\x5a\x68": TARArchiver, + b"\xfd\x37\x7a\x58\x5a\x00": TARArchiver, b"\x50\x4b\x03\x04": ZIPArchiver, } magic_len = max(len(k) for k in magic_map) From 4e05309e02c646414ded65cfd44a0edf1b3f25a1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 19:49:47 +0200 Subject: [PATCH 17/36] Added support for ``tar.xz`` tarball dependencies // Issue #4974 --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index 5163a245..f62db6cd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -21,6 +21,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. 6.1.17 (2024-??-??) ~~~~~~~~~~~~~~~~~~~ +* Added support for ``tar.xz`` tarball dependencies (`pull #4974 `_) * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) * Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags `__ option (`issue #5004 `_) From ec2d01f277e38bb5bf2d5badde2d103f5abda0ac Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 19:55:29 +0200 Subject: [PATCH 18/36] Ensured that dependencies of private libraries are no longer unnecessarily re-installed // Resolve #4987 --- HISTORY.rst | 1 + platformio/package/commands/install.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index f62db6cd..8ef422a1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. ~~~~~~~~~~~~~~~~~~~ * Added support for ``tar.xz`` tarball dependencies (`pull #4974 `_) +* Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 `_) * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) * Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags `__ option (`issue #5004 `_) diff --git a/platformio/package/commands/install.py b/platformio/package/commands/install.py index 8c987c17..675c229c 100644 --- a/platformio/package/commands/install.py +++ b/platformio/package/commands/install.py @@ -297,7 +297,11 @@ def _install_project_private_library_deps(private_pkg, private_lm, env_lm, optio if not spec.external and not spec.owner: continue pkg = private_lm.get_package(spec) - if not pkg and not env_lm.get_package(spec): + if ( + not pkg + and not private_lm.get_package(spec) + and not env_lm.get_package(spec) + ): pkg = env_lm.install( spec, skip_dependencies=True, From 47a87c57f2b2a3cbe988abdafedd215c2bfb5f40 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 19:56:35 +0200 Subject: [PATCH 19/36] Bump version to 6.1.17b1 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 85c5a899..42ccc76a 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, "17a2") +VERSION = (6, 1, "17b1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 1d4b5c80517e952456370ccbb084fe4e5fed9c55 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 13 Dec 2024 13:01:21 +0200 Subject: [PATCH 20/36] Upgrade docs to the sphinx 8 --- docs | 2 +- tox.ini | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs b/docs index 2502cca2..9f64f54a 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 2502cca21a23dbb2b74f9a5ff5ff80f94d62b2f1 +Subproject commit 9f64f54adc842b1aba2b00c378460d39358f0272 diff --git a/tox.ini b/tox.ini index 02b96152..42e46948 100644 --- a/tox.ini +++ b/tox.ini @@ -54,8 +54,8 @@ commands = [testenv:docs] deps = - sphinx - sphinx-rtd-theme==2.0.0 + sphinx-rtd-theme==3.0.2 + sphinxcontrib-googleanalytics sphinx-notfound-page sphinx-copybutton restructuredtext-lint From d15314689d2e31e06fb0aff8c8b5f4dafe82dc53 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 13 Dec 2024 13:01:40 +0200 Subject: [PATCH 21/36] Resolved an issue where the ``--project-dir`` flag did not function correctly with the check and debug commands // Resolve #5029 --- HISTORY.rst | 1 + platformio/check/cli.py | 9 ++++----- platformio/debug/cli.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8ef422a1..13adbdd5 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -25,6 +25,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. * Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 `_) * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) * Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags `__ option (`issue #5004 `_) +* Resolved an issue where the ``--project-dir`` flag did not function correctly with the `pio check `__ and `pio debug `__ commands (`issue #5029 `_) 6.1.16 (2024-09-26) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/check/cli.py b/platformio/check/cli.py index f4a41961..ca591f03 100644 --- a/platformio/check/cli.py +++ b/platformio/check/cli.py @@ -19,7 +19,6 @@ import json import os import shutil from collections import Counter -from os.path import dirname, isfile from time import time import click @@ -77,7 +76,7 @@ def cli( # pylint: disable=too-many-positional-arguments app.set_session_var("custom_project_conf", project_conf) # find project directory on upper level - if isfile(project_dir): + if os.path.isfile(project_dir): project_dir = find_project_dir_above(project_dir) results = [] @@ -150,7 +149,7 @@ def cli( # pylint: disable=too-many-positional-arguments print_processing_header(tool, envname, env_dump) ct = CheckToolFactory.new( - tool, project_dir, config, envname, tool_options + tool, os.getcwd(), config, envname, tool_options ) result = {"env": envname, "tool": tool, "duration": time()} @@ -250,12 +249,12 @@ def collect_component_stats(result): components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1}) for defect in result.get("defects", []): - component = dirname(defect.file) or defect.file + component = os.path.dirname(defect.file) or defect.file _append_defect(component, defect) if component.lower().startswith(get_project_dir().lower()): while os.sep in component: - component = dirname(component) + component = os.path.dirname(component) _append_defect(component, defect) return components diff --git a/platformio/debug/cli.py b/platformio/debug/cli.py index f9229b4f..d29b44d0 100644 --- a/platformio/debug/cli.py +++ b/platformio/debug/cli.py @@ -86,7 +86,7 @@ def cli( # pylint: disable=too-many-positional-arguments if not interface: return helpers.predebug_project( - ctx, project_dir, project_config, env_name, False, verbose + ctx, os.getcwd(), project_config, env_name, False, verbose ) configure_args = ( @@ -106,7 +106,7 @@ def cli( # pylint: disable=too-many-positional-arguments else: debug_config = _configure(*configure_args) - _run(project_dir, debug_config, client_extra_args) + _run(os.getcwd(), debug_config, client_extra_args) return None From 9be0a8248d40773774b3abec12c06e121ebea006 Mon Sep 17 00:00:00 2001 From: vortigont Date: Wed, 18 Dec 2024 21:24:35 +0900 Subject: [PATCH 22/36] LDF: refresh lib dependency after recursive search (#4941) LDF might mistakenly remove recursive dependency libs from a graph usually platform bundled ones Closes #4940 --- platformio/builder/tools/piolib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index ca9c9f1e..36b72d26 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -1159,6 +1159,8 @@ def ConfigureProjectLibBuilder(env): for lb in lib_builders: if lb in found_lbs: lb.search_deps_recursive(lb.get_search_files()) + # refill found libs after recursive search + found_lbs = [lb for lb in lib_builders if lb.is_dependent] for lb in lib_builders: for deplb in lb.depbuilders[:]: if deplb not in found_lbs: From 90fc36cf2d328309c985af57854e8f59a3aedbb4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 18 Dec 2024 14:38:24 +0200 Subject: [PATCH 23/36] Update deps --- platformio/dependencies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/dependencies.py b/platformio/dependencies.py index 90fe16d4..2489afbd 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -43,9 +43,9 @@ def get_pip_dependencies(): home = [ # PIO Home requirements "ajsonrpc == 1.2.*", - "starlette >=0.19, <0.42", + "starlette >=0.19, <0.43", 'uvicorn == 0.16.0; python_version < "3.7"', - 'uvicorn >=0.16, <0.33; python_version >= "3.7"', + 'uvicorn >=0.16, <0.35; python_version >= "3.7"', "wsproto == 1.*", ] From b6d1f4d769b125062d7cba8917cdd54c63541ae5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 18 Dec 2024 14:38:56 +0200 Subject: [PATCH 24/36] Resolved an issue where the |LDF| occasionally excluded bundled platform libraries from the dependency graph // Issue #4940 --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index 13adbdd5..c79f5a8c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -26,6 +26,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) * Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags `__ option (`issue #5004 `_) * Resolved an issue where the ``--project-dir`` flag did not function correctly with the `pio check `__ and `pio debug `__ commands (`issue #5029 `_) +* Resolved an issue where the |LDF| occasionally excluded bundled platform libraries from the dependency graph (`pull #4941 `_) 6.1.16 (2024-09-26) ~~~~~~~~~~~~~~~~~~~ From 4d4f5a217b82422c975493aa4268f7c2e53740e2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 18 Dec 2024 14:39:48 +0200 Subject: [PATCH 25/36] Bump version to 6.1.17b2 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 42ccc76a..4bdc30f1 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, "17b1") +VERSION = (6, 1, "17b2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From baab25a48c9c83f1abb81446dc12186ff2679395 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jan 2025 12:43:51 +0200 Subject: [PATCH 26/36] Update SPDX license list to v3.24.0 --- platformio/package/manifest/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py index 47efae59..d38b9c9f 100644 --- a/platformio/package/manifest/schema.py +++ b/platformio/package/manifest/schema.py @@ -276,7 +276,7 @@ class ManifestSchema(BaseSchema): @staticmethod @memoized(expire="1h") def load_spdx_licenses(): - version = "3.24.0" + version = "3.26.0" spdx_data_url = ( "https://raw.githubusercontent.com/spdx/license-list-data/" f"v{version}/json/licenses.json" From c9016d693918eed31efad16e8ebe564e03b06630 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jan 2025 12:56:03 +0200 Subject: [PATCH 27/36] Simplify PyPi dependencies // Resolve #5059 --- platformio/dependencies.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/platformio/dependencies.py b/platformio/dependencies.py index 2489afbd..2e02fce9 100644 --- a/platformio/dependencies.py +++ b/platformio/dependencies.py @@ -28,8 +28,7 @@ def get_core_dependencies(): def get_pip_dependencies(): core = [ - 'bottle == 0.12.*; python_version < "3.7"', - 'bottle == 0.13.*; python_version >= "3.7"', + "bottle == 0.13.*", "click >=8.0.4, <9", "colorama", "marshmallow == 3.*", @@ -43,9 +42,8 @@ def get_pip_dependencies(): home = [ # PIO Home requirements "ajsonrpc == 1.2.*", - "starlette >=0.19, <0.43", - 'uvicorn == 0.16.0; python_version < "3.7"', - 'uvicorn >=0.16, <0.35; python_version >= "3.7"', + "starlette >=0.19, <0.46", + "uvicorn >=0.16, <0.35", "wsproto == 1.*", ] From 1be6e10f994d299bc102474af7e3c73665822834 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 8 Feb 2025 17:15:34 +0200 Subject: [PATCH 28/36] Introduced the PLATFORMIO_RUN_JOBS environment variable // Resolve #5077 --- HISTORY.rst | 1 + docs | 2 +- platformio/run/cli.py | 6 ++++-- tests/commands/pkg/test_install.py | 6 +++--- tests/commands/test_lib_complex.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c79f5a8c..6f4bd915 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -21,6 +21,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. 6.1.17 (2024-??-??) ~~~~~~~~~~~~~~~~~~~ +* Introduced the `PLATFORMIO_RUN_JOBS `__ environment variable, allowing manual override of the number of parallel build jobs (`issue #5077 `_) * Added support for ``tar.xz`` tarball dependencies (`pull #4974 `_) * Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 `_) * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 `_) diff --git a/docs b/docs index 9f64f54a..93c46bdf 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9f64f54adc842b1aba2b00c378460d39358f0272 +Subproject commit 93c46bdf3fed561c069fd4dcb80aef9f5a825723 diff --git a/platformio/run/cli.py b/platformio/run/cli.py index 26a4bb16..c07db5fd 100644 --- a/platformio/run/cli.py +++ b/platformio/run/cli.py @@ -33,9 +33,11 @@ from platformio.test.runners.base import CTX_META_TEST_IS_RUNNING # pylint: disable=too-many-arguments,too-many-locals,too-many-branches try: - DEFAULT_JOB_NUMS = cpu_count() + SYSTEM_CPU_COUNT = cpu_count() except NotImplementedError: - DEFAULT_JOB_NUMS = 1 + SYSTEM_CPU_COUNT = 1 + +DEFAULT_JOB_NUMS = int(os.getenv("PLATFORMIO_RUN_JOBS", SYSTEM_CPU_COUNT)) @click.command("run", short_help="Run project targets (build, upload, clean, etc.)") diff --git a/tests/commands/pkg/test_install.py b/tests/commands/pkg/test_install.py index f0033fee..a1630a3d 100644 --- a/tests/commands/pkg/test_install.py +++ b/tests/commands/pkg/test_install.py @@ -31,7 +31,7 @@ PROJECT_CONFIG_TPL = """ [env] platform = platformio/atmelavr@^3.4.0 lib_deps = - milesburton/DallasTemperature@^3.9.1 + milesburton/DallasTemperature@^4.0.4 https://github.com/esphome/ESPAsyncWebServer/archive/refs/tags/v2.1.0.zip [env:baremetal] @@ -215,7 +215,7 @@ def test_project( PackageSpec("toolchain-atmelavr@1.70300.191015"), ] assert config.get("env:devkit", "lib_deps") == [ - "milesburton/DallasTemperature@^3.9.1", + "milesburton/DallasTemperature@^4.0.4", "https://github.com/esphome/ESPAsyncWebServer/archive/refs/tags/v2.1.0.zip", ] @@ -241,7 +241,7 @@ def test_private_lib_deps( "version": "1.0.0", "dependencies": { "bblanchon/ArduinoJson": "^5", - "milesburton/DallasTemperature": "^3.9.1" + "milesburton/DallasTemperature": "^4.0.4" } } """ diff --git a/tests/commands/test_lib_complex.py b/tests/commands/test_lib_complex.py index 55563be5..f14d9d4c 100644 --- a/tests/commands/test_lib_complex.py +++ b/tests/commands/test_lib_complex.py @@ -235,7 +235,7 @@ def test_global_lib_update_check(clirunner, validate_cliresult): validate_cliresult(result) output = json.loads(result.output) assert set( - ["Adafruit PN532", "AsyncMqttClient", "ESPAsyncTCP", "NeoPixelBus"] + ["Adafruit PN532", "AsyncMqttClient", "AsyncTCP", "ESPAsyncTCP", "NeoPixelBus"] ) == set(lib["name"] for lib in output) From 4dc7ea5bd016447630381326536c4f8bcf18948d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 8 Feb 2025 16:21:12 +0100 Subject: [PATCH 29/36] Fix typos discovered by codespell (#5078) * Fix typos discovered by codespell * codespell-project/actions-codespell@v2 --- .github/workflows/core.yml | 4 ++++ platformio/commands/settings.py | 2 +- platformio/package/commands/uninstall.py | 2 +- platformio/package/commands/update.py | 2 +- platformio/platform/factory.py | 2 +- platformio/project/config.py | 2 +- platformio/project/helpers.py | 2 +- .../netbeans/nbproject/private/launcher.properties.tpl | 2 +- platformio/util.py | 8 ++++---- tests/commands/pkg/test_install.py | 2 +- tests/package/test_manager.py | 2 +- 11 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 2f841588..d87376e8 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -17,6 +17,10 @@ jobs: with: submodules: "recursive" + - uses: codespell-project/actions-codespell@v2 + with: + ignore_words_list: ans,homestate,ser + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/platformio/commands/settings.py b/platformio/commands/settings.py index 695d9020..d0d8258a 100644 --- a/platformio/commands/settings.py +++ b/platformio/commands/settings.py @@ -76,5 +76,5 @@ def settings_set(ctx, name, value): @click.pass_context def settings_reset(ctx): app.reset_settings() - click.secho("The settings have been reseted!", fg="green") + click.secho("The settings have been reset!", fg="green") ctx.invoke(settings_get) diff --git a/platformio/package/commands/uninstall.py b/platformio/package/commands/uninstall.py index 2808d491..37705055 100644 --- a/platformio/package/commands/uninstall.py +++ b/platformio/package/commands/uninstall.py @@ -111,7 +111,7 @@ def uninstall_project_env_dependencies(project_env, options=None): uninstalled_conds.append( _uninstall_project_env_custom_tools(project_env, options) ) - # custom ibraries + # custom libraries if options.get("libraries"): uninstalled_conds.append( _uninstall_project_env_custom_libraries(project_env, options) diff --git a/platformio/package/commands/update.py b/platformio/package/commands/update.py index 8788f7b5..4f20fdfa 100644 --- a/platformio/package/commands/update.py +++ b/platformio/package/commands/update.py @@ -110,7 +110,7 @@ def update_project_env_dependencies(project_env, options=None): # custom tools if options.get("tools"): updated_conds.append(_update_project_env_custom_tools(project_env, options)) - # custom ibraries + # custom libraries if options.get("libraries"): updated_conds.append(_update_project_env_custom_libraries(project_env, options)) # declared dependencies diff --git a/platformio/platform/factory.py b/platformio/platform/factory.py index 334888b5..42c3432b 100644 --- a/platformio/platform/factory.py +++ b/platformio/platform/factory.py @@ -33,7 +33,7 @@ class PlatformFactory: @staticmethod def load_platform_module(name, path): - # backward compatibiility with the legacy dev-platforms + # backward compatibility with the legacy dev-platforms sys.modules["platformio.managers.platform"] = base try: return load_python_module("platformio.platform.%s" % name, path) diff --git a/platformio/project/config.py b/platformio/project/config.py index c583c0d2..82b76abf 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -347,7 +347,7 @@ class ProjectConfigBase: if section is None: if option in self.BUILTIN_VARS: return self.BUILTIN_VARS[option]() - # SCons varaibles + # SCons variables return f"${{{option}}}" # handle system environment variables diff --git a/platformio/project/helpers.py b/platformio/project/helpers.py index 4d153492..2732e6bd 100644 --- a/platformio/project/helpers.py +++ b/platformio/project/helpers.py @@ -158,7 +158,7 @@ def load_build_metadata(project_dir, env_or_envs, cache=False, build_type=None): return result or None -# Backward compatibiility with dev-platforms +# Backward compatibility with dev-platforms load_project_ide_data = load_build_metadata diff --git a/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl index 6cc2127d..885a1547 100644 --- a/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl +++ b/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl @@ -17,7 +17,7 @@ # common.symbolFiles= # (This value is overwritten by a launcher specific symbolFiles value if the latter exists) # -# In runDir, symbolFiles and env fields you can use these macroses: +# In runDir, symbolFiles and env fields you can use these macros: # ${PROJECT_DIR} - project directory absolute path # ${OUTPUT_PATH} - linker output path (relative to project directory path) # ${OUTPUT_BASENAME}- linker output filename diff --git a/platformio/util.py b/platformio/util.py index 3f8421c3..e0830a8d 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -65,16 +65,16 @@ class memoized: class throttle: - def __init__(self, threshhold): - self.threshhold = threshhold # milliseconds + def __init__(self, threshold): + self.threshold = threshold # milliseconds self.last = 0 def __call__(self, func): @functools.wraps(func) def wrapper(*args, **kwargs): diff = int(round((time.time() - self.last) * 1000)) - if diff < self.threshhold: - time.sleep((self.threshhold - diff) * 0.001) + if diff < self.threshold: + time.sleep((self.threshold - diff) * 0.001) self.last = time.time() return func(*args, **kwargs) diff --git a/tests/commands/pkg/test_install.py b/tests/commands/pkg/test_install.py index a1630a3d..3b4aac52 100644 --- a/tests/commands/pkg/test_install.py +++ b/tests/commands/pkg/test_install.py @@ -340,7 +340,7 @@ def test_remove_project_unused_libdeps( ), ] - # manually remove from cofiguration file + # manually remove from configuration file config.set("env:baremetal", "lib_deps", ["bblanchon/ArduinoJson@^5"]) config.save() result = clirunner.invoke( diff --git a/tests/package/test_manager.py b/tests/package/test_manager.py index fc210467..977cde9d 100644 --- a/tests/package/test_manager.py +++ b/tests/package/test_manager.py @@ -335,7 +335,7 @@ def test_symlink(tmp_path: Path): # uninstall lm.uninstall("External") assert ["Installed"] == [pkg.metadata.name for pkg in lm.get_installed()] - # ensure original package was not rmeoved + # ensure original package was not removed assert external_pkg_dir.is_dir() # install again, remove from a disk From a584a6bce393c795b9fd806ccdd63e184334c627 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 8 Feb 2025 19:27:58 +0200 Subject: [PATCH 30/36] Fix spell issues --- .github/workflows/core.yml | 10 ++++++---- Makefile | 5 ++++- docs | 2 +- examples | 2 +- tox.ini | 3 ++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index d87376e8..faf878c4 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -17,10 +17,6 @@ jobs: with: submodules: "recursive" - - uses: codespell-project/actions-codespell@v2 - with: - ignore_words_list: ans,homestate,ser - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -31,6 +27,12 @@ jobs: python -m pip install --upgrade pip pip install tox + - name: Run "codespell" on Linux + if: startsWith(matrix.os, 'ubuntu') + run: | + python -m pip install codespell + make codespell + - name: Core System Info run: | tox -e py diff --git a/Makefile b/Makefile index e4c82fd3..7f182f79 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,13 @@ format: black ./platformio black ./tests +codespell: + codespell --skip "./build,./docs/_build" -L "AtLeast,PreProcesor,TRE,ans,dout,homestate,ser" + test: pytest --verbose --exitfirst -n 6 --dist=loadscope tests --ignore tests/test_examples.py -before-commit: isort format lint +before-commit: codespell isort format lint clean-docs: rm -rf docs/_build diff --git a/docs b/docs index 93c46bdf..2a5ebc47 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 93c46bdf3fed561c069fd4dcb80aef9f5a825723 +Subproject commit 2a5ebc47a7f2395d842fbec75cb7dac6266a3121 diff --git a/examples b/examples index 4953bbab..9f28e742 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 4953bbabae6cccecbd5a4852519f2f91816c9f77 +Subproject commit 9f28e742ce24bc661c864f50739b20453c8f9425 diff --git a/tox.ini b/tox.ini index 42e46948..0be8ec1e 100644 --- a/tox.ini +++ b/tox.ini @@ -27,11 +27,12 @@ passenv = * usedevelop = True deps = black + codespell isort + jsondiff pylint pytest pytest-xdist - jsondiff commands = {envpython} --version pio system info From 29cd2d2bdb55abea3b4c10da83846539013ea1b6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 8 Feb 2025 21:24:54 +0200 Subject: [PATCH 31/36] Update GH actions --- .github/workflows/docs.yml | 10 +++++----- docs | 2 +- tests/commands/pkg/test_uninstall.py | 9 +++++++-- tests/commands/pkg/test_update.py | 28 +++++++++++----------------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4404ad54..264a7e5c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: with: submodules: "recursive" - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies @@ -40,7 +40,7 @@ jobs: - name: Save artifact if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: docs path: ./docs.tar.gz @@ -57,7 +57,7 @@ jobs: if: ${{ github.event_name == 'push' }} steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: docs - name: Unpack artifact @@ -65,7 +65,7 @@ jobs: mkdir ./${{ env.LATEST_DOCS_DIR }} tar -xzf ./docs.tar.gz -C ./${{ env.LATEST_DOCS_DIR }} - name: Delete Artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: docs - name: Select Docs type @@ -101,7 +101,7 @@ jobs: exit 1 fi - name: Deploy to Github Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: personal_token: ${{ secrets.DEPLOY_GH_DOCS_TOKEN }} external_repository: ${{ env.DOCS_REPO }} diff --git a/docs b/docs index 2a5ebc47..cfbb76a1 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 2a5ebc47a7f2395d842fbec75cb7dac6266a3121 +Subproject commit cfbb76a119831b3da8bcd843fd42703eba5ee3ee diff --git a/tests/commands/pkg/test_uninstall.py b/tests/commands/pkg/test_uninstall.py index 6a759fbc..0d854bc3 100644 --- a/tests/commands/pkg/test_uninstall.py +++ b/tests/commands/pkg/test_uninstall.py @@ -58,12 +58,14 @@ def test_global_packages( validate_cliresult(result) assert pkgs_to_names(LibraryPackageManager().get_installed()) == [ "ArduinoJson", + "Async TCP", "AsyncMqttClient", "AsyncTCP", + "AsyncTCP_RP2040W", "Bounce2", "ESP Async WebServer", "ESPAsyncTCP", - "ESPAsyncTCP", + "ESPAsyncTCP-esphome", "Homie", ] # uninstall all deps @@ -96,12 +98,14 @@ def test_global_packages( validate_cliresult(result) assert pkgs_to_names(LibraryPackageManager().get_installed()) == [ "ArduinoJson", + "Async TCP", "AsyncMqttClient", "AsyncTCP", + "AsyncTCP_RP2040W", "Bounce2", "ESP Async WebServer", "ESPAsyncTCP", - "ESPAsyncTCP", + "ESPAsyncTCP-esphome", ] # remove specific dependency result = clirunner.invoke( @@ -116,6 +120,7 @@ def test_global_packages( assert pkgs_to_names(LibraryPackageManager().get_installed()) == [ "ArduinoJson", "AsyncMqttClient", + "AsyncTCP", "Bounce2", "ESPAsyncTCP", ] diff --git a/tests/commands/pkg/test_update.py b/tests/commands/pkg/test_update.py index 4ee4366a..71f5dbf3 100644 --- a/tests/commands/pkg/test_update.py +++ b/tests/commands/pkg/test_update.py @@ -34,7 +34,7 @@ PROJECT_OUTDATED_CONFIG_TPL = """ platform = platformio/atmelavr@^2 framework = arduino board = attiny88 -lib_deps = milesburton/DallasTemperature@^3.8.0 +lib_deps = milesburton/DallasTemperature@^3.9.1 """ PROJECT_UPDATED_CONFIG_TPL = """ @@ -42,7 +42,7 @@ PROJECT_UPDATED_CONFIG_TPL = """ platform = platformio/atmelavr@<4 framework = arduino board = attiny88 -lib_deps = milesburton/DallasTemperature@^3.8.0 +lib_deps = milesburton/DallasTemperature@^3.9.1 """ @@ -179,7 +179,7 @@ def test_project( PackageSpec("toolchain-atmelavr@1.50400.190710"), ] assert config.get("env:devkit", "lib_deps") == [ - "milesburton/DallasTemperature@^3.8.0" + "milesburton/DallasTemperature@^3.9.1" ] # update packages @@ -195,10 +195,7 @@ def test_project( assert pkgs[0].metadata.name == "atmelavr" assert pkgs[0].metadata.version.major == 3 assert pkgs_to_specs(lm.get_installed()) == [ - PackageSpec( - "DallasTemperature@%s" - % get_pkg_latest_version("milesburton/DallasTemperature") - ), + PackageSpec("DallasTemperature@3.11.0"), PackageSpec( "OneWire@%s" % get_pkg_latest_version("paulstoffregen/OneWire") ), @@ -210,7 +207,7 @@ def test_project( PackageSpec("toolchain-atmelavr@1.50400.190710"), ] assert config.get("env:devkit", "lib_deps") == [ - "milesburton/DallasTemperature@^3.8.0" + "milesburton/DallasTemperature@^3.9.1" ] # update again @@ -230,7 +227,7 @@ def test_custom_project_libraries( project_dir = tmp_path / "project" project_dir.mkdir() (project_dir / "platformio.ini").write_text(PROJECT_OUTDATED_CONFIG_TPL) - spec = "milesburton/DallasTemperature@^3.8.0" + spec = "milesburton/DallasTemperature@^3.9.1" result = clirunner.invoke( package_install_cmd, ["-d", str(project_dir), "-e", "devkit", "-l", spec], @@ -251,15 +248,15 @@ def test_custom_project_libraries( # update package result = clirunner.invoke( package_update_cmd, - ["-e", "devkit", "-l", "milesburton/DallasTemperature@^3.8.0"], + ["-e", "devkit", "-l", "milesburton/DallasTemperature@^3.9.1"], ) assert ProjectConfig().get("env:devkit", "lib_deps") == [ - "milesburton/DallasTemperature@^3.8.0" + "milesburton/DallasTemperature@^3.9.1" ] # try again result = clirunner.invoke( package_update_cmd, - ["-e", "devkit", "-l", "milesburton/DallasTemperature@^3.8.0"], + ["-e", "devkit", "-l", "milesburton/DallasTemperature@^3.9.1"], ) validate_cliresult(result) assert "Already up-to-date." in result.output @@ -276,16 +273,13 @@ def test_custom_project_libraries( os.path.join(config.get("platformio", "libdeps_dir"), "devkit") ) assert pkgs_to_specs(lm.get_installed()) == [ - PackageSpec( - "DallasTemperature@%s" - % get_pkg_latest_version("milesburton/DallasTemperature") - ), + PackageSpec("DallasTemperature@3.11.0"), PackageSpec( "OneWire@%s" % get_pkg_latest_version("paulstoffregen/OneWire") ), ] assert config.get("env:devkit", "lib_deps") == [ - "milesburton/DallasTemperature@^3.8.0" + "milesburton/DallasTemperature@^3.9.1" ] # unknown libraries From c950d6d366f1d73b55b51aa79a0470864f762eda Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 8 Feb 2025 21:51:50 +0200 Subject: [PATCH 32/36] CI: Disable cleaning of ubuntu instance --- .github/workflows/examples.yml | 2 +- tests/commands/pkg/test_outdated.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 2e734563..76f89b72 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -34,7 +34,7 @@ jobs: run: | # Free space sudo apt clean - docker rmi $(docker image ls -aq) + # docker rmi $(docker image ls -aq) df -h tox -e testexamples diff --git a/tests/commands/pkg/test_outdated.py b/tests/commands/pkg/test_outdated.py index 58f3b0f7..54a239a3 100644 --- a/tests/commands/pkg/test_outdated.py +++ b/tests/commands/pkg/test_outdated.py @@ -56,7 +56,7 @@ def test_project(clirunner, validate_cliresult, isolated_pio_core, tmp_path): re.MULTILINE, ) assert re.search( - r"^DallasTemperature\s+3\.\d\.1\s+3\.\d+\.\d+\s+3\.\d+\.\d+\s+Library\s+devkit", + r"^DallasTemperature\s+3\.\d\.1\s+3\.\d+\.\d+\s+4\.\d+\.\d+\s+Library\s+devkit", result.output, re.MULTILINE, ) From d907ecb9e908ad75dc6256ec68569d52bdaaefc5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 9 Feb 2025 12:22:58 +0200 Subject: [PATCH 33/36] Sync docs --- Makefile | 2 +- docs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7f182f79..d1f56e82 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ format: black ./tests codespell: - codespell --skip "./build,./docs/_build" -L "AtLeast,PreProcesor,TRE,ans,dout,homestate,ser" + codespell --skip "./build,./docs/_build" -L "AtLeast,TRE,ans,dout,homestate,ser" test: pytest --verbose --exitfirst -n 6 --dist=loadscope tests --ignore tests/test_examples.py diff --git a/docs b/docs index cfbb76a1..0417bcf4 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit cfbb76a119831b3da8bcd843fd42703eba5ee3ee +Subproject commit 0417bcf453886f42c4e50a0ab665b7edd2bbe56f From 20e076191ecf344a17215a727a88ce39c9e589a7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 9 Feb 2025 12:24:37 +0200 Subject: [PATCH 34/36] Bump version to 6.1.17rc1 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 4bdc30f1..1f45b7be 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, "17b2") +VERSION = (6, 1, "17rc1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From a71443a2ee934e508dcf221d08540cfdb7bf1ce2 Mon Sep 17 00:00:00 2001 From: Deen-Weible Date: Thu, 13 Feb 2025 11:04:48 +0000 Subject: [PATCH 35/36] Clarified language and fixed some grammar issues (#5085) --- platformio/project/commands/init.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/platformio/project/commands/init.py b/platformio/project/commands/init.py index 55026a74..f4702eb3 100644 --- a/platformio/project/commands/init.py +++ b/platformio/project/commands/init.py @@ -201,9 +201,7 @@ new version when next recompiled. The header file eliminates the labor of finding and changing all the copies as well as the risk that a failure to find one copy will result in inconsistencies within a program. -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. +In C, the convention is to give header files names that end with `.h'. Read more about using header files in official GCC documentation: @@ -222,12 +220,12 @@ def init_lib_readme(lib_dir): fp.write( """ This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. +PlatformIO will compile them to static libraries and link into the executable file. -The source code of each library should be placed in an own separate directory -("lib/your_library_name/[here are source files]"). +The source code of each library should be placed in a separate directory +("lib/your_library_name/[Code]"). -For example, see a structure of the following two libraries `Foo` and `Bar`: +For example, see the structure of the following example libraries `Foo` and `Bar`: |--lib | | @@ -237,7 +235,7 @@ For example, see a structure of the following two libraries `Foo` and `Bar`: | | |--src | | |- Bar.c | | |- Bar.h -| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html | | | |--Foo | | |- Foo.c @@ -249,7 +247,7 @@ For example, see a structure of the following two libraries `Foo` and `Bar`: |--src |- main.c -and a contents of `src/main.c`: +Example contents of `src/main.c` using Foo and Bar: ``` #include #include @@ -261,8 +259,8 @@ int main (void) ``` -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. +The PlatformIO Library Dependency Finder will find automatically dependent +libraries by scanning project source files. More information about PlatformIO Library Dependency Finder - https://docs.platformio.org/page/librarymanager/ldf.html From 4c697d9032a2a53e6ca2c718147498e1f402cf14 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 13 Feb 2025 13:08:31 +0200 Subject: [PATCH 36/36] Bump version to 6.1.17 --- HISTORY.rst | 2 +- docs | 2 +- platformio/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6f4bd915..10005d1f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,7 +18,7 @@ Unlock the true potential of embedded software development with PlatformIO's collaborative ecosystem, embracing declarative principles, test-driven methodologies, and modern toolchains for unrivaled success. -6.1.17 (2024-??-??) +6.1.17 (2025-02-13) ~~~~~~~~~~~~~~~~~~~ * Introduced the `PLATFORMIO_RUN_JOBS `__ environment variable, allowing manual override of the number of parallel build jobs (`issue #5077 `_) diff --git a/docs b/docs index 0417bcf4..f4457401 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 0417bcf453886f42c4e50a0ab665b7edd2bbe56f +Subproject commit f44574013b0efb324a743b8f2ec9208377644ec1 diff --git a/platformio/__init__.py b/platformio/__init__.py index 1f45b7be..7da579cd 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (6, 1, "17rc1") +VERSION = (6, 1, 17) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"