| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: changelog-chug |
| 3 |
Version: 0.0.3 |
| 4 |
Summary: Parser library for project Change Log documents. |
| 5 |
Author-email: Ben Finney <[email protected]> |
| 6 |
Maintainer: Ben Finney <[email protected]> |
| 7 |
License: Copying this work |
| 8 |
################# |
| 9 |
|
| 10 |
changelog-chug is `free software`_; you are free to |
| 11 |
redistribute it and/or modify it under specific conditions. |
| 12 |
|
| 13 |
.. _free software: https://www.gnu.org/philosophy/free-sw.html |
| 14 |
|
| 15 |
|
| 16 |
Software |
| 17 |
======== |
| 18 |
|
| 19 |
Copyright © 2008–2023 Ben Finney <[email protected]> |
| 20 |
|
| 21 |
This is free software: you may copy, modify, and/or redistribute this |
| 22 |
work under the terms of the GNU Affero General Public License as |
| 23 |
published by the Free Software Foundation; version 3 of that license |
| 24 |
or any later version. |
| 25 |
|
| 26 |
No warranty expressed or implied. See the file `LICENSE.AGPL-3`_ for |
| 27 |
details, or online at `<https://www.gnu.org/licenses/agpl-3.0.html>`_. |
| 28 |
|
| 29 |
.. _LICENSE.AGPL-3: LICENSE.AGPL-3 |
| 30 |
|
| 31 |
|
| 32 |
.. |
| 33 |
Local variables: |
| 34 |
coding: utf-8 |
| 35 |
mode: rst |
| 36 |
End: |
| 37 |
vim: fileencoding=utf-8 filetype=rst : |
| 38 |
|
| 39 |
Project-URL: Home Page, https://git.sr.ht/~bignose/changelog-chug |
| 40 |
Project-URL: Change Log, https://git.sr.ht/~bignose/changelog-chug/tree/main/item/ChangeLog |
| 41 |
|
| 42 |
Project-URL: Source, https://git.sr.ht/~bignose/changelog-chug |
| 43 |
Project-URL: Issue Tracker, https://todo.sr.ht/~bignose/changelog-chug |
| 44 |
Keywords: version,changelog,release,packaging |
| 45 |
Classifier: Development Status :: 2 - Pre-Alpha |
| 46 |
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) |
| 47 |
Classifier: Programming Language :: Python :: 3 |
| 48 |
Classifier: Intended Audience :: Developers |
| 49 |
Classifier: Topic :: Software Development :: Build Tools |
| 50 |
Requires-Python: >=3.7 |
| 51 |
Description-Content-Type: text/x-rst |
| 52 |
License-File: LICENSE.AGPL-3 |
| 53 |
License-File: COPYING |
| 54 |
Requires-Dist: semver>=3.0.0 |
| 55 |
Requires-Dist: docutils>=0.21.0 |
| 56 |
Provides-Extra: static-analysis |
| 57 |
Requires-Dist: pip-check; extra == "static-analysis" |
| 58 |
Requires-Dist: mccabe~=0.7; extra == "static-analysis" |
| 59 |
Requires-Dist: pycodestyle~=2.12; extra == "static-analysis" |
| 60 |
Requires-Dist: ruff~=0.6; extra == "static-analysis" |
| 61 |
Provides-Extra: test |
| 62 |
Requires-Dist: changelog-chug[static-analysis]; extra == "test" |
| 63 |
Requires-Dist: testtools; extra == "test" |
| 64 |
Requires-Dist: testscenarios>=0.4; extra == "test" |
| 65 |
Requires-Dist: coverage; extra == "test" |
| 66 |
Provides-Extra: devel |
| 67 |
Requires-Dist: changelog-chug[test]; extra == "devel" |
| 68 |
Requires-Dist: pyupgrade~=3.17; extra == "devel" |
| 69 |
Requires-Dist: isort~=5.13; extra == "devel" |
| 70 |
Provides-Extra: build |
| 71 |
Requires-Dist: changelog-chug[devel]; extra == "build" |
| 72 |
Requires-Dist: wheel; extra == "build" |
| 73 |
Requires-Dist: build; extra == "build" |
| 74 |
Provides-Extra: publish |
| 75 |
Requires-Dist: changelog-chug[build]; extra == "publish" |
| 76 |
Requires-Dist: twine; extra == "publish" |
| 77 |
|
| 78 |
changelog-chug is a parser for project Change Log documents. |
| 79 |
|
| 80 |
changelog-chug |
| 81 |
############## |
| 82 |
|
| 83 |
Example |
| 84 |
======= |
| 85 |
|
| 86 |
Given a reStructuredText document ChangeLog:: |
| 87 |
|
| 88 |
Change Log |
| 89 |
########## |
| 90 |
|
| 91 |
Version 1.0.1 |
| 92 |
============= |
| 93 |
|
| 94 |
:Released: 2020-01-10 |
| 95 |
:Maintainer: Cathy Morris <[email protected]> |
| 96 |
|
| 97 |
… |
| 98 |
|
| 99 |
Version 1.0 |
| 100 |
=========== |
| 101 |
|
| 102 |
:Released: 2020-01-10 |
| 103 |
:Maintainer: Luis Flores <[email protected]> |
| 104 |
|
| 105 |
… |
| 106 |
|
| 107 |
Version 0.2 |
| 108 |
=========== |
| 109 |
|
| 110 |
:Released: 2019-07-04 |
| 111 |
:Maintainer: Cathy Morris <[email protected]> |
| 112 |
|
| 113 |
… |
| 114 |
|
| 115 |
Version 0.2-alpha1 |
| 116 |
================== |
| 117 |
|
| 118 |
:Released: 2019-07-04 |
| 119 |
:Maintainer: Cathy Morris <[email protected]> |
| 120 |
|
| 121 |
… |
| 122 |
|
| 123 |
Version 0.1 |
| 124 |
=========== |
| 125 |
|
| 126 |
:Released: 2019-05-16 |
| 127 |
:Maintainer: Cathy Morris <[email protected]> |
| 128 |
|
| 129 |
… |
| 130 |
|
| 131 |
Generate Change Log entry data for all versions from the reStructuredText |
| 132 |
formatted ChangeLog:: |
| 133 |
|
| 134 |
>>> import pathlib |
| 135 |
>>> import pprint |
| 136 |
>>> import chug.parsers.rest |
| 137 |
>>> import chug.writers |
| 138 |
>>> infile_path = pathlib.Path(".", "ChangeLog") |
| 139 |
>>> document_text = chug.parsers.get_changelog_document_text(infile_path) |
| 140 |
>>> document = chug.parsers.rest.parse_rest_document_from_text( |
| 141 |
... document_text) |
| 142 |
>>> entries = chug.parsers.rest.make_change_log_entries_from_document( |
| 143 |
... document) |
| 144 |
>>> pprint.pprint([entry.as_version_info_entry() for entry in entries]) |
| 145 |
[OrderedDict([('release_date', '2020-01-10'), |
| 146 |
('version', '1.0.1'), |
| 147 |
('maintainer', 'Cathy Morris <[email protected]>'), |
| 148 |
('body', '…')]), |
| 149 |
OrderedDict([('release_date', '2020-01-10'), |
| 150 |
('version', '1.0'), |
| 151 |
('maintainer', 'Luis Flores <[email protected]>'), |
| 152 |
('body', '…')]), |
| 153 |
OrderedDict([('release_date', '2019-07-04'), |
| 154 |
('version', '0.2'), |
| 155 |
('maintainer', 'Cathy Morris <[email protected]>'), |
| 156 |
('body', '…')]), |
| 157 |
OrderedDict([('release_date', '2019-07-04'), |
| 158 |
('version', '0.2-alpha1'), |
| 159 |
('maintainer', 'Cathy Morris <[email protected]>'), |
| 160 |
('body', '…')]), |
| 161 |
OrderedDict([('release_date', '2019-05-16'), |
| 162 |
('version', '0.1'), |
| 163 |
('maintainer', 'Cathy Morris <[email protected]>'), |
| 164 |
('body', '…')])] |
| 165 |
|
| 166 |
Generate a JSON document describing the latest version:: |
| 167 |
|
| 168 |
>>> import json |
| 169 |
>>> latest_entry = entries[0] |
| 170 |
>>> latest_entry_json = json.dumps( |
| 171 |
... latest_entry.as_version_info_entry(), indent=4) |
| 172 |
>>> print(latest_entry_json) |
| 173 |
{ |
| 174 |
"release_date": "2020-01-10", |
| 175 |
"version": "1.0.1", |
| 176 |
"maintainer": "Cathy Morris <[email protected]>", |
| 177 |
"body": "\u2026" |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
Copying |
| 182 |
======= |
| 183 |
|
| 184 |
changelog-chug is free software. See the file `COPYING`_ for details. |
| 185 |
|
| 186 |
.. _COPYING: COPYING |
| 187 |
|
| 188 |
|
| 189 |
.. |
| 190 |
This document is written using `reStructuredText`_ markup, and can |
| 191 |
be rendered with `Docutils`_ to other formats. |
| 192 |
|
| 193 |
.. _Docutils: http://docutils.sourceforge.net/ |
| 194 |
.. _reStructuredText: http://docutils.sourceforge.net/rst.html |
| 195 |
|
| 196 |
.. |
| 197 |
Local variables: |
| 198 |
coding: utf-8 |
| 199 |
mode: rst |
| 200 |
End: |
| 201 |
vim: fileencoding=utf-8 filetype=rst : |