Skip to content

Commit 21ff2d0

Browse files
committed
Update development toolchain
1 parent b15a217 commit 21ff2d0

File tree

8 files changed

+37
-143
lines changed

8 files changed

+37
-143
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"coverage-gutters.xmlname": "coverage.xml",
3131
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
3232
"python.defaultInterpreterPath": ".venv/bin/python",
33-
"python.formatting.provider": "black",
33+
"python.formatting.provider": "ruff",
3434
"python.linting.enabled": true,
3535
"python.linting.mypyEnabled": true,
3636
"python.linting.pylintEnabled": true,

.github/workflows/linting.yaml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,10 @@ jobs:
5454
poetry config virtualenvs.in-project true
5555
- name: 🏗 Install Python dependencies
5656
run: poetry install --no-interaction
57-
- name: 🚀 Run Ruff
58-
run: poetry run ruff .
59-
60-
black:
61-
name: black
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: ⤵️ Check out code from GitHub
65-
uses: actions/[email protected]
66-
- name: 🏗 Set up Poetry
67-
run: pipx install poetry
68-
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
69-
id: python
70-
uses: actions/[email protected]
71-
with:
72-
python-version: ${{ env.DEFAULT_PYTHON }}
73-
cache: "poetry"
74-
- name: 🏗 Install workflow dependencies
75-
run: |
76-
poetry config virtualenvs.create true
77-
poetry config virtualenvs.in-project true
78-
- name: 🏗 Install Python dependencies
79-
run: poetry install --no-interaction
80-
- name: 🚀 Run black on docs
81-
run: poetry run blacken-docs
57+
- name: 🚀 Run ruff linter
58+
run: poetry run ruff check --output-format=github .
59+
- name: 🚀 Run ruff formatter
60+
run: poetry run ruff format --check .
8261

8362
pre-commit-hooks:
8463
name: pre-commit-hooks
@@ -116,10 +95,6 @@ jobs:
11695
run: poetry run pre-commit run check-symlinks --all-files
11796
- name: 🚀 Check TOML files
11897
run: poetry run pre-commit run check-toml --all-files
119-
- name: 🚀 Check XML files
120-
run: poetry run pre-commit run check-xml --all-files
121-
- name: 🚀 Check YAML files
122-
run: poetry run pre-commit run check-yaml --all-files
12398
- name: 🚀 Check YAML files
12499
run: poetry run pre-commit run check-yaml --all-files
125100
- name: 🚀 Detect Private Keys

.github/workflows/release.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ jobs:
1414
release:
1515
name: Releasing to PyPi
1616
runs-on: ubuntu-latest
17+
environment:
18+
name: release
19+
url: https://pypi.org/p/wled
20+
permissions:
21+
contents: write
22+
id-token: write
1723
steps:
1824
- name: ⤵️ Check out code from GitHub
1925
uses: actions/[email protected]
@@ -40,8 +46,12 @@ jobs:
4046
- name: 🏗 Build package
4147
run: poetry build --no-interaction
4248
- name: 🚀 Publish to PyPi
43-
env:
44-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
45-
run: |
46-
poetry config pypi-token.pypi "${PYPI_TOKEN}"
47-
poetry publish --no-interaction
49+
uses: pypa/[email protected]
50+
with:
51+
verbose: true
52+
print-hash: true
53+
- name: ✍️ Sign published artifacts
54+
uses: sigstore/[email protected]
55+
with:
56+
inputs: ./dist/*.tar.gz ./dist/*.whl
57+
release-signing-artifacts: true

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
uses: codecov/[email protected]
7575
- name: SonarCloud Scan
7676
if: github.event.pull_request.head.repo.fork == false
77-
uses: SonarSource/sonarcloud-github-action@v1.9
77+
uses: SonarSource/sonarcloud-github-action@v2.0.2
7878
env:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.pre-commit-config.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,20 @@
22
repos:
33
- repo: local
44
hooks:
5-
- id: ruff
6-
name: 🐶 Ruff
5+
- id: ruff-check
6+
name: 🐶 Ruff Linter
77
language: system
88
types: [python]
9-
entry: poetry run ruff --fix
9+
entry: poetry run ruff check --fix
1010
require_serial: true
1111
stages: [commit, push, manual]
12-
- id: black
13-
name: ☕️ Format using black
12+
- id: ruff-format
13+
name: 🐶 Ruff Formatter
1414
language: system
1515
types: [python]
16-
entry: poetry run black
17-
require_serial: true
18-
- id: blacken-docs
19-
name: ☕️ Format documentation examples using black
20-
language: system
21-
files: '\.(rst|md|markdown|py|tex)$'
22-
entry: poetry run blacken-docs
16+
entry: poetry run ruff format
2317
require_serial: true
18+
stages: [commit, push, manual]
2419
- id: check-ast
2520
name: 🐍 Check Python AST
2621
language: system

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ You need at least:
8989

9090
- Python 3.11+
9191
- [Poetry][poetry-install]
92-
- NodeJS 18+ (including NPM)
92+
- NodeJS 20+ (including NPM)
9393

9494
To install all packages, including all development requirements:
9595

0 commit comments

Comments
 (0)