Releases: ussserrr/stm32pio
Releases · ussserrr/stm32pio
2.1.2
Changelog
Big refactoring release with a couple new features.
Core
New
.ioc
config inspection feature – such files can now be parsed and analyzed by stm32pio:- check recommended options like "Couple .c/.h files" and so on
- find potential mismatches between PlatformIO/CubeMX board/MCU
- Adopt suggested
board_build.stm32cube.custom_config_header
PlatformIO option (#26) - Preserve a comment header of
platformio.ini
file after patching
Changes
- Lighten the core
Stm32pio
class:- take out all methods bodies into separate modules and make the class mostly a context container
- get rid of
instance_options
in constructor
- Logging:
from_subprocess=True
flag can now be used directly, withoutextra
argument- Special logging cases is now listed in enum
LogPipe
now accumulates data only when explicitly said to, also the algorithm is more efficient
CLI
New
- Utilize new
inspect_ioc
feature forgenerate
,pio_init
,patch
andnew
commands
Changes
- Improved wording/statements
- All shebangs are now referring to
python
instead ofpython3
- Remove redundant
try...except
in__main__.py
Meta
Changes
- Actualized docs, schemas, issues
- Adopt RST docstring style (partially)
2.1.1
Changelog
Mostly a maintenance release. It focuses mainly on GUI codebase reorganization and structuring, also fixes some old GUI bugs and modernizes a build process.
Core/CLI
Changes
- Improve
__main__.py
- As usual, update test
.ioc
file - Reflect new CubeMX Java politics (it is now included in the bundle)
GUI
New
- Structured codebase:
- dedicated QML folder
- QML modules in separate files
- split Python backend, too
- Add a link to the LICENSE file in the "About" window
- Specify Python module name on every
module_logger
message
Changes
- More extensive usage of Qt abstract models API
- Less console logs on non-verbose mode
- Speed up glowing animation
Fixes
- GUI-invoking scripts
- Explicitly stop project initialization thread on app shutdown
- Do not use
QApplicaion
subclass (causes segfaults) Qt.quit()
can now be used safely- Fix several freshly introduced errors caused by accessing already destroyed objects from the QML side
Tests
New
plant_multiple_fixtures.py
script - auto-create a bunch of identical projects for manual testing
Changes
- Remove GUI invocation test (GUI codebase is not really ready and the test is not so useful anyway)
- Turn off CI (Azure Pipelines). Unfortunately, new versions of STM32CubeMX are not available via direct links so any automated tests seems impossible for now
Meta
New
- Migrate TODO.md to GitHub Issues/Projects/Discussions
- Migrate to newer build/packaging pipeline:
PyPA/build
package for building both wheel and source distributionssetup.py
is not needed anymore
- Get rid of CHANGELOG.md – use GitHub Releases page instead (current one is saved on GitHub Wiki for history purposes)
Changes
- Update LICENSE (explicitly mention Qt as they have strong intentions about legal aspects)
ver. 2.1.0
- New: "validate environment" API. Allows to quickly verify tools specified in the config (+ corresponding test). Currently, implemented only for the CLI version
- New: store the most recent exception in the
last_error
config file parameter (currently CLI-only) (+ corresponding test) - New: add shorthands for all CLI options (single-letters, e.g.
-c/--with-build
) - New: ignore list settings API: specify files/folders/patterns to ignore during the cleanup (hence, new
clean()
method, tests) - New: alternatively, use
git clean
as a removal tool - New: API to store the current project folder' content as ignore list in the config file
- New: CONTRIBUTING.md guide (more like developing notes actually)
- New: COMMANDS.md reference
- New: CONFIG.md reference
- New: project config reference (a little too many parameters now)
- New: Python 3.9 CI runner
- New: log when the config is merging with another one (DEBUG verbosity level)
- New: handle filenames with whitespaces (both tools/project files) (#21)
- Fixed:
clean()
method doesn't look for the determined.ioc
file but does it by itself which can cause some unwanted behavior (potential data loss) - Fixed: remove done/forgotten TODOs
- Fixed: update embedding example to match the current API
- Fixed:
setup.cfg
: specify supported PySide2 version - Fixed:
setup.cfg
: PyPA parsing issues - Fixed: revert default CubeMX paths that seems more widespread among users
- Fixed: GUI. Recursive layout warning in Settings window
- Fixed: GUI. Remove the
ProjectID
parameter for theinitialized
signal to get rid of the annoying Shiboken overflow error - Changed: bump up CubeMX, packages, test
.ioc
file, PlatformIO versions (both for local and CI builds) - Changed: a completely revised documentation/examples/TODOs structure
- Changed: spawn project-state-related code to the
state.py
module - Changed: spawn logging-related code to the
logging.py
module - Changed: separate config from the main class (new
config.py
module) - Changed: rename
lib.py
->project.py
module - Changed: move available config "None" options to the
settings
module (none_options
) - Changed: separate CubeMX invoking code (new project's private
_cubemx_execute_script()
method) - Changed: edit output behavior in case of occurred error in the
generate_code()
function - Changed: do not cast strings where we can use path-like objects
- Changed: pretty config printer (
__str__()
implementation, justprint(project.config)
, that's all) - Changed: remove
util.configparser_to_dict()
function (ConfigParser
is already conforms with mapping protocol) - Changed: takeout valid user response options to
settings.py
(yes_options
/no_options
) - Changed: group and move CI-related code in the
settings.py
- Changed: remove
f"{STAGE_PATH.name}.ioc"
occurrences in tests - Changed: move
test_clean()
to unit tests - Changed: GUI. Remove
go_to_this
option for theaddListItem
method (instead invoke on the list model) - Changed: GUI. Implicitly pass the parent to the project constructor in
addListItem
method
ver. 2.0.0
Hello! Long time no see!
- New: introducing CI/CD via Azure Pipelines. I tried to make as "general" system as possible with isolated environments, reproducible builds, etc. Due to a number of such a different tools in use and scattered infrastructure around them this task is very complex and the current configuration is far from ideal though
- New: new project structure. All packages (core, CLI, GUI) are consolidated under the common
stm32pio
Python namespace - New: app version is completely removed from the repo and is "computed" at build-time from the VCS (GIT) current tag (using setuptools_scm). At run-time the version obtaining process depends: for newer Python it can be retrieved from a package metadata, for older one there is an auto-generated
version.py
file with a value stored in it - New: support multiple test fixtures to test against a different targets (e.g. lightweight
nucleo_f031k6
project + real-lifef103
and so on) - New: new build system. Use modern tools such as
pyproject.toml
, declarativesetup.cfg
, PEP-517 and so on. However in the middle of the development process it became evident that such a workflow is still early and not so common and there are simply not enough tools to implement it gracefully (e.g. no official tool to build bothdist
source tarball andwheel
) - New: CLI.
patch
command. With this function now all meaningful (for end-user) methods of theStm32pio
class are mapped by CLI commands and match corresponding buttons from the GUI version so the similar workflow can be applied:- Initialize -
stm32pio init
- Generate -
stm32pio generate
- Init PlatformIO -
platformio project init
- Patch -
stm32pio patch
- Build -
platformio run
- Initialize -
- New: CubeMX now can be invoked directly, without Java command need to be specified
- New: add dedicated
initialized
signal toProjectListItem
- New: basic GUI tests (just make sure all imports are fine and the app at least starts)
- Fixed: revise config handling: more robust and straightforward procedure to merge the final runtime config from different sources (fix the reported problem). Adjust corresponding test
- Fixed: GUI. Add
project.lastActionSucceed
property to fix some visual behavior (bold borders remains after an error) - Changed: migrate to Semantic Versioning (2.0.0). The next version (i.e. this one) was supposed to be 1.40 so with semver – 1.4.0. This can be confusing for some automatic tools in the future to correctly find out which version is latter though so this version will be marked with 2.0.0 tag to start things over
- Changed: remove board absence warning in
Stm32pio
constructor (this should be done outside) - Changed: take out to the
settings.py
a strings that we looked for to determine successful CubeMX code generation - Changed: use newer
platformio project init
command, use verbose versions of CLI arguments
ver. 1.30
Again, add some bugs, fix new features fix some bugs, add new features. Changes:
- New:
examples
folder (currently, only an embedding one (updated and moved from the wiki page)) - New:
docs
folder with some useful internal descriptions (currently, only a logging schematic (with sources)) - New: issues guide for GitHub (OS, content of the config, project tree, enable verbose, etc.)
- New: GUI. Show the app version in "About" dialog
- New: GUI. Handle a theoretical app loading error
- New: GUI. Notify a user that the "board" parameter is empty
- New: GUI. The app can be started from CLI
- New: GUI.
ProjectListItem.fromStartup
property - New: GUI. Expose projects'
config
to QML - New: Tests. Preserving user files and folders on regeneration
- New: Tests. 'verbose' and 'non-verbose' tests as
subTest
(alsoshould_log_error_...
) - New: Inform a user that given parameters have overridden the config ones
- Fixed: GUI.
TypeError: Cannot read property 'actionRunning' of null
(deconstruction order) (on project deletion only) - Fixed: GUI. The app now can handle as many projects as needed (use QML
DelegateModel
to store state in theListView
delegate) - Fixed: #13 (new parsing algo to analyze the CubeMX output)
- Changed: improved
typing
annotations - Changed: wrap imports into
try...except
- Changed: new README logo, add sources (draw.io)
- Changed: GUI. Icons instead of a text for "Clean", "Open editor"
- Changed: GUI. Gray out "stage" line in all projects except current
- Changed: GUI. 2 types of logging formatters for 2 verbosity levels
- Changed: GUI. More general
goToProject
signal instead ofduplicateFound
- Changed: GUI. Projects list is now saves to
Settings
in a separate thread usingQThreadPool
andsaveInSettings()
method - Changed: GUI.
ProjectsList.each_project_is_duplicate_of
generator - Changed: GUI. Optimized project'
state
handling - Changed: GUI. Insert board ID from config, if there is one, focus on that input field by default
- Changed: logging mechanics is remade from scratch:
- add
stm32pio.app.setup_logging()
,should_setup_logging
argument fostm32pio.app.setup_main()
. This also fixes annoying logging errors on testing because the loggers interfere with each other stm32pio.util.ProjectLoggerAdapter()
subclass as an individual logger for every project- add
stm32pio.util.log_current_exception()
- get rid of
log_record_factory
substitution - add
stm32pio.util.Verbosity
entity (enum). Acts like an additional degree of freedom for the logging setup - rewritten
stm32pio.util.DispatchingFormatter
- GUI. New
BuffersDispatchingHandler()
class - and some others (see block schema)
- add
- Changed: better parameters and configs merging
- Changed: make
platformio_ini_is_patched
a property instead of function - Changed: improved in-code docs
ver. 1.21
ver. 1.20
GUI version is out of beta! 🎉 Obviously there is still a work to do but the app now is more usable and also has many new features:
- New: GUI. System tray notifications when the main window is not in the foreground (can be turned off in the settings)
- New: GUI. Drag-and-drop folder(s) to add
- New: GUI. README, screenshots, diagrams
- New: GUI. Catch projects duplication on appending
- New: GUI. Mark the list item when the action is done and it is not a current item
- New: GUI. Highlight the actions that were picked for the series
- New: GUI. setuptools
extras
option to install the GUI version via pip - New: GUI. Wrap imports into
try...catch
- New: GUI. Reset settings feature
- New: GUI. New
ProjectListItem
members:_from_startup
flag,_current_action
string with corresponding properties and signals - New: GUI. More extensive use of the
typing
annotations - New: GUI. Allow to pass extra setter functions to the
Settings
which will be called on the value change - New: allow to specify the
.ioc
file instead of the directory. Check that.ioc
is a non-empty text file - Fixed: GUI. Projects are not destructed until the app shutdown
- Fixed: GUI. Settings dialog doesn't correctly represents the parameters
- Fixed: GUI. Settings on Windows (case-sensitive vs insensitive situation)
- Fixed: GUI. List item loader
- Fixed: GUI. Flaws when index changes
- Changed: GUI. Clean the logs too when invoking the 'Clean' action
- Changed: GUI. Stop the chain of commands if someone drops -1 or an exception
- Changed: GUI. Use Qt StateMachine to control the visual appearance of the project action button
- Changed: GUI. Rename the module
stm32pio-gui
->stm32pio_gui
- Changed: GUI. Better printing of exception messages
- Changed: GUI. Revised finalizer (similar to core version)
- Changed: GUI. Cache
state
andstate.current_stage
both for back- and frontend to reduce IO operations - Changed: GUI. rename
ProjectActionWorker
->Worker
(as it is used for the variety of tasks) and some of its internals - Changed: GUI. Pass
Settings
prefix as an argument for the constructor - Changed: GUI. Move more stuff inside the
main()
function, less global variables - Changed: exclude screenshots from the setuptools bundle
- Changed: restructure TODO.md into sections
- Changed: remove
from __future__ import annotations
statements
ver. 1.10 (15.03.20)
This release mainly focusing on the core library features that have been put aside by the time of the GUI version development.
- New: table of contents for the README
- New: GitHub project wiki
- New:
-q/--quiet
option for theclean
CLI command. The command now by default warns the user about the content deletion - New: embedding example (minimal reproducible code snippet, easier than the full CLI or GUI versions)
- New: show the exception name too when the global error has been caught (
stm32pio/app.py
) - New: sanitize
--start-editor
option value usingshlex.quote()
- New: parse
platformio.ini
to establish its correctness when checking for project states (ProjectStage.PIO_INITIALIZED
,ProjectStage.PATCHED
) - New: projects are now portable. The user specifying paths relatively to the project folder and using variables (we still don't use
configparser
interpolation but there is no need in it). The backwards compatibility with the old-style config format has been preserved though those projects still will be non-portable unless you manually edit a config - New: analyze STM32CubeMX output to detect errors on execution. This utility does not necessarily returns non-zero code when some error was happened (e.g.
.ioc
and app versions mismatch and so on), and just shows a dialog - New:
platformio_ini_config
Stm32pio
instance property returning currentplatformio.ini
parsedConfigParser
value. Used in some internal routines such as correctness determination and doesn't have to be used by the library user - New:
LogPipe
now returns "remote control"LogPipeRC
- small utility class holding the writable stream and the reference to the string accumulating all incoming messages. It can be accessed later, in the end of the context manager, to store and analyze all the output - New: some new tests, I think, but I do not remember as all the tests are now moved to the new files :)
- Fixed: warnings appearing during the
pio_build()
execution were suppressed - Changed: tests are moved out to the root of the repo and excluded from the distribution bundle
- Changed: went back to the PlatformIO CLI as a single point to interact with PlatformIO (remove
platformio
package imports and dependencies) (the reason is crushes when the pio is not isolated in a separated subprocess). Use PlatformIO JSON format output to get and filter boards - Changed: remove
required=False
fromargparse
commands as it is a default (and even recommended) value anyway - Changed: remove the unnecessary logging setup when no arguments were given to the program (CLI version)
- Changed: separate
Stm32pio
arguments onto 2 categories: project parameters and instance options and use dictionaries for them. First one has now the same form as the project configconfigparser.ConfigParser
and merging into the default and file settings on the project creation. Instance options are more related to the programmatic instance itself and contains currently 2 options -logger
andsave_on_destruction
- Changed: use
append()
instead ofinsert()
to modifysys.path
- Changed: when raising the exceptions use more elegant expressions (e.g.
raise FileNotFoundError(file)
instead ofraise FileNotFoundError("file FILE was not found")
). Usepathlib.Path().resolve(strict=True)
where appropriate to shorten the code
ver. 1.0 (06.03.20)
- New: introduce GUI version of the app (beta)
- New: redesigned stage-state machinery - integrates seamlessly into both CLI and GUI worlds. Python
Enum
represents a single stage of the project (e.g. "code generated" or "project built") while the special dictionary unfolds the full information about the project i.e. combination of all stages (True/False). Implemented in 2 classes -ProjectStage
andProjectState
, though theStm32pio.state
property is intended to be a user's getter. Both classes have human-readable string representations - New: related to previous -
status
CLI command - New:
util.py
module (yes, now the name matches the functionality it provides) - New: logging machinery - adapting for more painless embedding the lib in another code.
logging.Logger
objects are now individual unique attributes of everyStm32pio
instance so it is possible to distinguish which project is actually produced a message (not so useful for a current CLI version but for other applications, including GUI, is).LogPipe
context manager is used to redirectsubprocess
output to thelogging
module.DispatchingFormatter
allows to specify differentlogging
' formatters depending on the origin of the log record. SubstitutedLogRecordFactory
handles custom flags to.log()
functions family - Changed: imporoved README
- Changed:
platformio
package is added as a requirement and is used for retrieving the boards names (util.py
->get_platformio_boards()
). Expected to become the replacement for all PlatformIO CLI calls - Changed: Markdown markup for this changelog
- Changed: bump up
.ioc
file version - Changed: removed final "exit..." log message
- Changed: removed
Config
subclass and move itssave()
method back to the mainStm32pio
class. This change serves 2 goals: ensures consistency in the possible operations list (i.e.init
,generate
, etc.) and makes possible to register the function at the object destruction stage viaweakref.finilize()
- Changed: removed
_resolve_board()
method as it is not needed anymore - Changed: renamed
_load_config_file()
->_load_config()
(hide implementation details) - Changed: use
logger.isEnabledFor()
instead of manually comparing logging levels - Changed: slightly tuned exceptions (more specific ones where it make sense)
- Changed: rename
project_path
->path
- Changed: actualized tests, more broad usage of the
app.main()
function versussubprocess.run()
ver. 0.96 (17.12.19)
(mostly) bug-fixing release
Changelog
- Fix:
generate_code()
doesn't destroy the temp folder after execution - Fix: improved and actualized docs, comments, annotations
- Changed: print Python interpreter information on testing
- Changed: move some asserts inside
subTest
context managers - Changed: rename
pio_build()
=>build()
method - Changed: take out to the
settings.py
the width of the field in the log format string - Changed: use file statistics to check its size instead of reading the whole content
- Changed: more logging output
- Changed: change some methods signatures to return result value