Bug#1012717: git-buildpackage: git-buildpackage should declare a dependency on python 3.10

2022-06-13 Thread Guido Günther
Hi Diane,
On Sun, Jun 12, 2022 at 01:24:31PM -0700, Diane Trout wrote:
> On Sun, 2022-06-12 at 21:52 +0200, Guido Günther wrote:
> > > After looking the problem it up there's a line where it's trying to
> > > do a
> > > union type between _GenericAlias and NoneType, but that's a feature
> > > that
> > > was added in 3.10.
> > > https://peps.python.org/pep-0604/
> > > 
> > > Some of us on testing still have 3.9 as the default because numba
> > > doesn't work with 3.10. I think it's pretty reasonable to inidicate
> > > that
> > > gpb 0.9.27 does requires 3.10.
> > 
> > I'm also happy to apply a patch that makes it compatible with python
> > 3.9
> > again. The gain from the type annotations is pretty low atm.
> >  -- Guido
> 
> 
> This looks like a good solution for 3.9 & 3.10 compatibility
> it works on both 3.9 and 3.10 and expresses the same meaning.
> https://docs.python.org/3/library/typing.html#typing.Optional
> 
> Diane
> 
> diff --git a/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py~
> b/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py
> index c5427ee..9016828 100644
> --- a/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py~
> +++ b/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py
> @@ -34,8 +34,8 @@ class PkgPolicy(object):
>   r'%(?P([^%]|\\%))+'
>   r'\)s')
> -packagename_re: typing.Pattern[str] | None = None
> -packagename_msg: str | None = None
> -upstreamversion_re: typing.Pattern[str] | None = None
> -upstreamversion_msg: str | None = None
> +packagename_re: typing.Optional[typing.Pattern[str]] = None
> +packagename_msg: typing.Optional[str] = None
> +upstreamversion_re: typing.Optional[typing.Pattern[str]] = None
> +upstreamversion_msg: typing.Optional[str] = None
>  
>  @classmethod

That works, thanks!
 -- Guido



Bug#1012717: git-buildpackage: git-buildpackage should declare a dependency on python 3.10

2022-06-12 Thread Diane Trout
On Sun, 2022-06-12 at 21:52 +0200, Guido Günther wrote:
> > After looking the problem it up there's a line where it's trying to
> > do a
> > union type between _GenericAlias and NoneType, but that's a feature
> > that
> > was added in 3.10.
> > https://peps.python.org/pep-0604/
> > 
> > Some of us on testing still have 3.9 as the default because numba
> > doesn't work with 3.10. I think it's pretty reasonable to inidicate
> > that
> > gpb 0.9.27 does requires 3.10.
> 
> I'm also happy to apply a patch that makes it compatible with python
> 3.9
> again. The gain from the type annotations is pretty low atm.
>  -- Guido


This looks like a good solution for 3.9 & 3.10 compatibility
it works on both 3.9 and 3.10 and expresses the same meaning.
https://docs.python.org/3/library/typing.html#typing.Optional

Diane

diff --git a/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py~
b/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py
index c5427ee..9016828 100644
--- a/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py~
+++ b/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py
@@ -34,8 +34,8 @@ class PkgPolicy(object):
  r'%(?P([^%]|\\%))+'
  r'\)s')
-packagename_re: typing.Pattern[str] | None = None
-packagename_msg: str | None = None
-upstreamversion_re: typing.Pattern[str] | None = None
-upstreamversion_msg: str | None = None
+packagename_re: typing.Optional[typing.Pattern[str]] = None
+packagename_msg: typing.Optional[str] = None
+upstreamversion_re: typing.Optional[typing.Pattern[str]] = None
+upstreamversion_msg: typing.Optional[str] = None
 
 @classmethod



Bug#1012717: git-buildpackage: git-buildpackage should declare a dependency on python 3.10

2022-06-12 Thread Guido Günther
Hi,
On Sun, Jun 12, 2022 at 11:37:20AM -0700, Diane Trout wrote:
> Package: git-buildpackage
> Version: 0.9.27
> Severity: normal
> X-Debbugs-Cc: none, Diane Trout 
> 
> Dear Maintainer,
> 
> I was attempting to update some packages using git-buildpackage and had
> the following stack trace
> 
> 
> ~/src/debian/geiser$ gbp import-orig --uscan
> Traceback (most recent call last):
>   File "/usr/bin/gbp", line 149, in 
> sys.exit(supercommand())
>   File "/usr/bin/gbp", line 137, in supercommand
> module = import_command(cmd)
>   File "/usr/bin/gbp", line 71, in import_command
> return __import__('gbp.scripts.%s' % modulename, fromlist='main', level=0)
>   File "/usr/lib/python3/dist-packages/gbp/scripts/import_orig.py", line 26, 
> in 
> from gbp.deb import (DebianPkgPolicy, parse_changelog_repo)
>   File "/usr/lib/python3/dist-packages/gbp/deb/__init__.py", line 28, in 
> 
> from gbp.deb.policy import DebianPkgPolicy# noqa: F401
>   File "/usr/lib/python3/dist-packages/gbp/deb/policy.py", line 27, in 
> 
> from gbp.pkg.pkgpolicy import PkgPolicy
>   File "/usr/lib/python3/dist-packages/gbp/pkg/__init__.py", line 20, in 
> 
> from gbp.pkg.pkgpolicy import PkgPolicy # noqa: F401
>   File "/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py", line 28, in 
> 
> class PkgPolicy(object):
>   File "/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py", line 36, in 
> PkgPolicy
> packagename_re: typing.Pattern[str] | None = None
> TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'
> 
> 
> After looking the problem it up there's a line where it's trying to do a
> union type between _GenericAlias and NoneType, but that's a feature that
> was added in 3.10.
> https://peps.python.org/pep-0604/
> 
> Some of us on testing still have 3.9 as the default because numba
> doesn't work with 3.10. I think it's pretty reasonable to inidicate that
> gpb 0.9.27 does requires 3.10.

I'm also happy to apply a patch that makes it compatible with python 3.9
again. The gain from the type annotations is pretty low atm.
 -- Guido

> 
> Thank you,
> Diane Trout
> 
> -- System Information:
> Debian Release: bookworm/sid
>   APT prefers testing-debug
>   APT policy: (500, 'testing-debug'), (500, 'stable-security'), (500, 
> 'oldstable-debug'), (500, 'testing'), (500, 'stable'), (110, 'unstable'), 
> (100, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 5.17.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
> Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_US:en
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
> 
> Versions of packages git-buildpackage depends on:
> ii  devscripts 2.22.1
> ii  git1:2.35.1-1
> ii  man-db 2.10.2-1
> ii  python33.9.8-1
> ii  python3-dateutil   2.8.1-6
> ii  python3-pkg-resources  59.6.0-1.2
> ii  sensible-utils 0.0.17
> 
> Versions of packages git-buildpackage recommends:
> ii  cowbuilder0.89
> ii  pbuilder  0.231
> ii  pristine-tar  1.49
> ii  python3-requests  2.27.1+dfsg-1
> ii  sbuild0.83.1
> 
> Versions of packages git-buildpackage suggests:
> ii  python3-notify2  0.3-4
> ii  sudo 1.9.10-3
> ii  unzip6.0-26
> 
> -- no debconf information
> 



Bug#1012717: git-buildpackage: git-buildpackage should declare a dependency on python 3.10

2022-06-12 Thread Diane Trout
Package: git-buildpackage
Version: 0.9.27
Severity: normal
X-Debbugs-Cc: none, Diane Trout 

Dear Maintainer,

I was attempting to update some packages using git-buildpackage and had
the following stack trace


~/src/debian/geiser$ gbp import-orig --uscan
Traceback (most recent call last):
  File "/usr/bin/gbp", line 149, in 
sys.exit(supercommand())
  File "/usr/bin/gbp", line 137, in supercommand
module = import_command(cmd)
  File "/usr/bin/gbp", line 71, in import_command
return __import__('gbp.scripts.%s' % modulename, fromlist='main', level=0)
  File "/usr/lib/python3/dist-packages/gbp/scripts/import_orig.py", line 26, in 

from gbp.deb import (DebianPkgPolicy, parse_changelog_repo)
  File "/usr/lib/python3/dist-packages/gbp/deb/__init__.py", line 28, in 

from gbp.deb.policy import DebianPkgPolicy# noqa: F401
  File "/usr/lib/python3/dist-packages/gbp/deb/policy.py", line 27, in 
from gbp.pkg.pkgpolicy import PkgPolicy
  File "/usr/lib/python3/dist-packages/gbp/pkg/__init__.py", line 20, in 

from gbp.pkg.pkgpolicy import PkgPolicy # noqa: F401
  File "/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py", line 28, in 

class PkgPolicy(object):
  File "/usr/lib/python3/dist-packages/gbp/pkg/pkgpolicy.py", line 36, in 
PkgPolicy
packagename_re: typing.Pattern[str] | None = None
TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'


After looking the problem it up there's a line where it's trying to do a
union type between _GenericAlias and NoneType, but that's a feature that
was added in 3.10.
https://peps.python.org/pep-0604/

Some of us on testing still have 3.9 as the default because numba
doesn't work with 3.10. I think it's pretty reasonable to inidicate that
gpb 0.9.27 does requires 3.10.

Thank you,
Diane Trout

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'stable-security'), (500, 
'oldstable-debug'), (500, 'testing'), (500, 'stable'), (110, 'unstable'), (100, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.17.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages git-buildpackage depends on:
ii  devscripts 2.22.1
ii  git1:2.35.1-1
ii  man-db 2.10.2-1
ii  python33.9.8-1
ii  python3-dateutil   2.8.1-6
ii  python3-pkg-resources  59.6.0-1.2
ii  sensible-utils 0.0.17

Versions of packages git-buildpackage recommends:
ii  cowbuilder0.89
ii  pbuilder  0.231
ii  pristine-tar  1.49
ii  python3-requests  2.27.1+dfsg-1
ii  sbuild0.83.1

Versions of packages git-buildpackage suggests:
ii  python3-notify2  0.3-4
ii  sudo 1.9.10-3
ii  unzip6.0-26

-- no debconf information