Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom template for release notes (GH action) #2

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

tomassebestik
Copy link
Member

@tomassebestik tomassebestik commented Sep 10, 2024

Description

Custom template that can extract the "Release notes" relevant to the current release for an automated release process.

Check the workflow file in #3 – this is a fully automated release process triggered by pushing a Git tag. The process is based on workflows from the project espressif/esptool.

This workflow will generate Release notes or a partial changelog (without a title, header, or footer), containing only the records for the specific release.

The following example command generates the changelog for the release version v4.8.0, using the internal template for release notes and writing the partial changelog to a file:

cz changelog v4.8.0 --template="RELEASE_NOTES.md.j2" --file-name="Release_notes.md"

Something similar is now available in espressif/esptool, but the key differences here are:

  • The template for Release notes is part of this plugin, so there’s no need to include it in the target repo. It's maintained centrally, saving the project admin time from setup and troubleshooting.
  • This approach ensures a consistent style across different Espressif projects.
  • Settings (tweaks) for the changelog are automatically applied to the Release notes as well. For example, if a repo admin disables the display of authors in the changelog, the same setting will be applied to the Release notes snippet.

Additional features:

  • An optional parameter release_notes_footer has been added for the target project. This allows the project owner to append a custom footer to the Release notes snippet, defined in the project's pyproject.toml (or cz.toml).
  • There are examples available: one without a footer (default) - docs/Release_notes_example.md and one with a custom footer - docs/Release_notes_example_with_footer.md. Both examples are based on espressif/esptool.

Screenshots

Changelog before:

Changelog with this plugin:


Release notes before:

Release notes with this plugin:


Try it

# (if this plugin already installed before uninstall for this test)
pip uninstall czespressif commitizen  -y

# test release (1.0.1.dev3) for this PR review only
pip install czespressif==1.0.1.dev3

Copy link

github-actions bot commented Sep 10, 2024

Messages
📖 You might consider squashing your 3 commits (simplifying branch history).

👋 Hello tomassebestik, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against fcba4a9

@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch 2 times, most recently from e74e660 to ba02913 Compare September 11, 2024 04:31
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from ba02913 to bf91b66 Compare September 11, 2024 04:37
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch 2 times, most recently from d0e8e2f to 5501214 Compare September 11, 2024 05:09
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 5501214 to d378e3c Compare September 11, 2024 05:31
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from d378e3c to 4a81ddd Compare September 11, 2024 05:34
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 4a81ddd to 84c90ef Compare September 11, 2024 05:45
@tomassebestik tomassebestik self-assigned this Sep 11, 2024
@tomassebestik tomassebestik marked this pull request as ready for review September 11, 2024 14:20
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 340335f to 79a4e54 Compare September 11, 2024 14:21
@radimkarnis
Copy link
Collaborator

radimkarnis commented Sep 12, 2024

Running cz changelog v4.6.2 --template="RELEASE_NOTES.md.j2" --file-name="Release_notes.md" results in jinja2.exceptions.TemplateNotFound: RELEASE_NOTES.md.j2.

I have installed the plugin globally with pip install czespressif==1.0.1.dev2

Even if I download the template and point to it manually, the error prevails:

$ cz changelog v4.6.2 --template ~/Downloads/RELEASE_NOTES.md.j2 --file-name="Release_notes.md"

Traceback (most recent call last):
...
jinja2.exceptions.TemplateNotFound: /Users/radim/Downloads/RELEASE_NOTES.md.j2
$ cat /Users/radim/Downloads/RELEASE_NOTES.md.j2

{# This changelog template is used for automatically generated GH release notes. #}
{# It is passed to commitizen's --template option in a GH Actions workflow run. #}

{% import 'macros.md.j2' as macros %}

{# ---TEMPLATE #}
{% for release in tree %}{# ---Release version #}

{# keep empty line above this comment #}
...

@radimkarnis
Copy link
Collaborator

Thanks for the changelog template implementation! This now (in theory) looks ready for all of our use cases.

@tomassebestik
Copy link
Member Author

@radimkarnis I couldn't replicate this either in fresh Docker or natively on Mac Mini M1 aarch64 (which should be same architecture you have):

... i tested with clone of esptool from Github:

...(expand) see the process on BrnoMAC0006 ....
espressif@BrnoMAC0006:~/test-plugin/esptool $ uname -a
Darwin BrnoMAC0006.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:21 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8103 arm64

espressif@BrnoMAC0006:~/test-plugin/esptool $ python -V
Python 3.9.20

espressif@BrnoMAC0006:~/test-plugin/esptool $ pip list | grep commitizen
commitizen         3.29.0



[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip

espressif@BrnoMAC0006:~/test-plugin/esptool $ pip list | grep czespressif
czespressif        1.0.1.dev2

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip

espressif@BrnoMAC0006:~/test-plugin/esptool $ pip show -f czespressif
Name: czespressif
Version: 1.0.1.dev2
Summary: Commitizen tools plugin with Espressif code style
Home-page: 
Author: Espressif Systems
Author-email: Tomas Sebestik <[email protected]>
License: Copyright 2024 Espressif
        ...  # here full license text, redacted
Location: /Users/espressif/.pyenv/versions/3.9.20/lib/python3.9/site-packages
Requires: commitizen
Required-by: 
Files:
  czespressif-1.0.1.dev2.dist-info/INSTALLER
  czespressif-1.0.1.dev2.dist-info/LICENSE
  czespressif-1.0.1.dev2.dist-info/METADATA
  czespressif-1.0.1.dev2.dist-info/RECORD
  czespressif-1.0.1.dev2.dist-info/REQUESTED
  czespressif-1.0.1.dev2.dist-info/WHEEL
  czespressif-1.0.1.dev2.dist-info/entry_points.txt
  czespressif-1.0.1.dev2.dist-info/top_level.txt
  czespressif/__init__.py
  czespressif/__pycache__/__init__.cpython-39.pyc
  czespressif/__pycache__/config.cpython-39.pyc
  czespressif/__pycache__/czespressif.cpython-39.pyc
  czespressif/__pycache__/defaults.cpython-39.pyc
  czespressif/__pycache__/example.cpython-39.pyc
  czespressif/__pycache__/questions.cpython-39.pyc
  czespressif/config.py
  czespressif/czespressif.py
  czespressif/defaults.py
  czespressif/example.py
  czespressif/questions.py
  czespressif/templates/CHANGELOG.md.j2
  czespressif/templates/RELEASE_NOTES.md.j2    # <--- template file is here
  czespressif/templates/macros.md.j2
  tests/__pycache__/test_czespressif.cpython-39.pyc
  tests/test_czespressif.py

espressif@BrnoMAC0006:~/test-plugin/esptool $ cz changelog v4.6.2 --template="RELEASE_NOTES.md.j2" --file-name="Release_notes.md"

espressif@BrnoMAC0006:~/test-plugin/esptool $ cat Release_notes.md 
### 🐛 Bug fixes

- **CH9102F**: Suggest to install new serial drivers if writing to RAM fails *(radim.karnis - f4b5914)*
- **compressed upload**: Accept short data blocks with only Adler-32 bytes *(radim.karnis - d984647)*

### 📖 Documentation

- **boot-log**: fix list formatting *(Peter Dragun - b137d3d)*
- add c2, c6 and h2 as build targets *(Peter Dragun - 590fb55)*
- add explanation for flash_id example to avoid confusion *(Peter Dragun - fbe8066)*


# --- now switch to clean venv:



espressif@BrnoMAC0006:~/test-plugin/esptool $ python -V
Python 3.9.20

espressif@BrnoMAC0006:~/test-plugin/esptool $ python -m venv venv
espressif@BrnoMAC0006:~/test-plugin/esptool $ . venv/bin/activate
(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ echo $VIRTUAL_ENV
/Users/espressif/test-plugin/esptool/venv

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool # pip list
Package    Version
---------- -------
pip        23.0.1
setuptools 58.1.0

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ pip install czespressif==v1.0.1.dev2                                               
Collecting czespressif==v1.0.1.dev2
  Using cached czespressif-1.0.1.dev2-py3-none-any.whl (23 kB)
Collecting commitizen>=3.29.0
  Using cached commitizen-3.29.0-py3-none-any.whl (70 kB)
Collecting importlib_metadata<9,>=8.0.0
  Using cached importlib_metadata-8.5.0-py3-none-any.whl (26 kB)
Collecting packaging>=19
  Using cached packaging-24.1-py3-none-any.whl (53 kB)
Collecting charset-normalizer<4,>=2.1.0
  Using cached charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl (120 kB)
Collecting jinja2>=2.10.3
  Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting argcomplete<3.6,>=1.12.1
  Using cached argcomplete-3.5.0-py3-none-any.whl (43 kB)
Collecting questionary<3.0,>=2.0
  Using cached questionary-2.0.1-py3-none-any.whl (34 kB)
Collecting tomlkit<1.0.0,>=0.5.3
  Using cached tomlkit-0.13.2-py3-none-any.whl (37 kB)
Collecting termcolor<3,>=1.1
  Using cached termcolor-2.4.0-py3-none-any.whl (7.7 kB)
Collecting colorama<0.5.0,>=0.4.1
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting decli<0.7.0,>=0.6.0
  Using cached decli-0.6.2-py3-none-any.whl (7.9 kB)
Collecting pyyaml>=3.08
  Using cached PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl (172 kB)
Collecting zipp>=3.20
  Using cached zipp-3.20.1-py3-none-any.whl (9.0 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl (18 kB)
Collecting prompt_toolkit<=3.0.36,>=2.0
  Using cached prompt_toolkit-3.0.36-py3-none-any.whl (386 kB)
Collecting wcwidth
  Using cached wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Installing collected packages: wcwidth, zipp, tomlkit, termcolor, pyyaml, prompt_toolkit, packaging, MarkupSafe, decli, colorama, charset-normalizer, argcomplete, questionary, jinja2, importlib_metadata, commitizen, czespressif
Successfully installed MarkupSafe-2.1.5 argcomplete-3.5.0 charset-normalizer-3.3.2 colorama-0.4.6 commitizen-3.29.0 czespressif-1.0.1.dev2 decli-0.6.2 importlib_metadata-8.5.0 jinja2-3.1.4 packaging-24.1 prompt_toolkit-3.0.36 pyyaml-6.0.2 questionary-2.0.1 termcolor-2.4.0 tomlkit-0.13.2 wcwidth-0.2.13 zipp-3.20.1

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ pip list | grep cz
czespressif        1.0.1.dev2

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ pip list | grep commitizen
commitizen         3.29.0

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ cz changelog v4.6.2 --template="RELEASE_NOTES.md.j2" --file-name="Release_notes.md"
(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ cat Release_notes.md                                                                         
### 🐛 Bug fixes

- **CH9102F**: Suggest to install new serial drivers if writing to RAM fails *(radim.karnis - f4b5914)*
- **compressed upload**: Accept short data blocks with only Adler-32 bytes *(radim.karnis - d984647)*

### 📖 Documentation

- **boot-log**: fix list formatting *(Peter Dragun - b137d3d)*
- add c2, c6 and h2 as build targets *(Peter Dragun - 590fb55)*
- add explanation for flash_id example to avoid confusion *(Peter Dragun - fbe8066)*

(venv) espressif@BrnoMAC0006:~/test-plugin/esptool $ cat pyproject.toml
[build-system]
    requires = ["setuptools>=64"]
    build-backend = "setuptools.build_meta"

[project]
    name = "esptool"
    authors = [
        {name = "Fredrik Ahlberg (themadinventor)"},
        {name = "Angus Gratton (projectgus)"},
        {name = "Espressif Systems"}
    ]
    readme = {file = "README.md", content-type = "text/markdown"}
    license = {text = "GPLv2+"}

    ...
...

[tool.commitizen]
    version = "4.7.0"
    update_changelog_on_bump = true
    tag_format = "v$version"
    changelog_start_rev = "v4.2.1"
    changelog_merge_prerelease = true
    annotated_tag = true
    bump_message = "change: Update version to $new_version"
    name = "czespressif"
    version_files = [
        "esptool/__init__.py:__version__"
    ]
    release_notes_footer = ""

...

@peterdragun Helped me to test the same on another machine - also no issues. I'm almost sure that this is related to something in your system (previous version of commitizen or some of its dependencies).

@radimkarnis Can you please help me debug what it happening to you?:

  1. please run thi (from esptool directory) and give here the output:
clear;set -x; python -V; pip list; pip show -f czespressif; cat pyproject.toml; set +x
  1. did you run pip uninstall czespressif commitizen -y before installing plugin, as describen in this PR description?

  2. does it work in venv for you?

Copy link
Collaborator

@peterdragun peterdragun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you, this is a nice addition!

As mentioned, I have tested this on my macOS, python3.12, a fresh clone of esptool in virtual env. Everything seems to work as expected for me.

@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 79a4e54 to 7300083 Compare September 13, 2024 09:07
@radimkarnis
Copy link
Collaborator

clear;set -x; python -V; pip list; pip show -f czespressif; cat pyproject.toml; set +x
+-zsh:274> python -V
Python 3.10.9
+-zsh:274> pip list
Package                        Version     Editable project location
------------------------------ ----------- -----------------------------
actdiag                        3.0.0
alabaster                      0.7.16
argcomplete                    3.2.2
asn1crypto                     1.5.1
Babel                          2.14.0
backports.tarfile              1.2.0
bitarray                       2.9.2
bitstring                      4.1.4
black                          24.3.0
blockdiag                      3.0.0
breathe                        4.35.0
build                          1.2.1
cached-property                1.5.2
cairocffi                      1.6.1
CairoSVG                       2.5.1
certifi                        2024.2.2
cffi                           1.16.0
cfgv                           3.4.0
charset-normalizer             3.3.2
click                          8.1.7
colorama                       0.4.6
commitizen                     3.29.0
commonmark                     0.9.1
construct                      2.10.70
coverage                       6.5.0
cryptography                   42.0.5
cssselect2                     0.7.0
czespressif                    1.0.1.dev2
decli                          0.6.1
defusedxml                     0.7.1
distlib                        0.3.8
docutils                       0.17.1
ecdsa                          0.18.0
esp-coredump                   1.10.0
esp-docs                       1.10.2
esp-gpio-tool                  0.0.0       /Users/radim/GL/esp-gpio-tool
esp-idf-monitor                1.4.0
esp-idf-panic-decoder          1.0.1
esptool                        4.7.0
exceptiongroup                 1.2.0
filelock                       3.13.1
funcparserlib                  2.0.0a0
identify                       2.5.35
idna                           3.6
imagesize                      1.4.1
importlib-metadata             7.0.1
iniconfig                      2.0.0
intelhex                       2.3.0
jaraco.classes                 3.4.0
jaraco.context                 6.0.1
jaraco.functools               4.0.2
Jinja2                         3.1.3
keyring                        25.3.0
markdown-it-py                 3.0.0
MarkupSafe                     2.1.5
mdurl                          0.1.2
more-itertools                 10.4.0
mypy-extensions                1.0.0
nh3                            0.2.18
nodeenv                        1.8.0
nwdiag                         2.0.0
packaging                      23.2
pathspec                       0.12.1
Pillow                         9.5.0
pip                            24.2
pkginfo                        1.10.0
platformdirs                   4.2.0
pluggy                         1.4.0
pre-commit                     3.6.2
prompt-toolkit                 3.0.36
pycparser                      2.21
pyelftools                     0.30
pygdbmi                        0.11.0.0
Pygments                       2.17.2
pyproject_hooks                1.1.0
pyserial                       3.5
pytest                         8.0.2
pytest-rerunfailures           13.0
python-pkcs11                  0.7.0
PyYAML                         6.0.1
questionary                    2.0.1
readme_renderer                44.0
recommonmark                   0.7.1
reedsolo                       1.5.4
requests                       2.31.0
requests-toolbelt              1.0.0
rfc3986                        2.0.0
rich                           13.7.1
ruff                           0.4.8
seqdiag                        3.0.0
setuptools                     65.5.0
six                            1.16.0
snowballstemmer                2.2.0
Sphinx                         4.5.0
sphinx-copybutton              0.5.0
sphinx-idf-theme               1.1.0
sphinx-notfound-page           0.8.3
sphinx_selective_exclude       1.0.3
sphinxcontrib-actdiag          3.0.0
sphinxcontrib-applehelp        1.0.4
sphinxcontrib-blockdiag        3.0.0
sphinxcontrib-devhelp          1.0.2
sphinxcontrib-htmlhelp         2.0.1
sphinxcontrib-jsmath           1.0.1
sphinxcontrib-nwdiag           2.0.0
sphinxcontrib-qthelp           1.0.3
sphinxcontrib-seqdiag          3.0.0
sphinxcontrib-serializinghtml  1.1.5
sphinxcontrib-svg2pdfconverter 1.2.0
sphinxcontrib-wavedrom         3.0.4
svgwrite                       1.4.3
termcolor                      2.4.0
tinycss2                       1.2.1
tomli                          2.0.1
tomlkit                        0.12.4
twine                          5.1.1
typing_extensions              4.10.0
urllib3                        2.2.1
virtualenv                     20.25.1
wavedrom                       2.0.3.post3
wcwidth                        0.2.13
webcolors                      1.13
webencodings                   0.5.1
wheel                          0.44.0
xcffib                         1.5.0
zipp                           3.17.0
+-zsh:274> pip show -f czespressif
Name: czespressif
Version: 1.0.1.dev2
Summary: Commitizen tools plugin with Espressif code style
Home-page: https://github.com/espressif/cz-plugin-espressif/
Author: Espressif Systems
Author-email: Tomas Sebestik <[email protected]>
License: Copyright 2024 Espressif

        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.

        ------------------------------------------------------------------------

                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/

        TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

        1. Definitions.

          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.

          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.

          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.

          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.

          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.

          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.

          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).

          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.

          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."

          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.

        2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.

        3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.

        4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:

          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and

          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and

          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and

          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.

          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.

        5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.

        6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.

        7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.

        8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.

        9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.

        END OF TERMS AND CONDITIONS

        APPENDIX: How to apply the Apache License to your work.

          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.

        Copyright [yyyy] [name of copyright owner]

        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.

Location: /Users/radim/.pyenv/versions/3.10.9/lib/python3.10/site-packages
Requires: commitizen
Required-by:
Files:
  czespressif-1.0.1.dev2.dist-info/INSTALLER
  czespressif-1.0.1.dev2.dist-info/LICENSE
  czespressif-1.0.1.dev2.dist-info/METADATA
  czespressif-1.0.1.dev2.dist-info/RECORD
  czespressif-1.0.1.dev2.dist-info/REQUESTED
  czespressif-1.0.1.dev2.dist-info/WHEEL
  czespressif-1.0.1.dev2.dist-info/entry_points.txt
  czespressif-1.0.1.dev2.dist-info/top_level.txt
  czespressif/__init__.py
  czespressif/__pycache__/__init__.cpython-310.pyc
  czespressif/__pycache__/config.cpython-310.pyc
  czespressif/__pycache__/czespressif.cpython-310.pyc
  czespressif/__pycache__/defaults.cpython-310.pyc
  czespressif/__pycache__/example.cpython-310.pyc
  czespressif/__pycache__/questions.cpython-310.pyc
  czespressif/config.py
  czespressif/czespressif.py
  czespressif/defaults.py
  czespressif/example.py
  czespressif/questions.py
  czespressif/templates/CHANGELOG.md.j2
  czespressif/templates/RELEASE_NOTES.md.j2
  czespressif/templates/macros.md.j2
  tests/__pycache__/test_czespressif.cpython-310.pyc
  tests/test_czespressif.py
+-zsh:274> cat pyproject.toml
[build-system]
    requires = ["setuptools>=64"]
    build-backend = "setuptools.build_meta"

[project]
    name = "esptool"
    authors = [
        {name = "Fredrik Ahlberg (themadinventor)"},
        {name = "Angus Gratton (projectgus)"},
        {name = "Espressif Systems"}
    ]
    readme = {file = "README.md", content-type = "text/markdown"}
    license = {text = "GPLv2+"}
    description = "A serial utility to communicate & flash code to Espressif chips."
    classifiers = [
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "Natural Language :: English",
        "Operating System :: POSIX",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: MacOS :: MacOS X",
        "Topic :: Software Development :: Embedded Systems",
        "Environment :: Console",
        "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
    ]
    requires-python = ">=3.7"
    dynamic = ["version", "scripts"]

    dependencies = [
        "bitstring>=3.1.6,!=4.2.0",
        "cryptography>=2.1.4",
        "ecdsa>=0.16.0",
        "pyserial>=3.3",
        "reedsolo>=1.5.3,<1.8",
        "PyYAML>=5.1",
        "intelhex",
        'argcomplete>=3; sys_platform != "win32"',
    ]

[project.urls]
    Homepage = "https://github.com/espressif/esptool/"
    Documentation = "https://docs.espressif.com/projects/esptool/"
    Source = "https://github.com/espressif/esptool/"
    Tracker = "https://github.com/espressif/esptool/issues/"
    Changelog = "https://github.com/espressif/esptool/blob/master/CHANGELOG.md"

[project.optional-dependencies]
    dev = [
        "pyelftools",
        "coverage~=6.0",
        "pre-commit",
        "pytest",
        "pytest-rerunfailures",
        "requests",
        "commitizen",
    ]
    hsm = ["python-pkcs11"]

[tool.setuptools]
    include-package-data = true

[tool.setuptools.package-data]
    "*" = ["esptool/targets/stub_flasher/1/*", "esptool/targets/stub_flasher/2/*"]

[tool.setuptools.packages]
    find = {exclude = ["ci", "flasher_stub", "test", "docs"]}

[tool.setuptools.dynamic]
    version = {attr = "esptool.__init__.__version__"}

[tool.commitizen]
    version = "4.7.0"
    update_changelog_on_bump = true
    tag_format = "v$version"
    changelog_start_rev = "v4.2.1"
    changelog_merge_prerelease = true
    annotated_tag = true
    bump_message = "change: Update version to $new_version"
    version_files = [
        "esptool/__init__.py:__version__"
    ]
    change_type_order = [
        "BREAKING CHANGE",
        "New Features",
        "Bug Fixes",
        "Code Refactoring",
        "Performance Improvements"
    ]

[tool.commitizen.change_type_map]
    feat = "New Features"
    fix = "Bug Fixes"
    refactor = "Code Refactoring"
    perf = "Performance Improvements"

[tool.codespell]
    skip = '*.bin,*test/images/efuse/*,*docs/en/espefuse/inc/*'
    ignore-words-list = 'bloc,ser,dout,exten'
    write-changes = false

[tool.mypy]
    disallow_incomplete_defs = false # Disallows defining functions with incomplete type annotations
    disallow_untyped_defs    = false # Disallows defining functions without type annotations or with incomplete type annotations
    ignore_missing_imports   = true  # Suppress error messages about imports that cannot be resolved
    python_version           = "3.7" # Specifies the Python version used to parse and check the target program
    warn_no_return           = true  # Shows errors for missing return statements on some execution paths
    warn_return_any          = true  # Shows a warning when returning a value with type Any from a function declared with a non- Any return type

[tool.ruff]
    # https://docs.astral.sh/ruff/settings/
    # Exclude a variety of commonly ignored directories.
    exclude = [
        ".eggs",
        ".git",
        "__pycache__"
    ]

    line-length = 88

    select = ['E', 'F', 'W']
    ignore = ["E203"]

    target-version = "py37"

[tool.ruff.lint]
    # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
    # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
    # McCabe complexity (`C901`) by default.
    select = ["E4", "E7", "E9", "F"]
    ignore = []

    # Allow fix for all enabled rules (when `--fix`) is provided.
    fixable = ["ALL"]
    unfixable = []

    # Allow unused variables when underscore-prefixed.
    dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.per-file-ignores]
    # tests often manipulate sys.path before importing the main tools, so ignore import order violations
    "test/*.py" = ["E402"]

    # multiple spaces after ',' and long lines - used for visual layout of eFuse data
    "espefuse/efuse/*/mem_definition.py" =  ["E241", "E501"]
    "espefuse/efuse/*/operations.py" =   ["E241", "E501", "F401"]
    "espefuse/efuse/*/fields.py" =   ["E241", "E501"]

    # ignore long lines - used for RS encoding pairs
    "test/test_modules.py" = ["E501"]

    # don't check for unused imports in __init__.py files
    "__init__.py" = ["F401"]

    # allow definition from star imports in docs config
    "docs/conf_common.py" =  ["F405"]

[tool.ruff.format]
    quote-style = "double"
    indent-style = "space"
    docstring-code-format = true
+-zsh:274> set +x
  1. Yes, I did a clean install

  2. the same problem occurs in venv.

I guess the problem is with zsh or my setup. If I move the file to the esptool folder, it works. For some reason it cannot access anywhere else. So I guess you can safely ignore this.

@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch 2 times, most recently from 9e3ac1c to 691a421 Compare September 23, 2024 07:51
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 691a421 to 6da5eef Compare September 23, 2024 21:19
- update structure README, badges, credits
- section about solving conflicts commitizen
- add example screenshots for release notes and changelog
fix(github-actions): update create-release.yml, missing "v" in version
- (dependabot): update dependabot config file, team reviewers
- (justfile): add recipe for local cleanup temp, manual tests
@tomassebestik tomassebestik force-pushed the feat/template-gh-release-notes branch from 6da5eef to fcba4a9 Compare September 23, 2024 21:32
@tomassebestik tomassebestik merged commit f601dbf into master Sep 24, 2024
6 checks passed
@tomassebestik tomassebestik deleted the feat/template-gh-release-notes branch September 24, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants