Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/gen_stm32_package_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
Expand All @@ -33,5 +33,5 @@ jobs:
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide => strict 79
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics --max-doc-length 79
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics --max-doc-length 127
4 changes: 1 addition & 3 deletions .github/workflows/gen_stm32_python3_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ on:
- 'gen_stm32/**'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'setup.cfg'
- 'setup.py'
pull_request:
branches: [ master ]
paths:
- 'gen_stm32/**'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'setup.cfg'
- 'setup.py'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gen_stm32_python_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
modules_ok=0
modules=($(find gen_stm32/ tests/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 80 ]] && modules_ok=1; done
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 127 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ok || exit 1
- name: Check max number of lines in modules
id: num_line_checker
Expand Down
128 changes: 63 additions & 65 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,66 +1,64 @@
# Copyright 2018 - 2024 Vladimir Roncevic <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM debian:12
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -yq --no-install-recommends \
tree \
htop \
wget \
curl \
unzip \
ca-certificates \
openssl \
libyaml-dev \
build-essential \
gcc-arm-none-eabi \
gdb-multiarch \
libtool \
pkg-config \
autoconf \
automake \
texinfo \
libusb-1.0-0-dev

RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
RUN python3 -m pip install --upgrade setuptools
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade build
RUN rm -f get-pip.py
COPY requirements.txt /
RUN python3 -m venv env
RUN mkdir /gen_stm32/
COPY gen_stm32 /gen_stm32/
COPY setup.cfg /
COPY pyproject.toml /
COPY MANIFEST.in /
COPY setup.py /
COPY README.md /
COPY LICENSE /
RUN mkdir /tests/
COPY tests /tests/
RUN pip3 install -r requirements.txt
RUN rm -f requirements.txt
RUN python3 -m build --no-isolation --wheel
RUN pip3 install /dist/gen_stm32-*-py3-none-any.whl
RUN rm -rf /gen_stm32/
RUN rm -f setup.py
RUN rm -f README.md
RUN rm -f setup.cfg
RUN rm -f pyproject.toml
RUN rm -f MANIFEST.in
# Copyright 2018 - 2026 Vladimir Roncevic <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM debian:12
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -yq --no-install-recommends \
tree \
htop \
wget \
curl \
unzip \
ca-certificates \
openssl \
libyaml-dev \
build-essential \
gcc-arm-none-eabi \
gdb-multiarch \
libtool \
pkg-config \
autoconf \
automake \
texinfo \
libusb-1.0-0-dev

RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
RUN python3 -m pip install --upgrade setuptools
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade build
RUN rm -f get-pip.py
COPY requirements.txt /
RUN python3 -m venv env
RUN mkdir /gen_stm32/
COPY gen_stm32 /gen_stm32/
COPY pyproject.toml /
COPY MANIFEST.in /
COPY setup.py /
COPY README.md /
COPY LICENSE /
RUN mkdir /tests/
COPY tests /tests/
RUN pip3 install -r requirements.txt
RUN rm -f requirements.txt
RUN python3 -m build --no-isolation --wheel
RUN pip3 install /dist/gen_stm32-*-py3-none-any.whl
RUN rm -rf /gen_stm32/
RUN rm -f setup.py
RUN rm -f README.md
RUN rm -f pyproject.toml
RUN rm -f MANIFEST.in
RUN rm -f LICENSE
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ other information that should be provided before the modules are installed.
- [Install using docker](#install-using-docker)
- [Dependencies](#dependencies)
- [Tool structure](#tool-structure)
- [Code coverage](#code-coverage)
- [Docs](#docs)
- [Copyright and licence](#copyright-and-licence)

Expand Down Expand Up @@ -223,11 +224,11 @@ Generator structure

| Name | Stmts | Miss | Cover |
|------|-------|------|-------|
| `gen_stm32/__init__.py` | 71 | 12 | 83% |
| `gen_stm32/pro/__init__.py` | 59 | 2 | 97% |
| `gen_stm32/pro/read_template.py` | 52 | 2 | 96% |
| `gen_stm32/pro/write_template.py` | 78 | 3 | 96% |
| **Total** | 260 | 19 | 93% |
| `gen_stm32/__init__.py` | 69 | 10 | 86%|
| `gen_stm32/pro/__init__.py` | 57 | 0 | 100%|
| `gen_stm32/pro/read_template.py` | 50 | 0 | 100%|
| `gen_stm32/pro/write_template.py` | 76 | 1 | 99%|
| **Total** | 252 | 11 | 96% |

### Docs

Expand All @@ -242,7 +243,7 @@ More documentation and info at

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Copyright (C) 2018 - 2024 by [vroncevic.github.io/gen_stm32](https://vroncevic.github.io/gen_stm32)
Copyright (C) 2018 - 2026 by [vroncevic.github.io/gen_stm32](https://vroncevic.github.io/gen_stm32)

**gen_stm32** is free software; you can redistribute it and/or modify
it under the same terms as Python itself, either Python version 3.x or,
Expand Down
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/gen_stm32.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/gen_stm32.pro.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/gen_stm32.pro.read_template.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/gen_stm32.pro.write_template.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 970d8f619072b7466bcd8a5063342d06
config: f8e71ce3d2098c40253d6b70ef9abb4c
tags: 645f666f9bcd5a90fca523b33c5a78b7
24 changes: 12 additions & 12 deletions docs/build/html/_modules/gen_stm32.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>Source code for gen_stm32</h1><div class="highlight"><pre>
<span class="sd">Module</span>
<span class="sd"> __init__.py</span>
<span class="sd">Copyright</span>
<span class="sd"> Copyright (C) 2018 - 2024 Vladimir Roncevic &lt;[email protected]&gt;</span>
<span class="sd"> Copyright (C) 2018 - 2026 Vladimir Roncevic &lt;[email protected]&gt;</span>
<span class="sd"> gen_stm32 is free software: you can redistribute it and/or modify it</span>
<span class="sd"> under the terms of the GNU General Public License as published by the</span>
<span class="sd"> Free Software Foundation, either version 3 of the License, or</span>
Expand Down Expand Up @@ -74,18 +74,18 @@ <h1>Source code for gen_stm32</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">ats_utilities.exceptions.ats_type_error</span> <span class="kn">import</span> <span class="n">ATSTypeError</span>
<span class="kn">from</span> <span class="nn">ats_utilities.exceptions.ats_value_error</span> <span class="kn">import</span> <span class="n">ATSValueError</span>
<span class="kn">from</span> <span class="nn">gen_stm32.pro</span> <span class="kn">import</span> <span class="n">STM32Setup</span>
<span class="k">except</span> <span class="ne">ImportError</span> <span class="k">as</span> <span class="n">ats_error_message</span><span class="p">:</span>
<span class="c1"># Force close python ATS ##################################################</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="se">\n</span><span class="si">{</span><span class="vm">__file__</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">ats_error_message</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">ImportError</span> <span class="k">as</span> <span class="n">ats_error_message</span><span class="p">:</span> <span class="c1"># pragma: no cover</span>
<span class="c1"># Force exit python #######################################################</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="se">\n</span><span class="si">{</span><span class="vm">__file__</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">ats_error_message</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span> <span class="c1"># pragma: no cover</span>

<span class="n">__author__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://vroncevic.github.io/gen_stm32&#39;</span>
<span class="n">__author__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__copyright__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;(C) 2026, https://vroncevic.github.io/gen_stm32&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.2.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;[email protected]&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
<span class="n">__license__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;1.2.5&#39;</span>
<span class="n">__maintainer__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;[email protected]&#39;</span>
<span class="n">__status__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>


<div class="viewcode-block" id="GenSTM32">
Expand Down Expand Up @@ -255,7 +255,7 @@ <h3>Navigation</h3>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2024, Vladimir Roncevic &lt;[email protected]&gt;.
&#169; Copyright 2026, Vladimir Roncevic &lt;[email protected]&gt;.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
Expand Down
28 changes: 14 additions & 14 deletions docs/build/html/_modules/gen_stm32/pro.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1>Source code for gen_stm32.pro</h1><div class="highlight"><pre>
<span class="sd">Module</span>
<span class="sd"> __init__.py</span>
<span class="sd">Copyright</span>
<span class="sd"> Copyright (C) 2018 - 2024 Vladimir Roncevic &lt;[email protected]&gt;</span>
<span class="sd"> Copyright (C) 2018 - 2026 Vladimir Roncevic &lt;[email protected]&gt;</span>
<span class="sd"> gen_stm32 is free software: you can redistribute it and/or modify it</span>
<span class="sd"> under the terms of the GNU General Public License as published by the</span>
<span class="sd"> Free Software Foundation, either version 3 of the License, or</span>
Expand Down Expand Up @@ -73,18 +73,18 @@ <h1>Source code for gen_stm32.pro</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">ats_utilities.pro_config.pro_name</span> <span class="kn">import</span> <span class="n">ProName</span>
<span class="kn">from</span> <span class="nn">gen_stm32.pro.read_template</span> <span class="kn">import</span> <span class="n">ReadTemplate</span>
<span class="kn">from</span> <span class="nn">gen_stm32.pro.write_template</span> <span class="kn">import</span> <span class="n">WriteTemplate</span>
<span class="k">except</span> <span class="ne">ImportError</span> <span class="k">as</span> <span class="n">ats_error_message</span><span class="p">:</span>
<span class="c1"># Force close python ATS ##################################################</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="se">\n</span><span class="si">{</span><span class="vm">__file__</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">ats_error_message</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">ImportError</span> <span class="k">as</span> <span class="n">ats_error_message</span><span class="p">:</span> <span class="c1"># pragma: no cover</span>
<span class="c1"># Force exit python #######################################################</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="se">\n</span><span class="si">{</span><span class="vm">__file__</span><span class="si">}</span><span class="se">\n</span><span class="si">{</span><span class="n">ats_error_message</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span> <span class="c1"># pragma: no cover</span>

<span class="n">__author__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://vroncevic.github.io/gen_stm32&#39;</span>
<span class="n">__author__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__copyright__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;(C) 2026, https://vroncevic.github.io/gen_stm32&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.2.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;[email protected]&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
<span class="n">__license__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;1.2.5&#39;</span>
<span class="n">__maintainer__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;[email protected]&#39;</span>
<span class="n">__status__</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>


<div class="viewcode-block" id="STM32Setup">
Expand All @@ -108,8 +108,8 @@ <h1>Source code for gen_stm32.pro</h1><div class="highlight"><pre>
<span class="sd"> | gen_pro_setup - Generates STM32 project structure.</span>
<span class="sd"> &#39;&#39;&#39;</span>

<span class="n">_GEN_VERBOSE</span> <span class="o">=</span> <span class="s1">&#39;GEN_STM32::PRO::STM32SETUP&#39;</span>
<span class="n">_PRO_STRUCTURE</span> <span class="o">=</span> <span class="s1">&#39;/../conf/project.yaml&#39;</span>
<span class="n">_GEN_VERBOSE</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;GEN_STM32::PRO::STM32SETUP&#39;</span>
<span class="n">_PRO_STRUCTURE</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;/../conf/project.yaml&#39;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">verbose</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;</span>
Expand Down Expand Up @@ -233,7 +233,7 @@ <h3>Navigation</h3>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2024, Vladimir Roncevic &lt;[email protected]&gt;.
&#169; Copyright 2026, Vladimir Roncevic &lt;[email protected]&gt;.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
Expand Down
Loading
Loading