Skip to content

Commit fc12dda

Browse files
committed
Merge branch 'release/v6.1.7'
2 parents 199e3d8 + 41fb1ca commit fc12dda

File tree

130 files changed

+1279
-1294
lines changed

Some content is hidden

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

130 files changed

+1279
-1294
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
mkdir ./${{ env.LATEST_DOCS_DIR }}
6666
tar -xzf ./docs.tar.gz -C ./${{ env.LATEST_DOCS_DIR }}
6767
- name: Delete Artifact
68-
uses: geekyeggo/delete-artifact@v1
68+
uses: geekyeggo/delete-artifact@v2
6969
with:
7070
name: docs
7171
- name: Select Docs type

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ disable=
88
invalid-name,
99
too-few-public-methods,
1010
consider-using-f-string,
11-
cyclic-import
11+
cyclic-import,
12+
use-dict-literal

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
See https://piolabs.com/legal/code-of-conduct.html

HISTORY.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release Notes
66
.. |LDF| replace:: `LDF <https://docs.platformio.org/en/latest/librarymanager/ldf.html>`__
77
.. |INTERPOLATION| replace:: `Interpolation of Values <https://docs.platformio.org/en/latest/projectconf/interpolation.html>`__
88
.. |UNITTESTING| replace:: `Unit Testing <https://docs.platformio.org/en/latest/advanced/unit-testing/index.html>`__
9+
.. |DEBUGGING| replace:: `Debugging <https://docs.platformio.org/en/latest/plus/debugging.html>`__
910

1011
.. _release_notes_6:
1112

@@ -14,6 +15,28 @@ PlatformIO Core 6
1415

1516
**A professional collaborative platform for declarative, safety-critical, and test-driven embedded development.**
1617

18+
6.1.7 (2023-05-08)
19+
~~~~~~~~~~~~~~~~~~
20+
21+
* Introduced a new ``--sample-code`` option to the `pio project init <https://docs.platformio.org/en/latest/core/userguide/project/cmd_init.html>`__ command, which allows users to include sample code in the newly created project
22+
* Added validation for `project working environment names <https://docs.platformio.org/en/latest/projectconf/sections/env/index.html#working-env-name>`__ to ensure that they only contain lowercase letters ``a-z``, numbers ``0-9``, and special characters ``_`` (underscore) and ``-`` (hyphen)
23+
* Added the ability to show a detailed library dependency tree only in `verbose mode <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#cmdoption-pio-run-v>`__, which can help you understand the relationship between libraries and troubleshoot issues more effectively (`issue #4517 <https://github.com/platformio/platformio-core/issues/4517>`_)
24+
* Added the ability to run only the `device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html>`__ when using the `pio run -t monitor <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html>`__ command, saving you time and resources by skipping the build process
25+
* Implemented a new feature to store device monitor logs in the project's ``logs`` folder, making it easier to access and review device monitor logs for your projects (`issue #4596 <https://github.com/platformio/platformio-core/issues/4596>`_)
26+
* Improved support for projects located on Windows network drives, including Network Shared Folder, Dropbox, OneDrive, Google Drive, and other similar services (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_)
27+
* Improved source file filtering functionality for the `Static Code Analysis <https://docs.platformio.org/en/latest/advanced/static-code-analysis/index.html>`__ feature, making it easier to analyze only the code you need to
28+
* Upgraded the build engine to the latest version of SCons (4.5.2) to improve build performance, reliability, and compatibility with other tools and systems (`release notes <https://github.com/SCons/scons/releases/tag/4.5.2>`__)
29+
* Implemented a fix for shell injection vulnerabilities when converting INO files to CPP, ensuring your code is safe and secure (`issue #4532 <https://github.com/platformio/platformio-core/issues/4532>`_)
30+
* Restored the project generator for the `NetBeans IDE <https://docs.platformio.org/en/latest/integration/ide/netbeans.html>`__, providing you with more flexibility and options for your development workflow
31+
* Resolved installation issues with PIO Remote on Raspberry Pi and other small form-factor PCs (`issue #4425 <https://github.com/platformio/platformio-core/issues/4425>`_, `issue #4493 <https://github.com/platformio/platformio-core/issues/4493>`_, `issue #4607 <https://github.com/platformio/platformio-core/issues/4607>`_)
32+
* Resolved an issue where the `build_cache_dir <https://docs.platformio.org/en/latest/projectconf/sections/platformio/options/directory/build_cache_dir.html>`__ setting was not being recognized consistently across multiple environments (`issue #4574 <https://github.com/platformio/platformio-core/issues/4574>`_)
33+
* Resolved an issue where organization details could not be updated using the `pio org update <https://docs.platformio.org/en/latest/core/userguide/org/cmd_update.html>`__ command
34+
* Resolved an issue where the incorrect debugging environment was generated for VSCode in "Auto" mode (`issue #4597 <https://github.com/platformio/platformio-core/issues/4597>`_)
35+
* Resolved an issue where native tests would fail if a custom program name was specified (`issue #4546 <https://github.com/platformio/platformio-core/issues/4546>`_)
36+
* Resolved an issue where the PlatformIO |DEBUGGING| solution was not escaping the tool installation process into MI2 correctly (`issue #4565 <https://github.com/platformio/platformio-core/issues/4565>`_)
37+
* Resolved an issue where multiple targets were not executed sequentially (`issue #4604 <https://github.com/platformio/platformio-core/issues/4604>`_)
38+
* Resolved an issue where upgrading PlatformIO Core fails on Windows with Python 3.11 (`issue #4540 <https://github.com/platformio/platformio-core/issues/4540>`_)
39+
1740
6.1.6 (2023-01-23)
1841
~~~~~~~~~~~~~~~~~~
1942

SECURITY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We are committed to ensuring the security and protection of PlatformIO Core.
6+
To this end, we support only the following versions:
7+
8+
| Version | Supported |
9+
| ------- | ------------------ |
10+
| 6.1.x | :white_check_mark: |
11+
| < 6.1 | :x: |
12+
13+
Unsupported versions of the PlatformIO Core may have known vulnerabilities or security issues that could compromise the security of our organization's systems and data.
14+
Therefore, it is important that all developers use only supported versions of the PlatformIO Core.
15+
16+
## Reporting a Vulnerability
17+
18+
We take the security of our systems and data very seriously. We encourage responsible disclosure of any vulnerabilities or security issues that you may find in our systems or applications. If you believe you have discovered a vulnerability, please report it to us immediately.
19+
20+
To report a vulnerability, please send an email to our security team at [email protected]. Please include as much information as possible, including:
21+
22+
- A description of the vulnerability and how it can be exploited
23+
- Steps to reproduce the vulnerability
24+
- Any additional information that can help us understand and reproduce the vulnerability
25+
26+
Once we receive your report, our security team will acknowledge receipt within 24 hours and will work to validate the reported vulnerability. We will provide periodic updates on the progress of the vulnerability assessment, and will notify you once a fix has been deployed.
27+
28+
If the vulnerability is accepted, we will work to remediate the issue as quickly as possible. We may also provide credit or recognition to the individual who reported the vulnerability, at our discretion.
29+
30+
If the vulnerability is declined, we will provide a justification for our decision and may offer guidance on how to improve the report or how to test the system more effectively.
31+
32+
Please note that we will not take any legal action against individuals who report vulnerabilities in good faith and in accordance with this policy.
33+
34+
Thank you for helping us keep our systems and data secure.

docs

Submodule docs updated 1272 files

platformio/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import sys
16-
17-
VERSION = (6, 1, 6)
15+
VERSION = (6, 1, 7)
1816
__version__ = ".".join([str(s) for s in VERSION])
1917

2018
__title__ = "platformio"
@@ -46,8 +44,8 @@
4644

4745
__core_packages__ = {
4846
"contrib-piohome": "~3.4.2",
49-
"contrib-pysite": "~2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
50-
"tool-scons": "~4.40400.0",
47+
"contrib-pioremote": "~1.0.0",
48+
"tool-scons": "~4.40502.0",
5149
"tool-cppcheck": "~1.270.0",
5250
"tool-clangtidy": "~1.150005.0",
5351
"tool-pvs-studio": "~7.18.0",

platformio/account/client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@
2121

2222

2323
class AccountError(PlatformioException):
24-
2524
MESSAGE = "{0}"
2625

2726

2827
class AccountNotAuthorized(AccountError):
29-
3028
MESSAGE = "You are not authorized! Please log in to PlatformIO Account."
3129

3230

3331
class AccountAlreadyAuthorized(AccountError):
34-
3532
MESSAGE = "You are already authorized with {0} account."
3633

3734

3835
class AccountClient(HTTPClient): # pylint:disable=too-many-public-methods
39-
4036
SUMMARY_CACHE_TTL = 60 * 60 * 24 * 7
4137

4238
def __init__(self):
@@ -298,7 +294,7 @@ def remove_org_owner(self, orgname, username):
298294
return self.fetch_json_data(
299295
"delete",
300296
"/v1/orgs/%s/owners" % orgname,
301-
data={"username": username},
297+
params={"username": username},
302298
x_with_authorization=True,
303299
)
304300

@@ -351,6 +347,6 @@ def remove_team_member(self, orgname, teamname, username):
351347
return self.fetch_json_data(
352348
"delete",
353349
"/v1/orgs/%s/teams/%s/members" % (orgname, teamname),
354-
data={"username": username},
350+
params={"username": username},
355351
x_with_authorization=True,
356352
)

platformio/account/org/commands/update.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,27 @@
2222
@click.argument("cur_orgname")
2323
@click.option(
2424
"--orgname",
25-
callback=lambda _, __, value: validate_orgname(value),
25+
callback=lambda _, __, value: validate_orgname(value) if value else value,
2626
help="A new orgname",
2727
)
28-
@click.option("--email")
28+
@click.option(
29+
"--email",
30+
callback=lambda _, __, value: validate_email(value) if value else value,
31+
)
2932
@click.option("--displayname")
3033
def org_update_cmd(cur_orgname, **kwargs):
3134
client = AccountClient()
3235
org = client.get_org(cur_orgname)
33-
del org["owners"]
34-
new_org = org.copy()
36+
new_org = {
37+
key: value if value is not None else org[key] for key, value in kwargs.items()
38+
}
3539
if not any(kwargs.values()):
36-
for field in org:
37-
new_org[field] = click.prompt(
38-
field.replace("_", " ").capitalize(), default=org[field]
39-
)
40-
if field == "email":
41-
validate_email(new_org[field])
42-
if field == "orgname":
43-
validate_orgname(new_org[field])
44-
else:
45-
new_org.update(
46-
{key.replace("new_", ""): value for key, value in kwargs.items() if value}
47-
)
40+
for key in kwargs:
41+
new_org[key] = click.prompt(key.capitalize(), default=org[key])
42+
if key == "email":
43+
validate_email(new_org[key])
44+
if key == "orgname":
45+
validate_orgname(new_org[key])
4846
client.update_org(cur_orgname, new_org)
4947
return click.secho(
5048
"The organization `%s` has been successfully updated." % cur_orgname,

platformio/account/team/commands/create.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
@click.argument(
2323
"orgname_teamname",
2424
metavar="ORGNAME:TEAMNAME",
25-
callback=lambda _, __, value: validate_orgname_teamname(
26-
value, teamname_validate=True
27-
),
25+
callback=lambda _, __, value: validate_orgname_teamname(value),
2826
)
2927
@click.option(
3028
"--description",

platformio/account/team/commands/update.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
)
2727
@click.option(
2828
"--name",
29-
callback=lambda _, __, value: validate_teamname(value),
29+
callback=lambda _, __, value: validate_teamname(value) if value else value,
3030
help="A new team name",
3131
)
3232
@click.option(
@@ -36,18 +36,14 @@ def team_update_cmd(orgname_teamname, **kwargs):
3636
orgname, teamname = orgname_teamname.split(":", 1)
3737
client = AccountClient()
3838
team = client.get_team(orgname, teamname)
39-
del team["id"]
40-
del team["members"]
41-
new_team = team.copy()
39+
new_team = {
40+
key: value if value is not None else team[key] for key, value in kwargs.items()
41+
}
4242
if not any(kwargs.values()):
43-
for field in team:
44-
new_team[field] = click.prompt(
45-
field.replace("_", " ").capitalize(), default=team[field]
46-
)
47-
if field == "name":
48-
validate_teamname(new_team[field])
49-
else:
50-
new_team.update({key: value for key, value in kwargs.items() if value})
43+
for key in kwargs:
44+
new_team[key] = click.prompt(key.capitalize(), default=team[key])
45+
if key == "name":
46+
validate_teamname(new_team[key])
5147
client.update_team(orgname, teamname, new_team)
5248
return click.secho(
5349
"The team %s has been successfully updated." % teamname,

platformio/account/validate.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919

2020
def validate_username(value, field="username"):
21-
value = str(value).strip()
22-
if not re.match(r"^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,37}$", value, flags=re.I):
21+
value = str(value).strip() if value else None
22+
if not value or not re.match(
23+
r"^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,37}$", value, flags=re.I
24+
):
2325
raise click.BadParameter(
2426
"Invalid %s format. "
2527
"%s must contain only alphanumeric characters "
@@ -30,16 +32,22 @@ def validate_username(value, field="username"):
3032
return value
3133

3234

35+
def validate_orgname(value):
36+
return validate_username(value, "Organization name")
37+
38+
3339
def validate_email(value):
34-
value = str(value).strip()
35-
if not re.match(r"^[a-z\d_\.\+\-]+@[a-z\d\-]+\.[a-z\d\-\.]+$", value, flags=re.I):
40+
value = str(value).strip() if value else None
41+
if not value or not re.match(
42+
r"^[a-z\d_\.\+\-]+@[a-z\d\-]+\.[a-z\d\-\.]+$", value, flags=re.I
43+
):
3644
raise click.BadParameter("Invalid email address")
3745
return value
3846

3947

4048
def validate_password(value):
41-
value = str(value).strip()
42-
if not re.match(r"^(?=.*[a-z])(?=.*\d).{8,}$", value):
49+
value = str(value).strip() if value else None
50+
if not value or not re.match(r"^(?=.*[a-z])(?=.*\d).{8,}$", value):
4351
raise click.BadParameter(
4452
"Invalid password format. "
4553
"Password must contain at least 8 characters"
@@ -48,27 +56,11 @@ def validate_password(value):
4856
return value
4957

5058

51-
def validate_orgname(value):
52-
return validate_username(value, "Organization name")
53-
54-
55-
def validate_orgname_teamname(value, teamname_validate=False):
56-
if ":" not in value:
57-
raise click.BadParameter(
58-
"Please specify organization and team name in the next"
59-
" format - orgname:teamname. For example, mycompany:DreamTeam"
60-
)
61-
teamname = str(value.strip().split(":", 1)[1])
62-
if teamname_validate:
63-
validate_teamname(teamname)
64-
return value
65-
66-
6759
def validate_teamname(value):
68-
if not value:
69-
return value
70-
value = str(value).strip()
71-
if not re.match(r"^[a-z\d](?:[a-z\d]|[\-_ ](?=[a-z\d])){0,19}$", value, flags=re.I):
60+
value = str(value).strip() if value else None
61+
if not value or not re.match(
62+
r"^[a-z\d](?:[a-z\d]|[\-_ ](?=[a-z\d])){0,19}$", value, flags=re.I
63+
):
7264
raise click.BadParameter(
7365
"Invalid team name format. "
7466
"Team name must only contain alphanumeric characters, "
@@ -77,3 +69,16 @@ def validate_teamname(value):
7769
" not be longer than 20 characters."
7870
)
7971
return value
72+
73+
74+
def validate_orgname_teamname(value):
75+
value = str(value).strip() if value else None
76+
if not value or ":" not in value:
77+
raise click.BadParameter(
78+
"Please specify organization and team name using the following"
79+
" format - orgname:teamname. For example, mycompany:DreamTeam"
80+
)
81+
orgname, teamname = value.split(":", 1)
82+
validate_orgname(orgname)
83+
validate_teamname(teamname)
84+
return value

platformio/assets/templates/ide-projects/vscode/.vscode/launch.json.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
% "request": "launch",
1717
% "name": "PIO Debug (skip Pre-Debug)",
1818
% "executable": _escape_path(prog_path),
19-
% "projectEnvName": env_name,
19+
% "projectEnvName": env_name if forced_env_name else default_debug_env_name,
2020
% "toolchainBinDir": _escape_path(os.path.dirname(gdb_path)),
2121
% "internalConsoleOptions": "openOnSessionStart",
2222
% }
@@ -28,7 +28,7 @@
2828
% debug["name"] = "PIO Debug"
2929
% debug["preLaunchTask"] = {
3030
% "type": "PlatformIO",
31-
% "task": ("Pre-Debug (%s)" % env_name) if len(config.envs()) > 1 and original_env_name else "Pre-Debug",
31+
% "task": ("Pre-Debug (%s)" % env_name) if len(config.envs()) > 1 and forced_env_name else "Pre-Debug",
3232
% }
3333
% noloading = predebug.copy()
3434
% noloading["name"] = "PIO Debug (without uploading)"

0 commit comments

Comments
 (0)