Repository: platformio/platformio-core

Issue:
Add support for LuatOS ESP32C3-CORE Development Board
Add support for LuatOS ESP32-C3 Development Board
https://wiki.luatos.org/chips/esp32c3/board.html
Bus 001 Device 012: ID 1a86:55d3 QinHeng Electronics USB Single Serial


Discussion:
CLAassistant: [![CLA assistant check](https://cla-assistant.io/pull/badge/not_signed)](https://cla-assistant.io/platformio/platformio-core?pullRequest=4852) <br/>Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our [Contributor License Agreement](https://cla-assistant.io/platformio/platformio-core?pullRequest=4852) before we can accept your contribution.<br/><sub>You have signed the CLA already but the status is still pending? Let us [recheck](https://cla-assistant.io/check/platformio/platformio-core?pullRequest=4852) it.</sub>

Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index bfe1dcba..4f1cc2d3 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -22,6 +22,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
 
 * Broadened version support for the ``pyelftools`` dependency, enabling compatibility with lower versions and facilitating integration with a wider range of third-party tools (`issue #4834 <https://github.com/platformio/platformio-core/issues/4834>`_)
 * Resolved an issue related to the relative package path in the `pio pkg publish <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_publish.html>`__ command
+* Addressed an issue where passing a relative path (``--project-dir``) to the `pio project init <https://docs.platformio.org/en/latest/core/userguide/project/cmd_init.html>`__ command resulted in an error (`issue #4847 <https://github.com/platformio/platformio-core/issues/4847>`_)
 
 6.1.13 (2024-01-12)
 ~~~~~~~~~~~~~~~~~~~
diff --git a/platformio/assets/system/99-platformio-udev.rules b/platformio/assets/system/99-platformio-udev.rules
index 992676db..bc31ac74 100644
--- a/platformio/assets/system/99-platformio-udev.rules
+++ b/platformio/assets/system/99-platformio-udev.rules
@@ -36,6 +36,8 @@ ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0666", ENV{ID_MM_DEVIC
 
 # QinHeng Electronics HL-340 USB-Serial adapter
 ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
+# QinHeng Electronics CH343 USB-Serial adapter
+ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d3", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
 # QinHeng Electronics CH9102 USB-Serial adapter
 ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
 
@@ -173,4 +175,4 @@ ATTRS{product}=="*CMSIS-DAP*", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID
 ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
 
 # Espressif USB JTAG/serial debug unit
-ATTRS{idVendor}=="303a", ATTR{idProduct}=="1001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
\ No newline at end of file
+ATTRS{idVendor}=="303a", ATTR{idProduct}=="1001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
diff --git a/platformio/pipdeps.py b/platformio/pipdeps.py
index f41218ea..e6193413 100644
--- a/platformio/pipdeps.py
+++ b/platformio/pipdeps.py
@@ -35,7 +35,7 @@ def get_pip_dependencies():
     home = [
         # PIO Home requirements
         "ajsonrpc == 1.2.*",
-        "starlette >=0.19, <0.36",
+        "starlette >=0.19, <0.38",
         "uvicorn %s" % ("== 0.16.0" if PY36 else ">=0.16, <0.28"),
         "wsproto == 1.*",
     ]
diff --git a/platformio/project/commands/init.py b/platformio/project/commands/init.py
index 4dae6e58..bc3ac61a 100644
--- a/platformio/project/commands/init.py
+++ b/platformio/project/commands/init.py
@@ -79,6 +79,7 @@ def project_init_cmd(
     env_prefix,
     silent,
 ):
+    project_dir = os.path.abspath(project_dir)
     is_new_project = not is_platformio_project(project_dir)
     if is_new_project:
         if not silent:


Test patch:
diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py
index 651cf579..a8bffc5d 100644
--- a/tests/commands/test_init.py
+++ b/tests/commands/test_init.py
@@ -15,6 +15,7 @@
 import json
 import os
 
+from platformio import fs
 from platformio.commands.boards import cli as cmd_boards
 from platformio.project.commands.init import project_init_cmd
 from platformio.project.config import ProjectConfig
@@ -36,27 +37,28 @@ def test_init_default(clirunner, validate_cliresult):
         validate_pioproject(os.getcwd())
 
 
-def test_init_ext_folder(clirunner, validate_cliresult):
-    with clirunner.isolated_filesystem():
-        ext_folder_name = "ext_folder"
-        os.makedirs(ext_folder_name)
-        result = clirunner.invoke(project_init_cmd, ["-d", ext_folder_name])
-        validate_cliresult(result)
-        validate_pioproject(os.path.join(os.getcwd(), ext_folder_name))
-
-
 def test_init_duplicated_boards(clirunner, validate_cliresult, tmpdir):
-    with tmpdir.as_cwd():
-        for _ in range(2):
-            result = clirunner.invoke(
-                project_init_cmd,
-                ["-b", "uno", "-b", "uno", "--no-install-dependencies"],
-            )
-            validate_cliresult(result)
-            validate_pioproject(str(tmpdir))
-        config = ProjectConfig(os.path.join(os.getcwd(), "platformio.ini"))
-        config.validate()
-        assert set(config.sections()) == set(["env:uno"])
+    project_dir = str(tmpdir.join("ext_folder"))
+    os.makedirs(project_dir)
+
+    with fs.cd(os.path.dirname(project_dir)):
+        result = clirunner.invoke(
+            project_init_cmd,
+            [
+                "-d",
+                os.path.basename(project_dir),
+                "-b",
+                "uno",
+                "-b",
+                "uno",
+                "--no-install-dependencies",
+            ],
+        )
+    validate_cliresult(result)
+    validate_pioproject(project_dir)
+    config = ProjectConfig(os.path.join(project_dir, "platformio.ini"))
+    config.validate()
+    assert set(config.sections()) == set(["env:uno"])
 
 
 def test_init_ide_without_board(clirunner, tmpdir):