Skip to content

Modernizes platformio-core with UV, pyright and grants amnesty so that pyright can work #5211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverage.xml
.coverage
htmlcov
.pytest_cache
.venv
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files.autoSave": "onFocusChange",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.profiles.windows": {
"Git Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
"args": ["--cd=."]
}
},
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}/tests",
"python.testing.autoTestDiscoverOnSaveEnabled": true,
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "preCommitRunAllFiles",
"type": "shell",
"command": "pre-commit run --all-files",
},
{
"label": "openCoverageReport",
"type": "shell",
"command": "firefox htmlcov/index.html",
}
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To get started, <a href="https://cla-assistant.io/platformio/platformio-core">si
1. Fork the repository on GitHub
2. Clone repository `git clone --recursive https://github.com/YourGithubUsername/platformio-core.git`
3. Run `pip install tox`
4. Go to the root of the PlatformIO Core project where `tox.ini` is located (``cd platformio-core``) and run `tox -e py39`.
4. Go to the root of the PlatformIO Fixed project where `tox.ini` is located (``cd platformio-fixed``) and run `tox -e py39`.
You can replace `py39` with your own Python version. For example, `py311` means Python 3.11.
5. Activate current development environment:

Expand Down
45 changes: 45 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# Gemini Code Working Guide: platformio-fixed

This document provides an AI-centric overview of the `platformio-core` repository, designed to guide generative AI agents in understanding, navigating, and contributing to the project.

## Project Overview

`platformio-core` is the command-line interface (CLI) for the PlatformIO ecosystem, an open-source platform for embedded systems development. It provides a rich set of features for managing projects, libraries, and development boards, as well as for building, testing, and debugging embedded applications.

## Codebase Structure

The repository is organized into several key directories, each with a specific purpose:

- **`platformio`**: The main source code for the `platformio-core` CLI. It is a Python package with a modular structure, where each subdirectory corresponds to a specific feature or component of the PlatformIO ecosystem.
- **`tests`**: Contains the test suite for the project. The directory structure mirrors that of the `platformio` directory, with dedicated tests for each component. The tests are written using the `pytest` framework.
- **`docs`**: Contains the documentation for the project, written in reStructuredText.
- **`examples`**: Contains example projects that demonstrate how to use PlatformIO for various development boards and frameworks.
- **`scripts`**: Contains various scripts for automating tasks such as documentation generation and installation of development platforms.

## Key Files

- **`setup.py`**: The main entry point for the project's packaging and distribution. It defines the project's metadata, dependencies, and entry points for the CLI.
- **`platformio/__main__.py`**: The main entry point for the `platformio` command-line interface. It is responsible for parsing command-line arguments and dispatching them to the appropriate handlers.
- **`platformio/cli.py`**: Defines the command-line interface for the `platformio` command. It uses the `click` library to create a user-friendly CLI with support for commands, options, and arguments.
- **`platformio/project/config.py`**: Handles the parsing and validation of the `platformio.ini` configuration file, which is the central configuration file for PlatformIO projects.
- **`tests/conftest.py`**: Contains pytest fixtures and other test-related configurations.

## Development Workflow

The project uses a standard Python development workflow, with the following key steps:

1. **Installation**: The project can be installed from PyPI using `pip install platformio`. For development, it is recommended to install it in editable mode using `pip install -e .`.
2. **Testing**: The test suite can be run using the `pytest` command. The tests are organized into subdirectories that mirror the structure of the `platformio` directory.
3. **Linting**: The project uses `pylint` for code linting. The configuration is defined in the `.pylintrc` file.
4. **Continuous Integration**: The project uses GitHub Actions for continuous integration. The workflows are defined in the `.github/workflows` directory.

## How to Contribute

To contribute to the project, follow these steps:

1. Fork the repository on GitHub.
2. Create a new branch for your changes.
3. Make your changes and add tests for them.
4. Run the test suite to ensure that your changes do not break any existing functionality.
5. Submit a pull request with a clear description of your changes.
34 changes: 17 additions & 17 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Release Notes

.. _release_notes_6:

PlatformIO Core 6
PlatformIO Fixed 6
-----------------

Unlock the true potential of embedded software development with
Expand Down Expand Up @@ -123,7 +123,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
* Expanded the functionality of the |LIBRARYJSON| manifest by allowing the use of the underscore symbol in the `keywords <https://docs.platformio.org/en/latest/manifests/library-json/fields/keywords.html>`__ field
* Optimized project integration templates to address the issue of long paths on Windows (`issue #4652 <https://github.com/platformio/platformio-core/issues/4652>`_)
* Refactored |UNITTESTING| engine to resolve compiler warnings with "-Wpedantic" option (`pull #4671 <https://github.com/platformio/platformio-core/pull/4671>`_)
* Eliminated erroneous warning regarding the use of obsolete PlatformIO Core when downgrading to the stable version (`issue #4664 <https://github.com/platformio/platformio-core/issues/4664>`_)
* Eliminated erroneous warning regarding the use of obsolete PlatformIO Fixed when downgrading to the stable version (`issue #4664 <https://github.com/platformio/platformio-core/issues/4664>`_)
* Updated the `pio project metadata <https://docs.platformio.org/en/latest/core/userguide/project/cmd_metadata.html>`__ command to return C/C++ flags as parsed Unix shell arguments when dumping project build metadata
* Resolved a critical issue related to the usage of the ``-include`` flag within the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option, specifically when employing dynamic variables (`issue #4682 <https://github.com/platformio/platformio-core/issues/4682>`_)
* Removed PlatformIO IDE for Atom from the documentation as `Atom has been deprecated <https://github.blog/2022-06-08-sunsetting-atom/>`__
Expand All @@ -148,7 +148,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
* 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>`_)
* 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>`_)
* Resolved an issue where multiple targets were not executed sequentially (`issue #4604 <https://github.com/platformio/platformio-core/issues/4604>`_)
* Resolved an issue where upgrading PlatformIO Core fails on Windows with Python 3.11 (`issue #4540 <https://github.com/platformio/platformio-core/issues/4540>`_)
* Resolved an issue where upgrading PlatformIO Fixed fails on Windows with Python 3.11 (`issue #4540 <https://github.com/platformio/platformio-core/issues/4540>`_)

6.1.6 (2023-01-23)
~~~~~~~~~~~~~~~~~~
Expand All @@ -167,7 +167,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
~~~~~~~~~~~~~~~~~~

* Added a new `enable_proxy_strict_ssl <https://docs.platformio.org/en/latest/core/userguide/cmd_settings.html>`__ setting to disable the proxy server certificate verification (`issue #4432 <https://github.com/platformio/platformio-core/issues/4432>`_)
* Documented `PlatformIO Core Proxy Configuration <https://docs.platformio.org/en/latest/core/installation/proxy-configuration.html>`__
* Documented `PlatformIO Fixed Proxy Configuration <https://docs.platformio.org/en/latest/core/installation/proxy-configuration.html>`__
* Speeded up device port finder by avoiding loading board HWIDs from development platforms
* Improved caching of build metadata in debug mode
* Fixed an issue when `pio pkg install --storage-dir <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html>`__ command requires PlatformIO project (`issue #4410 <https://github.com/platformio/platformio-core/issues/4410>`_)
Expand Down Expand Up @@ -270,7 +270,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
6.0.1 (2022-05-17)
~~~~~~~~~~~~~~~~~~

* Improved support for the renamed configuration options (`issue #4270 <https://github.com/platformio/platformio-core/issues/4270>`_)
* Improved support for the renamed configuration options (`issue #4270 <https://github.com/platformio/platformio-fixed/issues/4270>`_)
* Fixed an issue when calling the built-in `pio device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html#filters>`__ filters
* Fixed an issue when using |INTERPOLATION| and merging str+int options (`issue #4271 <https://github.com/platformio/platformio-core/issues/4271>`_)

Expand Down Expand Up @@ -368,34 +368,34 @@ Please check the `Migration guide from 5.x to 6.0 <https://docs.platformio.org/e

.. _release_notes_5:

PlatformIO Core 5
PlatformIO Fixed 5
-----------------

See `PlatformIO Core 5.0 history <https://github.com/platformio/platformio-core/blob/v5.2.5/HISTORY.rst>`__.
See `PlatformIO Fixed 5.0 history <https://github.com/platformio/platformio-core/blob/v5.2.5/HISTORY.rst>`__.

.. _release_notes_4:

PlatformIO Core 4
PlatformIO Fixed 4
-----------------

See `PlatformIO Core 4.0 history <https://github.com/platformio/platformio-core/blob/v4.3.4/HISTORY.rst>`__.
See `PlatformIO Fixed 4.0 history <https://github.com/platformio/platformio-core/blob/v4.3.4/HISTORY.rst>`__.

PlatformIO Core 3
PlatformIO Fixed 3
-----------------

See `PlatformIO Core 3.0 history <https://github.com/platformio/platformio-core/blob/v3.6.7/HISTORY.rst>`__.
See `PlatformIO Fixed 3.0 history <https://github.com/platformio/platformio-core/blob/v3.6.7/HISTORY.rst>`__.

PlatformIO Core 2
PlatformIO Fixed 2
-----------------

See `PlatformIO Core 2.0 history <https://github.com/platformio/platformio-core/blob/v2.11.2/HISTORY.rst>`__.
See `PlatformIO Fixed 2.0 history <https://github.com/platformio/platformio-core/blob/v2.11.2/HISTORY.rst>`__.

PlatformIO Core 1
PlatformIO Fixed 1
-----------------

See `PlatformIO Core 1.0 history <https://github.com/platformio/platformio-core/blob/v1.5.0/HISTORY.rst>`__.
See `PlatformIO Fixed 1.0 history <https://github.com/platformio/platformio-fixed/blob/v1.5.0/HISTORY.rst>`__.

PlatformIO Core Preview
PlatformIO Fixed Preview
-----------------------

See `PlatformIO Core Preview history <https://github.com/platformio/platformio-core/blob/v0.10.2/HISTORY.rst>`__.
See `PlatformIO Fixed Preview history <https://github.com/platformio/platformio-fixed/blob/v0.10.2/HISTORY.rst>`__.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lint:
pylint --rcfile=./.pylintrc ./tests
pylint --rcfile=./.pylintrc ./platformio
ruff check ./tests
ruff check ./platformio

isort:
isort ./platformio
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PlatformIO Core
===============
PlatformIO Fixed
================

.. image:: https://github.com/platformio/platformio-core/workflows/Core/badge.svg
:target: https://docs.platformio.org/en/latest/core/index.html
:alt: CI Build for PlatformIO Core
:alt: CI Build for PlatformIO Fixed
.. image:: https://github.com/platformio/platformio-core/workflows/Docs/badge.svg
:target: https://docs.platformio.org?utm_source=github&utm_medium=core
:alt: CI Build for Docs
Expand Down Expand Up @@ -85,7 +85,7 @@ See `contributing guidelines <https://github.com/platformio/platformio/blob/deve
Telemetry / Privacy Policy
--------------------------

Share minimal diagnostics and usage information to help us make PlatformIO better.
Share minimal diagnostics and usage information to help us make PlatformIO Fixed better.
It is enabled by default. For more information see:

* `Telemetry Setting <https://docs.platformio.org/en/latest/userguide/cmd_settings.html?utm_source=github&utm_medium=core#enable-telemetry>`_
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ To this end, we support only the following versions:
| 6.1.x | :white_check_mark: |
| < 6.1 | :x: |

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.
Therefore, it is important that all developers use only supported versions of the PlatformIO Core.
Unsupported versions of the PlatformIO Fixed may have known vulnerabilities or security issues that could compromise the security of our organization's systems and data.
Therefore, it is important that all developers use only supported versions of the PlatformIO Fixed.

## Reporting a Vulnerability

Expand Down
Loading