Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-13 Thread Heinrich Schuchardt

On 5/13/22 13:07, julien.pu...@gmail.com wrote:

Le vendredi 13 mai 2022 à 11:18 +0200, Heinrich Schuchardt a écrit :

On 5/12/22 17:17, julien.pu...@gmail.com wrote:


I propose to add the following patch to my package:

Description: make the package return a PEP440-compatible version
number
Author: Julien Puydt
Forwarded: Debian-specific

--- python-cheroot.orig/cheroot/__init__.py
+++ python-cheroot/cheroot/__init__.py
@@ -11,5 +11,7 @@
   
   try:

   __version__ =
pkg_resources.get_distribution('cheroot').version
+    if __version__.find('+ds') != -1:
+    __version__ = __version__[:__version__.find('+ds')]


This will not work for anything but +ds.


Does it solve your issue with the Debian package now?

Indeed if upstream had a more generic fix, that is the best solution,


That is why I created
https://github.com/cherrypy/cheroot/pull/507


but in the mean time, I can live with a Debian-specific patch.


Your patch works fine as long a your version appendix starts with +ds.

Best regards

Heinrich



Cheers,

J.Puydt




Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-13 Thread julien . puydt
Le vendredi 13 mai 2022 à 11:18 +0200, Heinrich Schuchardt a écrit :
> On 5/12/22 17:17, julien.pu...@gmail.com wrote:
> > 
> > I propose to add the following patch to my package:
> > 
> > Description: make the package return a PEP440-compatible version
> > number
> > Author: Julien Puydt
> > Forwarded: Debian-specific
> > 
> > --- python-cheroot.orig/cheroot/__init__.py
> > +++ python-cheroot/cheroot/__init__.py
> > @@ -11,5 +11,7 @@
> >   
> >   try:
> >   __version__ =
> > pkg_resources.get_distribution('cheroot').version
> > +    if __version__.find('+ds') != -1:
> > +    __version__ = __version__[:__version__.find('+ds')]
> 
> This will not work for anything but +ds.

Does it solve your issue with the Debian package now?

Indeed if upstream had a more generic fix, that is the best solution,
but in the mean time, I can live with a Debian-specific patch.

Cheers,

J.Puydt



Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-13 Thread Heinrich Schuchardt

On 5/12/22 17:17, julien.pu...@gmail.com wrote:

Le jeudi 12 mai 2022 à 17:04 +0200, Heinrich Schuchardt a écrit :

On 5/12/22 15:36, julien.pu...@gmail.com wrote:

Le jeudi 12 mai 2022 à 15:20 +0200, Heinrich Schuchardt a écrit :

On 5/12/22 14:55, julien.pu...@gmail.com wrote:


Let me ask bluntly: how is it a problem?


$ python3
   >>> import cheroot
   >>> print cheroot.__version__
8.6.0+ds1
   >>> from distutils.version import StrictVersion
   >>> StrictVersion(cheroot.__version__)
Traceback (most recent call last):
     File "", line 1, in 
     File "/usr/lib/python3.10/distutils/version.py", line 40, in
__init__
   self.parse(vstring)
     File "/usr/lib/python3.10/distutils/version.py", line 137, in
parse
   raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '8.6.0+ds1'
   >>>



If there were any issue with general Python packages versioning
in
Debian, perhaps you should contact the Debian Python
Maintainers
team?


You could patch this line to solve the problem:

cheroot/__init__.py:13:
__version__ = pkg_resources.get_distribution('cheroot').version


Ok, distutils is unhappy, but:

1. distutils is obsolete: https://peps.python.org/pep-0632/

2. your example doesn't look like a real-world situation.


You err. See the linked issue on launchpad.net. Ceph does not work
due
to your deviation from upstream version numbers.



You're right, I had forgotten about this!

I propose to add the following patch to my package:

Description: make the package return a PEP440-compatible version number
Author: Julien Puydt
Forwarded: Debian-specific

--- python-cheroot.orig/cheroot/__init__.py
+++ python-cheroot/cheroot/__init__.py
@@ -11,5 +11,7 @@
  
  try:

  __version__ = pkg_resources.get_distribution('cheroot').version
+if __version__.find('+ds') != -1:
+__version__ = __version__[:__version__.find('+ds')]


This will not work for anything but +ds.

I have created a more generic patch in
https://github.com/cherrypy/cheroot/pull/507
using a regular expression to extract the valid part of the version number.

Best regards

Heinrich


  except Exception:
  __version__ = 'unknown'



Would that solve your issue?

Cheers,

J.Puydt




Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-12 Thread julien . puydt
Le jeudi 12 mai 2022 à 17:04 +0200, Heinrich Schuchardt a écrit :
> On 5/12/22 15:36, julien.pu...@gmail.com wrote:
> > Le jeudi 12 mai 2022 à 15:20 +0200, Heinrich Schuchardt a écrit :
> > > On 5/12/22 14:55, julien.pu...@gmail.com wrote:
> > > 
> > > > Let me ask bluntly: how is it a problem?
> > > 
> > > $ python3
> > >   >>> import cheroot
> > >   >>> print cheroot.__version__
> > > 8.6.0+ds1
> > >   >>> from distutils.version import StrictVersion
> > >   >>> StrictVersion(cheroot.__version__)
> > > Traceback (most recent call last):
> > >     File "", line 1, in 
> > >     File "/usr/lib/python3.10/distutils/version.py", line 40, in
> > > __init__
> > >   self.parse(vstring)
> > >     File "/usr/lib/python3.10/distutils/version.py", line 137, in
> > > parse
> > >   raise ValueError("invalid version number '%s'" % vstring)
> > > ValueError: invalid version number '8.6.0+ds1'
> > >   >>>
> > > 
> > > > 
> > > > If there were any issue with general Python packages versioning
> > > > in
> > > > Debian, perhaps you should contact the Debian Python
> > > > Maintainers
> > > > team?
> > > 
> > > You could patch this line to solve the problem:
> > > 
> > > cheroot/__init__.py:13:
> > > __version__ = pkg_resources.get_distribution('cheroot').version
> > 
> > Ok, distutils is unhappy, but:
> > 
> > 1. distutils is obsolete: https://peps.python.org/pep-0632/
> > 
> > 2. your example doesn't look like a real-world situation.
> 
> You err. See the linked issue on launchpad.net. Ceph does not work
> due 
> to your deviation from upstream version numbers.
> 

You're right, I had forgotten about this!

I propose to add the following patch to my package:

Description: make the package return a PEP440-compatible version number
Author: Julien Puydt
Forwarded: Debian-specific

--- python-cheroot.orig/cheroot/__init__.py
+++ python-cheroot/cheroot/__init__.py
@@ -11,5 +11,7 @@
 
 try:
 __version__ = pkg_resources.get_distribution('cheroot').version
+if __version__.find('+ds') != -1:
+__version__ = __version__[:__version__.find('+ds')]
 except Exception:
 __version__ = 'unknown'



Would that solve your issue?

Cheers,

J.Puydt



Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-12 Thread Heinrich Schuchardt

On 5/12/22 15:36, julien.pu...@gmail.com wrote:

Le jeudi 12 mai 2022 à 15:20 +0200, Heinrich Schuchardt a écrit :

On 5/12/22 14:55, julien.pu...@gmail.com wrote:


Let me ask bluntly: how is it a problem?


$ python3
  >>> import cheroot
  >>> print cheroot.__version__
8.6.0+ds1
  >>> from distutils.version import StrictVersion
  >>> StrictVersion(cheroot.__version__)
Traceback (most recent call last):
    File "", line 1, in 
    File "/usr/lib/python3.10/distutils/version.py", line 40, in
__init__
  self.parse(vstring)
    File "/usr/lib/python3.10/distutils/version.py", line 137, in
parse
  raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '8.6.0+ds1'
  >>>



If there were any issue with general Python packages versioning in
Debian, perhaps you should contact the Debian Python Maintainers
team?


You could patch this line to solve the problem:

cheroot/__init__.py:13:
__version__ = pkg_resources.get_distribution('cheroot').version


Ok, distutils is unhappy, but:

1. distutils is obsolete: https://peps.python.org/pep-0632/

2. your example doesn't look like a real-world situation.


You err. See the linked issue on launchpad.net. Ceph does not work due 
to your deviation from upstream version numbers.


Best regards

Heinrich



I don't want to diverge from upstream -- however trivial the patch,
unless there's some actual problem to fix.

Cheers,

J.Puydt




Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-12 Thread julien . puydt
Le jeudi 12 mai 2022 à 15:20 +0200, Heinrich Schuchardt a écrit :
> On 5/12/22 14:55, julien.pu...@gmail.com wrote:
> 
> > Let me ask bluntly: how is it a problem?
> 
> $ python3
>  >>> import cheroot
>  >>> print cheroot.__version__
> 8.6.0+ds1
>  >>> from distutils.version import StrictVersion
>  >>> StrictVersion(cheroot.__version__)
> Traceback (most recent call last):
>    File "", line 1, in 
>    File "/usr/lib/python3.10/distutils/version.py", line 40, in
> __init__
>  self.parse(vstring)
>    File "/usr/lib/python3.10/distutils/version.py", line 137, in
> parse
>  raise ValueError("invalid version number '%s'" % vstring)
> ValueError: invalid version number '8.6.0+ds1'
>  >>>
> 
> > 
> > If there were any issue with general Python packages versioning in
> > Debian, perhaps you should contact the Debian Python Maintainers
> > team?
> 
> You could patch this line to solve the problem:
> 
> cheroot/__init__.py:13:
> __version__ = pkg_resources.get_distribution('cheroot').version

Ok, distutils is unhappy, but:

1. distutils is obsolete: https://peps.python.org/pep-0632/

2. your example doesn't look like a real-world situation.

I don't want to diverge from upstream -- however trivial the patch,
unless there's some actual problem to fix.

Cheers,

J.Puydt



Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-12 Thread Heinrich Schuchardt

On 5/12/22 14:55, julien.pu...@gmail.com wrote:

Hi,

Le jeudi 12 mai 2022 à 14:45 +0200, Heinrich Schuchardt a écrit :

Package: python-cheroot
Version: 8.6.0+ds1-2
Severity: normal

Python package versions like 8.6.0+ds1 do not conform to PEP440. This
leads to errors in Ceph as reported in
https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1967139



It's not a Python package version ; it's a Debian package version, so
PEP440 doesn't apply.


Unfortunately this number is propagated into cheroot.__version__.




Is this something to be corrected in this package?
Or is this a general problem with how we do Python packaging?


Let me ask bluntly: how is it a problem?


$ python3
>>> import cheroot
>>> print cheroot.__version__
8.6.0+ds1
>>> from distutils.version import StrictVersion
>>> StrictVersion(cheroot.__version__)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.10/distutils/version.py", line 40, in __init__
self.parse(vstring)
  File "/usr/lib/python3.10/distutils/version.py", line 137, in parse
raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '8.6.0+ds1'
>>>



If there were any issue with general Python packages versioning in
Debian, perhaps you should contact the Debian Python Maintainers team?


You could patch this line to solve the problem:

cheroot/__init__.py:13:
__version__ = pkg_resources.get_distribution('cheroot').version

Best regards

Heinrich



Cheers,

J.Puydt




Bug#1010894: python-cheroot version number does not conform to PEP440

2022-05-12 Thread Heinrich Schuchardt

Package: python-cheroot
Version: 8.6.0+ds1-2
Severity: normal

Hello Julien,

Python package versions like 8.6.0+ds1 do not conform to PEP440. This 
leads to errors in Ceph as reported in

https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1967139

Allowable package versions are defined in PEP440 
(https://peps.python.org/pep-0440/) as

[N!]N(.N)*[{a|b|rc}N][.postN][.devN]

So 8.6.0a1 would be legal. 8.6.0+ds1 is illegal.

Is this something to be corrected in this package?
Or is this a general problem with how we do Python packaging?

Best regards

Heinrich