unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Floris Bruynooghe <flub@devork.be>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH] python-cffi: read version from notmuch version file
Date: Fri, 19 Jun 2020 12:50:45 +0200	[thread overview]
Message-ID: <87k103cosa.fsf@powell.devork.be> (raw)
In-Reply-To: <874kr78ihc.fsf@zancas>

On Fri 19 Jun 2020 at 07:20 -0300, David Bremner wrote:

> Floris Bruynooghe <flub@devork.be> writes:
> BTW I noticed something (setuptools?) translates "0.30~rc2" to
> "0.30-rc2". I assume that is as intended, and there are some stricter
> rules for python module versions. It should only affect pre-release
> versions in any case.

Supposedly setuptools uses packaging.version:

   $ python3
   Python 3.8.3 (default, May 14 2020, 11:03:12)
   [GCC 9.3.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import packaging.version
   >>> rc1 = packaging.version.parse('0.30~rc1')
   >>> rc1
   <LegacyVersion('0.30~rc1')>
   >>> rc2 = packaging.version.parse('0.30~rc2')
   >>> maj = packaging.version.parse('0.30')
   >>> maj
   <Version('0.30')>
   >>> rc1 < rc2 < maj
   True

So I think this is ok?  Just for completeness:

   >>> rc1b = packaging.version.parse('0.30-rc1')
   >>> rc1b
   <Version('0.30rc1')>
   >>> rc1b < maj
   True

Apparently PEP440 has the full details of how Python wants to see
version numbers work, but it's too many years ago that I read that
thing ;).  This seems good enough to me.

Cheers,
Floris

  reply	other threads:[~2020-06-19 10:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19  9:46 python-cffi: read version number from notmuch Floris Bruynooghe
2020-06-19  9:46 ` [PATCH] python-cffi: read version from notmuch version file Floris Bruynooghe
2020-06-19 10:20   ` David Bremner
2020-06-19 10:50     ` Floris Bruynooghe [this message]
2020-06-19 12:26   ` Frank LENORMAND
2020-06-22 21:45     ` Floris Bruynooghe
2020-06-23  5:24       ` Frank LENORMAND
2020-06-23  9:33         ` David Bremner
2020-06-23 10:43           ` Frank LENORMAND
2020-06-23 21:16             ` Floris Bruynooghe
2020-06-24  6:29               ` Frank LENORMAND

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k103cosa.fsf@powell.devork.be \
    --to=flub@devork.be \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).