Skip to content

Commit 9589ca8

Browse files
authored
pioarduino v1.4.0
v1.4.0
2 parents 8627e14 + 0aa0d15 commit 9589ca8

21 files changed

+1579
-484
lines changed

.github/workflows/main.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,70 @@ on:
44
workflow_dispatch: # Start a workflow
55
push:
66

7-
87
jobs:
9-
build:
8+
build:
9+
permissions:
10+
contents: write
1011
strategy:
1112
fail-fast: false
1213
matrix:
13-
os: [ubuntu-latest, windows-latest, macos-latest]
14-
python-version: ["3.10", "3.11", "3.12", "3.13"]
14+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1516
runs-on: ${{ matrix.os }}
1617
steps:
1718
- uses: actions/checkout@v4
1819
- name: Set up Python ${{ matrix.python-version }}
1920
uses: actions/setup-python@v5
2021
with:
2122
python-version: ${{ matrix.python-version }}
22-
- name: Check Python
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
with:
26+
enable-cache: true
27+
cache-dependency-path: |
28+
pyproject.toml
29+
uv.lock
30+
- name: Check Python and uv
2331
run: |
24-
python -V
25-
which python
32+
uv run python -V
33+
uv run python -c "import sys,shutil;print(sys.executable);print(shutil.which('python') or '')"
34+
uv --version
2635
echo $PATH
27-
- name: Install dependencies
36+
- name: Install dependencies with uv
2837
run: |
29-
python -m pip install --upgrade pip
30-
pip install -U tox pytest
31-
pip install -e .
38+
uv sync --dev
3239
- name: Python Lint
3340
run: |
34-
tox -e lint
41+
uv run make lint
3542
- name: Integration Tests
3643
run: |
37-
make test
44+
uv run make test
3845
- name: Pack Installer Script
3946
run: |
40-
make pack
47+
uv run make pack
48+
- name: Copy Installer Script to Parent Directory
49+
run: |
50+
cp dist/*.py .
51+
shell: bash
4152
- name: Commit changed `get-platformio.py`
42-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
53+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
4354
uses: stefanzweifel/git-auto-commit-action@v5
4455
with:
4556
commit_message: "Github Action: Updated `get-platformio.py`"
4657
- name: Install PlatformIO Core
4758
run: |
48-
python3 get-platformio.py
59+
uv run python get-platformio.py
4960
if [ "$RUNNER_OS" == "Windows" ]; then
5061
~/.platformio/penv/Scripts/pio.exe system info
5162
else
5263
~/.platformio/penv/bin/pio system info
5364
fi
5465
shell: bash
66+
- name: Verify uv is installed in PlatformIO penv
67+
run: |
68+
if [ "$RUNNER_OS" == "Windows" ]; then
69+
~/.platformio/penv/Scripts/uv.exe --version
70+
else
71+
~/.platformio/penv/bin/uv --version
72+
fi
73+
shell: bash
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test get-platformio.py without uv
2+
3+
on:
4+
workflow_dispatch: # Start a workflow
5+
push:
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
12+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Ensure uv is not installed
21+
run: |
22+
pip uninstall -y uv || true
23+
if python -m uv --version 2>/dev/null; then exit 1; fi
24+
shell: bash
25+
- name: Run get-platformio.py
26+
run: |
27+
python get-platformio.py
28+
shell: bash
29+
- name: Install PlatformIO Core
30+
run: |
31+
if [ "$RUNNER_OS" == "Windows" ]; then
32+
~/.platformio/penv/Scripts/pio.exe system info
33+
else
34+
~/.platformio/penv/bin/pio system info
35+
fi
36+
shell: bash
37+
- name: Verify uv is installed in PlatformIO penv
38+
run: |
39+
if [ "$RUNNER_OS" == "Windows" ]; then
40+
~/.platformio/penv/Scripts/uv.exe --help
41+
else
42+
~/.platformio/penv/bin/uv --help
43+
fi
44+
shell: bash

.vscode/tasks.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "lint",
6+
"type": "shell",
7+
"command": "make lint",
8+
"group": { "kind": "test", "isDefault": true }
9+
}
10+
]
11+
}

Makefile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
1+
# Use uv for all operations
2+
3+
# Always use phony targets
4+
.PHONY: all lint isort format test install-dev pack before-commit clean publish
5+
6+
# Default target
7+
all: before-commit
8+
19
lint:
2-
pylint --rcfile=./.pylintrc ./pioinstaller
10+
uv run pylint --rcfile=./.pylintrc ./pioinstaller
311

412
isort:
5-
isort ./tests
6-
isort ./pioinstaller
13+
uv run isort ./pioinstaller ./tests
714

815
format:
9-
black ./pioinstaller
10-
black ./tests
16+
uv run black ./pioinstaller ./tests
1117

1218
test:
13-
py.test --verbose --capture=no --exitfirst tests
19+
uv run pytest --verbose --capture=no --exitfirst tests
20+
21+
install-dev:
22+
uv sync --dev
1423

1524
pack:
16-
pioinstaller pack
25+
mkdir -p dist
26+
uv run pioinstaller pack dist/
1727

18-
before-commit: isort format lint
28+
before-commit: isort format lint test
1929

2030
clean:
2131
find . -name \*.pyc -delete
2232
find . -name __pycache__ -delete
2333
rm -rf .cache
2434

2535
publish:
26-
python setup.py sdist upload
36+
uv build
37+
uv publish

README.rst

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
pioarduino Core Installer
22
=========================
33

4-
A standalone installer for `pioarduino Core`
4+
A standalone installer for `pioarduino Core` using modern Python packaging tools.
5+
6+
**Important:** The installer checks for Python 3.10–3.13 and uses `uv` to install pioarduino core. If no compatible Python is found, it will install Python 3.13.
7+
8+
Features
9+
--------
10+
11+
* Fast installation using `uv` package manager
12+
* Isolated virtual environment creation
13+
* Cross-platform compatibility (Windows, macOS, Linux)
14+
* Python 3.10+ support
15+
16+
Requirements
17+
------------
18+
19+
* Python 3.9 or newer for install
20+
* Internet connection for downloading packages
21+
22+
Development
23+
-----------
24+
25+
This project uses modern Python packaging with `pyproject.toml` and `uv`.
26+
27+
Quick start for development (Linux and macOS)::
28+
29+
# Install uv if not already installed
30+
curl -LsSf https://astral.sh/uv/install.sh | sh
31+
32+
# Clone and setup development environment
33+
git clone https://github.com/Jason2866/pioarduino-core-installer.git
34+
cd pioarduino-core-installer
35+
36+
# Install dependencies with uv
37+
uv sync --dev
38+
39+
# Run tests
40+
uv run pytest
41+
42+
# Format code
43+
uv run black pioinstaller tests
44+
uv run isort pioinstaller tests
45+
46+
# Run linter
47+
uv run pylint pioinstaller

pioinstaller/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2014-present PlatformIO <[email protected]>
2+
# Copyright (c) 2024-present pioarduino
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -14,20 +15,19 @@
1415

1516
import logging.config
1617

17-
VERSION = (1, 2, 3)
18-
__version__ = ".".join([str(s) for s in VERSION])
18+
__version__ = "1.4.0"
1919

2020
__title__ = "pioarduino-installer"
21-
__description__ = "An installer for PlatformIO pioarduino Core"
21+
__description__ = "An installer for pioarduino Core"
2222

23-
__url__ = "https://pioarduino.org"
23+
__url__ = "https://github.com/pioarduino/pioarduino-core-installer"
2424

2525
__author__ = "PlatformIO Labs and pioarduino"
26-
__email__ = "[email protected]"
26+
__contact__ = "https://discord.gg/Nutz9crnZr"
2727

2828

2929
__license__ = "Apache-2.0"
30-
__copyright__ = "Copyright 2014-present PlatformIO and pioarduino"
30+
__copyright__ = "Copyright 2014-present PlatformIO and 2024-present pioarduino"
3131

3232

3333
logging.basicConfig(format="%(levelname)s: %(message)s")

pioinstaller/__main__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,12 @@
3636
multiple=True,
3737
help="A path to Python to be ignored (multiple options and unix wildcards are allowed)",
3838
)
39-
@click.option(
40-
"--pypi-index-url",
41-
help="Custom base URL of the Python Package Index (default `https://pypi.org/simple`)",
42-
)
4339
@click.pass_context
4440
def cli(
45-
ctx, verbose, shutdown_piohome, dev, ignore_python, pypi_index_url
41+
ctx, verbose, shutdown_piohome, dev, ignore_python
4642
): # pylint: disable=too-many-arguments,too-many-positional-arguments
4743
if verbose:
4844
logging.getLogger("pioinstaller").setLevel(logging.DEBUG)
49-
if pypi_index_url:
50-
os.environ["PIP_INDEX_URL"] = pypi_index_url
5145
ctx.obj["dev"] = dev
5246
if ctx.invoked_subcommand:
5347
return
@@ -90,7 +84,7 @@ def python():
9084
% (platform.python_version(), util.get_pythonexe_path()),
9185
fg="green",
9286
)
93-
except (exception.IncompatiblePythonError, exception.PythonVenvModuleNotFound) as e:
87+
except exception.IncompatiblePythonError as e:
9488
raise click.ClickException(
9589
"The Python %s (%s) interpreter is not compatible.\nReason: %s"
9690
% (platform.python_version(), util.get_pythonexe_path(), str(e))

0 commit comments

Comments
 (0)