Skip to content

Feature/ci and build#1

Merged
MootSeeker merged 2 commits into
mainfrom
feature/ci-and-build
Mar 16, 2026
Merged

Feature/ci and build#1
MootSeeker merged 2 commits into
mainfrom
feature/ci-and-build

Conversation

@MootSeeker

Copy link
Copy Markdown
Owner

This pull request introduces automated CI for linting and building, adds configuration files for code quality, and improves the structure and reliability of the stm32_easy_flash.py script and its build process. The most important changes are grouped below:

Continuous Integration & Automation:

  • Added a GitHub Actions workflow (.github/workflows/ci.yml) to automatically lint (flake8, pylint) and build the project executable on Windows, uploading the artifact for download.

Build System & Dependencies:

  • Added a stm32_easy_flash.spec file for PyInstaller to define how the executable is built, including hidden imports for keyboard.
  • Added a requirements-build.txt file listing build dependencies (keyboard, pyinstaller).

Code Quality & Linting:

  • Introduced a .flake8 configuration file to set line length and exclude certain directories from linting.

Codebase Improvements:

  • Improved the docstring and structure of stm32_easy_flash.py, added error handling for OSError, and used a context manager (with) for running the subprocess, ensuring better resource management. [1] [2] [3]

Kevin Perillo added 2 commits March 16, 2026 08:48
- GitHub Actions CI workflow with two jobs:
  - lint: flake8 + pylint static code analysis
  - build: PyInstaller .exe generation (runs after lint passes)
- .flake8 config with max-line-length=120
- requirements.txt for runtime dependencies
- requirements-build.txt for build dependencies (PyInstaller)
- stm32_easy_flash.spec for PyInstaller one-file console .exe
- .gitignore: exclude *.spec but keep stm32_easy_flash.spec
- Fix import order: stdlib before third-party (keyboard)
- Add module docstring
- Add function docstring for flash_mcu()
- Replace bare Exception catch with OSError
- Use 'with' statement for subprocess.Popen
- Remove trailing whitespace and fix blank lines
- pylint score: 10.00/10, flake8: 0 warnings
@MootSeeker MootSeeker self-assigned this Mar 16, 2026
@MootSeeker MootSeeker added the enhancement New feature or request label Mar 16, 2026
@MootSeeker MootSeeker merged commit d74b1b1 into main Mar 16, 2026
4 checks passed
@MootSeeker MootSeeker deleted the feature/ci-and-build branch March 16, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant