Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83374

Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

From Ben Finney <ben+python@benfinney.id.au>
Subject Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)
Date 2015-01-09 11:06 +1100
References <54ae0917$0$2738$c3e8da3$76491128@news.astraweb.com> <mailman.17465.1420701187.18130.python-list@python.org> <54ae6715$0$12987$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.17488.1420762070.18130.python-list@python.org> (permalink)

Show all headers | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:

> Ben Finney wrote:
> > The source has a ‘CHANGES.txt’ file which has no entry later than
> > version 0.2a. Why was the later version made, and when will the
> > change log be updated for that?
>
> Ah, I knew I forgot something!

The perils of duplicate sources of information: a Changelog makes claims
about which version is latest, but the packaging metadata comes from
somewhere else.

This problem is addressed quite well, in my opinion, by the Debian
packaging tools. The tools by default read the following information:

* release version string
* maintainer name
* maintainer email address
* target suite (a conceptual “which Debian version should this go into”)

from the Changelog document, automatically. This means that the
Changelog document, as well as being directly useful to the recipient as
a text document, becomes the canonical place to record all those fields
for the packaging tools to read. No need to maintain duplicate records.


I would like Python's packaging tools to have the same capability.

This requires recording the Changelog document in a machine-parseable
format, with specified locations for each of the fields to be read for
each version.

I have recently gone through a process of converting the Changelog for a
package I maintain (‘python-daemon’) to reStructuredText [0]. This has
all the above features: machine-parseable, a well-defined way to attach
fields to a section, etc.

[0] reStructuredText: <URL:http://docutils.sourceforge.net/rst.html>

I've now produced a small Python library which knows how to transform a
reST Changelog to package metadata; and how to get that package metadata
into and out of a Python distribution with Distutils.

The result is that I will never again upload the package with a mismatch
between what the Changelog claims is the latest version, and what the
package metadata says.


This may be generally useful to others. I'm interested to know how
people would expect to use this. As an extension to Distutils? As a
third-party library? Something else?

-- 
 \      “Nullius in verba” (“Take no-one's word for it”) —motto of the |
  `\                                   Royal Society, since 1663-06-30 |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Announce: PyPrimes 0.2.1a Steven D'Aprano <steve@pearwood.info> - 2015-01-08 04:35 +0000
  Re: Announce: PyPrimes 0.2.1a Ben Finney <ben+python@benfinney.id.au> - 2015-01-08 18:12 +1100
    Re: Announce: PyPrimes 0.2.1a Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-08 22:16 +1100
      Re: Announce: PyPrimes 0.2.1a Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-01-08 23:32 +0100
        Re: Announce: PyPrimes 0.2.1a Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 11:41 +1100
          Re: Announce: PyPrimes 0.2.1a Chris Angelico <rosuav@gmail.com> - 2015-01-09 11:50 +1100
            Re: Announce: PyPrimes 0.2.1a alister <alister.nospam.ware@ntlworld.com> - 2015-01-09 09:05 +0000
              Re: Announce: PyPrimes 0.2.1a Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 22:01 +1100
                Re: Announce: PyPrimes 0.2.1a alister <alister.nospam.ware@ntlworld.com> - 2015-01-09 11:42 +0000
          Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a) Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 12:11 +1100
            Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a) Rustom Mody <rustompmody@gmail.com> - 2015-01-08 17:39 -0800
            Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a) Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-08 17:42 -0800
              Re: Where to learn current best Python packaging practices Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 13:37 +1100
      PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a) Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 10:55 +1100
        Re: PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 11:38 +1100
      Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a) Ben Finney <ben+python@benfinney.id.au> - 2015-01-09 11:06 +1100
        Re: Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-12 05:17 +1100
          Re: Using a ChangeLog as a canonical source of package metadata Ben Finney <ben+python@benfinney.id.au> - 2015-01-12 07:21 +1100
            Re: Using a ChangeLog as a canonical source of package metadata wxjmfauth@gmail.com - 2015-01-11 12:37 -0800
              Re: Using a ChangeLog as a canonical source of package metadata Steven D'Aprano <steve@pearwood.info> - 2015-01-12 05:44 +0000
                Re: Using a ChangeLog as a canonical source of package metadata wxjmfauth@gmail.com - 2015-01-12 05:24 -0800
                Re: Using a ChangeLog as a canonical source of package metadata Steven D'Aprano <steve@pearwood.info> - 2015-01-13 06:59 +0000
                Re: Using a ChangeLog as a canonical source of package metadata wxjmfauth@gmail.com - 2015-01-13 00:09 -0800
                Re: Using a ChangeLog as a canonical source of package metadata Steven D'Aprano <steve@pearwood.info> - 2015-01-13 08:22 +0000
          Re: Using a ChangeLog as a canonical source of package metadata Ben Finney <ben+python@benfinney.id.au> - 2015-01-14 21:59 +1100
      Re: Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a) Chris Angelico <rosuav@gmail.com> - 2015-01-09 11:16 +1100
  Re: Announce: PyPrimes 0.2.1a Christian Gollwitzer <auriocus@gmx.de> - 2015-01-08 08:27 +0100
    Re: Announce: PyPrimes 0.2.1a Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-08 22:20 +1100

csiph-web