47 Commits

Author SHA1 Message Date
Maciej Borzecki
ce04e82ef9 release-tools: skip flake8 on 24.04
flake8 is broken on 24.04, this outright fails:

$ flake8 --ignore=E501 release-tools
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flake8/plugins/finder.py", line 296, in _load_plugin
    obj = plugin.entry_point.load()
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/flake8/plugins/pycodestyle.py", line 25, in <module>
    from pycodestyle import missing_whitespace_around_operator as _missing_whitespace_around_operator  # noqa: E501
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'missing_whitespace_around_operator' from 'pycodestyle' (/usr/lib/python3/dist-packages/pycodestyle.py)

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-03-13 17:32:36 +01:00
Miguel Pires
3a88dc38ca release-tools: fix handling of NEWS.md items
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-11-21 11:35:55 +00:00
Ernest Lotter
dc51d602b9 release-tools: improve changelog help and inform of incorrect deb email (#13369)
* release-tools: improved help and inform of incorrect deb email

* fixed flake8 failure
2023-11-21 12:55:32 +02:00
Michael Vogt
0a4dc52794 release-tools: add support for NEWS.md changelog.py (#13202)
* release-tools: add support for NEWS.md changelog.py

* release-tools: add flake8 test and fix flake8 issue

* tests: add flake8/python3-bs4 to build-deps for the unit tests

* run-tests: do not write __pycache__ dir
2023-11-17 13:38:27 +02:00
Ian Johnson
b662ce0361 release-tools/repack-debian-tarball.sh: fix c-vendor dir
This needs to be absolute to the extracted dir.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-21 17:51:16 -05:00
Michael Vogt
6cf5bf397d many: rename vendor.c -> c-vendor 2021-08-24 09:24:35 +02:00
Michael Vogt
56c47eb7e7 many: exclude vendor.c from checks and include in vendor tarball 2021-08-19 09:13:59 +02:00
Michael Vogt
72dc7d3b90 Merge pull request #10315 from anonymouse64/bugfix/changelog-py-fixes
release-tool/changelog.py: misc fixes from real world usage
2021-05-31 08:56:32 +02:00
Ian Johnson
c4d8e4e291 release-tools/changelog.py: also fix opensuse changelog date format
Thanks to Maciej for sorting out the right format here, as we were using an
incorrect or inconsistent format for the past few releases, likely cargo
culting the first incorrect format that was introduced last year.

Also we should just always use UTC for this, so we can simplify the code
slightly.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-28 09:46:53 -05:00
Ian Johnson
39d8dd4750 release-tools/changelog.py: fix typo in function name
Thanks to Maciej for spotting this

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-28 09:41:20 -05:00
Ian Johnson
96913596ad release-tools/changelog.py: use lstrip() and fix typo
Thanks to Maciej and Pawel for the suggestions

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-28 09:17:17 -05:00
Ian Johnson
b21fbf9c08 release-tools/changelog.py: fix fedora date format
The correct format is "Mon Mar 08 2021", not "Thu 27 May 2021".

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-27 17:46:26 -05:00
Ian Johnson
318bd0af2e release-tools/changelog.py: handle case where we don't have a TZ
Somehow, on my system the %z format string was empty, resulting in the empty
string being used for the timezone, which does not match the expected format
for the opensuse changelog spec file. In this case, if we detect that there is
no timezone, use utc time and use the +0000 as the timezone.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-27 17:46:26 -05:00
Ian Johnson
27d511b26c release-tools/changelog.py: fix line length check
Lines can actually be exactly 72 characters long.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-27 17:46:25 -05:00
Ian Johnson
ecb02f8520 release-tools/changelog.py: specify the LP bug for the release as an arg too
The LP bug for the release is different for every new major release, so we need
to specify this when generating the changelog.

We could eventually figure out what it should be for minor releases, but for
now just make it mandatory to specify it in the arguments to the script.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-27 17:46:25 -05:00
Ian Johnson
8b7a5f5b4e release-tools/changelog.py: add function to generate github release template
This just basically adds a basic templated header to the changelog entries and
makes the changelog entries align with proper markdown lists etc.

Eventually it would be super nice to be able to use the GitHub API to actually
create the release after it has been tagged and pushed, etc. with this included
automatically, but that will require an API key and also code, so it is left as
a future improvement.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-27 13:51:00 -05:00
Ian Johnson
b868bcf2f5 release-tools/changelog.py: rename string variables since they aren't bytes
Thanks to Maciej for pointing this out.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-25 07:54:43 -05:00
Ian Johnson
7a3dcd51ba release-tools/changelog.py: refactor regexp + file reading/writing
Use a more general regular expression with a capturing group to enable
modifying just the version number we need to change without needing the hackish
manual whitespace bits inserted as part of the version number to replace. This
also enables us to confirm that only one version modification was made to the
file whereas previously we could be accidentally modifying more than one line
without realizing it.

Also optimizing the reading and writing of files so we only read each file we
need once, modify it in a memory buffer, then write it back out once. This
should make the script faster and less likely to fail with half modified files
where only the version number was changed but not the changelog itself for
example with the Fedora spec file.

Thanks to Maciej for all the suggestions!

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-24 14:05:30 -05:00
Ian Johnson
e0e68d0168 release-tools/changelog.py: refactor debian distro list to use classes
Thanks to Jonathan for the cool NamedTuple suggestion!

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-21 16:55:49 -05:00
Ian Johnson
1190d5e977 release-tools/changelog.py: python is not cAmElCaSe it is camel_case
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-21 13:39:18 -05:00
Ian Johnson
bf9c7be87c release-tools/changelog.py: move changlog entry validation to beginning
This prevents us from accidentally writing partially incorrect changelog
entries if the changelog entry file is in the wrong format.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-20 10:01:32 -05:00
Ian Johnson
87c63d85d2 release-tools/changelog.py: use format string specifiers
This is what all the cool python kids are doing these days :-)

Also make the signature for rewriteVersionNumberFile more obvious and add an
extra sanity check for the lines in the changelog entry.

Thanks to Alberto for the suggestions.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-20 09:50:17 -05:00
Ian Johnson
606ba81be5 release-tools/changelog.py: implement script to update all the changelog files
This script takes the new version number of snapd and a file which contains the
output from snappy-dch (most likely edited by hand to account for typos,
duplicated lines or weird messages due to squash merged prs) and will write out
the required changelog entries for ubuntu, debian, fedora, opensuse, and arch
in the packaging dir of snapd.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-05-19 16:56:35 -05:00
Zygmunt Krynicki
e7f738b3f9 release-tools: determine IP of multipass bridge
The multipass bridge has an IP address we can use to tell virtual
machines where they can reach the packaging proxy. The query has been
improved based on feedback from additional environments.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
2019-03-28 12:12:21 +01:00
Zygmunt Krynicki
307bc0c898 release-tools: move download URLs higher
Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
2019-03-28 12:08:49 +01:00