Bug#880160: dh-python: dh --with python2 invokes python3 config

2017-10-29 Thread Drew Parsons
Package: dh-python
Version: 2.20170125
Severity: normal

I'm packaging sasview
(https://anonscm.debian.org/cgit/debian-science/packages/sasview.git/)

sasview supports python2 only at the moment, so I've configured
debian/rules with
  dh $@ --with python2 --buildsystem=pybuild
  
However when I build, it fails at dh_auto_configure:
   dh_auto_configure -O--buildsystem=pybuild
I: pybuild base:184: python2.7 setup.py config 
running config
I: pybuild base:184: python3.6 setup.py config 
  File "setup.py", line 55
print "Removing existing build directory", SASVIEW_BUILD, "for a clean 
build"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean 
print(print "Removing existing build directory", SASVIEW_BUILD, "for a clean 
build")?

sasview's setup.py of course has not yet been ported to python3, which
is why I've only set --with python2.

Since I specified a python2 build, then why is 
"python3.6 setup.py config" getting called?



-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dh-python depends on:
ii  python3  3.6.3-2

dh-python recommends no packages.

Versions of packages dh-python suggests:
ii  libdpkg-perl  1.19.0.4

-- no debconf information



Bug#880160: dh-python: dh --with python2 invokes python3 config

2017-10-30 Thread Drew Parsons
The misconfiguration is triggered by
Build-Depends: python3-all, python3-setuptools

When I remove this reference to python3 then build proceeds normally
under python2.

That's good enough as a work around. But the bug still remains, that
python3 is used (if the python3-all Build-Depends is present) even if
dh --with python3 is not specified. Regardless of the Build-Depends
settings, the dh configuration is ignored.

Drew



Bug#880160: dh-python: dh --with python2 invokes python3 config

2017-10-30 Thread Drew Parsons
p.s. the code involved is l.174 in
/usr/share/perl5/Debian/Debhelper/Buildsystem/pybuild.pm