Skip to content

Commit

Permalink
Merge pull request #100 from ussserrr/dev-gui
Browse files Browse the repository at this point in the history
Release v2.1.1
  • Loading branch information
ussserrr committed Aug 9, 2021
2 parents 37e6469 + 495f901 commit 2d1c76a
Show file tree
Hide file tree
Showing 35 changed files with 2,131 additions and 2,347 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ celerybeat-schedule

# virtualenv
.venv
venv/
venv*/
ENV/

# Spyder project settings
Expand Down
337 changes: 0 additions & 337 deletions CHANGELOG.md

This file was deleted.

29 changes: 12 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
# Developing & contributing
Find actual tasks at [TODO.md list](/TODO.md) / [GitHub issues](https://github.com/ussserrr/stm32pio/issues). This file focuses on some relevant topics regarding build/test/CI processes. The code is well commented in-place and that can be considered as a developer documentation really. Some parts also can be found in the [docs](/docs) folder.
Find actual tasks at [Projects](https://github.com/ussserrr/stm32pio/projects) and [Discussions](https://github.com/ussserrr/stm32pio/discussions). This file, on the other hand, focuses on some relevant topics regarding build/test/CI processes. The code is well commented in-place and that can be considered as a developer documentation really. Some parts also can be found in the [docs](/docs) folder.


## Build
Staring from v2.0.0, the PEP517-compatible build process is supported. This process, yet described and standardized in several PEPs, is still a pretty early one and not fully adopted by official Python tools (such as pip, twine), though (at the time of publication at least). So the current way to pack is a little messy and relies on different instruments. Better use the latest Python and build packages versions.

For the dependencies list see [pyproject.toml](/pyproject.toml) file:
```shell script
$ pip install wheel setuptools setuptools_scm
```

To build a Python _wheel_ `setup.py` is not even required:
```shell script
$ pip wheel . --wheel-dir dist
```
but for the assembling of the source distribution tarball it is still necessary:
```shell script
$ python setup.py sdist
Staring from v2.0.0, the PEP517-compatible build process is supported. For the dependencies list see [pyproject.toml](/pyproject.toml) file. It is recommended to use the latest stable Python and modules versions. [build](https://pypa-build.readthedocs.io) package is used to build both wheel and source distributions. To start a process run:
```shell
$ pip install build
$ python -m build
```


## Test
Testing (code is located at the [`tests`](/tests) directory) is done via the `unittest` module from the Python standard library. It's compatible with the `pytest` runner, too. Single test stage is a CubeMX project (`.ioc` file). Several such targets can be placed inside the `fixtures` folder to test against. Then start testing specifying concrete fixture as an environment variable:
```shell script
```shell
stm32pio-repo/ $ STM32PIO_TEST_CASE=nucleo_f031k6 python -m unittest -b -v
```
Every run automatically instantiates a temporary directory (using `tempfile` module) where all the actions are performed so no repository file will be "disturbed". To run the specific group of tests or a particular test function you can use:
```shell script
```shell
stm32pio-repo/ $ python -m unittest tests.test_integration.TestIntegration
stm32pio-repo/ $ python -m unittest tests.test_cli.TestCLI.test_verbosity
```
`.ioc` files and installed tools' versions should match otherwise the CubeMX will complain about their incompatibility.


## CI/CD

**WARNING:** CI/CD is currently turned off due to the unavailability of the STM32CubeMX (no direct link provided)

Azure Pipelines is used to automate test, build, and publish tasks (see [azure-pipelines.yml](/azure-pipelines.yml), [CI](/CI) for more information). The repo is tested against the matrix of all 3 major OSes and latest Python interpreters. Also, for the Linux runs the test percentage and coverage are calculated. Therefore, for these purposes some additional external dependencies are required:
- pytest
- coverage
Expand All @@ -42,3 +35,5 @@ Azure Pipelines is used to automate test, build, and publish tasks (see [azure-p
There are some elements of the "reproducible builds" approach using several "lockfiles", isolated test fixtures and caching. Optional `platformio.ini.lockfile`, "freezing" the PlatformIO packages' versions needed for a successful build, can be placed inside an every fixture folder. This config is an ordinary .INI-style file which will be merged into the `platformio.ini` during testing.

Overall, due to a number of such a diverse tools in use, the full-fledged "canonical" CI seems challenging to implement, and the current set up is far from ideal in that regard.

Finally, in the end of a pipeline, resulting bundles are published to PyPA via twine module. This stage is enabled only for the master branch.
13 changes: 8 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2020 Andrey Chufyrev aka ussserrr
Copyright (c) 2018-present Andrey Chufyrev aka ussserrr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,17 +21,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


All parts of the source code using Qt libraries are regulated by the
respective Qt license. Please refer to Qt company contacts (e.g. website) to
obtain relevant legal resources (licenses, etc.). This project does not use
any commercial editions of Qt products.

Icons for GUI version by

Icons for GUI version by
- Flat Icons
- Google
- Pixel Perfect
- Freepik

from www.flaticon.com. All rights belong to their respective owners. I do not
own any of this content.



All other components that are used/involved in the project are subjects of their respective owners licenses unless the opposite is explicitly stated.
All other components that are used/involved in the project are subjects of
their respective owners' licenses unless the opposite is explicitly stated.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Small cross-platform Python app that can create and update [PlatformIO](https://

It uses the STM32CubeMX to generate a HAL-framework-based code and alongside creates the PlatformIO project with compatible parameters to bind them both together.

The [GUI version](/docs/GUI/README.md) is available, too (please, read this main introduction first).
The [GUI version](/docs/GUI/README.md) is available, too (but read this main introduction first, please).

![Logo](/logo/logo.png)

Expand Down Expand Up @@ -37,10 +37,17 @@ The [GUI version](/docs/GUI/README.md) is available, too (please, read this main

The app introduces zero dependencies by itself. Of course, you need to have all the necessary tools installed in order to perform the operations:
- STM32CubeMX with the desired downloaded frameworks (F0, F1, etc.). All recent versions are fine (5.x, 6.x)
- Java (JRE, Java runtime environment) for the CubeMX (already installed if the CubeMX is working). Which version is appropriate for the CubeMX you can find in its own description
- Java (JRE, Java runtime environment) for the CubeMX. Starting from CubeMX v6.3.0 Java is included in the bundle (in form of a `jre` folder sitting alongside the executable) so you don't need to install it by yourself from now on. Hence, it can be omitted in the `stm32pio.ini` config file **except Windows** where it is still **highly recommended** to run CubeMX via `java.exe`. As mentioned, Java exists already, the only difference is that it is still will be listed in the default `stm32pio.ini` config. You can refer to STM32CubeMX own documentation to obtain more information on current situation if, suddenly, something will change in this regard
- PlatformIO (4.2.0 and above) CLI (most likely is already present if you have installed it via some package manager (`pip`, `apt`, `brew`, etc.) or need to be installed as a "command line extension" from the PlatformIO IDE (see its [docs](https://docs.platformio.org/en/latest/core/installation.html#piocore-install-shell-commands) for more information))

If you, for some reasons, don't want to (or simply cannot) install (i.e. register in PATH) command line versions of these applications in your system, you can always specify the direct paths to them overriding the default values in the project configuration file `stm32pio.ini`. Check the [config reference](/docs/CONFIG.md) to see all possible ways of telling stm32pio where the tools are residing on your machine.
If you, for some reasons, don't want to (or cannot) install (i.e. register in PATH) command line versions of these applications in your system, you can always specify the direct paths to them overriding the default values in the project configuration file `stm32pio.ini`. Check the [config reference](/docs/CONFIG.md) to see all possible ways of telling stm32pio where the tools are residing on your machine.


## Documentation
- [CLI commands](/docs/CLI/COMMANDS.md)
- [Config](/docs/CONFIG.md)
- [Example (CLI)](/examples/cli)
- [GUI](/docs/GUI/README.md)


## Installation
Expand Down
129 changes: 0 additions & 129 deletions TODO.md

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
Expand Down
Loading

0 comments on commit 2d1c76a

Please sign in to comment.