Debian Bug report logs - #597105
add support to build python3-* packages

version graph

Package: debhelper; Maintainer for debhelper is Debhelper Maintainers <debhelper-devel@lists.alioth.debian.org>; Source for debhelper is src:debhelper.

Reported by: Matthias Klose <doko@debian.org>

Date: Thu, 16 Sep 2010 16:57:01 UTC

Severity: wishlist

Found in version debhelper/8.9.4

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Thu, 16 Sep 2010 16:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@debian.org>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. (Thu, 16 Sep 2010 16:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: add support to build python3-* packages
Date: Thu, 16 Sep 2010 18:53:07 +0200
Package: debhelper
Severity: wishlist

Please add support to build python3-* packages; in #597099 you'll see what is 
currently necessary to add building a python3-* package.  It would be nice if 
the overrides don't explicitly need to be added.  The various python3-* packages 
are currently in experimental.

Debhelper currently uses `pversions' to iterate over the requested python 
versions. Maybe it is just enough to iterate over the output of py3versions too, 
if dh is called --with python3?



diff -Nru pyxdg-0.19/debian/rules pyxdg-0.19/debian/rules
--- pyxdg-0.19/debian/rules     2009-12-09 21:11:54.000000000 +0100
+++ pyxdg-0.19/debian/rules     2010-09-16 16:57:45.000000000 +0200
@@ -1,4 +1,20 @@
 #!/usr/bin/make -f

 %:
-       dh $@
+       dh $@ --with python3
+
+override_dh_auto_clean:
+       dh_auto_clean
+       rm -rf build
+
+override_dh_auto_build:
+       dh_auto_build
+       set -ex; for python in $(shell py3versions -r); do \
+               $$python setup.py build; \
+       done
+
+override_dh_auto_install:
+       dh_auto_install
+       set -ex; for python in $(shell py3versions -r); do \
+               $$python setup.py install --root=$(CURDIR)/debian/tmp 
--install-layout=deb; \
+       done




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#597105; Package debhelper. (Wed, 29 Sep 2010 20:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Wed, 29 Sep 2010 20:45:03 GMT) Full text and rfc822 format available.

Message #10 received at 597105@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Matthias Klose <doko@debian.org>, 597105@bugs.debian.org
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Wed, 29 Sep 2010 16:43:21 -0400
[Message part 1 (text/plain, inline)]
Matthias Klose wrote:
> Please add support to build python3-* packages; in #597099 you'll
> see what is currently necessary to add building a python3-* package.
> It would be nice if the overrides don't explicitly need to be added.
> The various python3-* packages are currently in experimental.
> 
> Debhelper currently uses `pversions' to iterate over the requested
> python versions. Maybe it is just enough to iterate over the output
> of py3versions too, if dh is called --with python3?

Is there not something in debian/control that can be examined to see if
the package is intended to be built for python3?

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Wed, 29 Sep 2010 21:57:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 29 Sep 2010 21:57:10 GMT) Full text and rfc822 format available.

Message #15 received at 597105@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: Joey Hess <joeyh@debian.org>
Cc: 597105@bugs.debian.org, Piotr Ożarowski <piotr@debian.org>
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Wed, 29 Sep 2010 23:53:52 +0200
On 29.09.2010 22:43, Joey Hess wrote:
> Matthias Klose wrote:
>> Please add support to build python3-* packages; in #597099 you'll
>> see what is currently necessary to add building a python3-* package.
>> It would be nice if the overrides don't explicitly need to be added.
>> The various python3-* packages are currently in experimental.
>>
>> Debhelper currently uses `pversions' to iterate over the requested
>> python versions. Maybe it is just enough to iterate over the output
>> of py3versions too, if dh is called --with python3?
>
> Is there not something in debian/control that can be examined to see if
> the package is intended to be built for python3?

yes, three new substitution variables for the binary packages and the 
Python3-Version attribute (however the latter is not required, afaiu), e.g.

Package: python3-tk
Architecture: any
Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}
Provides: ${python3:Provides}
Suggests: tix, python3-tk-dbg
XB-Python3-Version: ${python3:Versions}
Description: Tkinter - Writing Tk applications with Python 3.x
 A module for writing portable GUI applications with Python 3.x using Tk.
 Also known as Tkinter.

It will not be uncommon that a source package builds both python-foo and 
python3-foo.

  Matthias




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Wed, 29 Sep 2010 22:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Piotr Ożarowski <piotr@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 29 Sep 2010 22:24:05 GMT) Full text and rfc822 format available.

Message #20 received at 597105@bugs.debian.org (full text, mbox):

From: Piotr Ożarowski <piotr@debian.org>
To: 597105@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Thu, 30 Sep 2010 00:20:44 +0200
[Matthias Klose, 2010-09-29]
> On 29.09.2010 22:43, Joey Hess wrote:
>> Is there not something in debian/control that can be examined to see if
>> the package is intended to be built for python3?

I'd say existence of "python3-*" binary package and python3-all or
python3-all-dev in build dependencies is enough to start iterating over
`py3versions -rv` output (with pythonX.Y setup.py build/install ...)

Same for python3-all-dbg build dependency and python3-*-dbg binary
packages.

Note that setup3.py should be used instead of setup.py if available




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Tue, 23 Aug 2011 06:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Éric Araujo <merwok@netwok.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Tue, 23 Aug 2011 06:21:03 GMT) Full text and rfc822 format available.

Message #25 received at 597105@bugs.debian.org (full text, mbox):

From: Éric Araujo <merwok@netwok.org>
To: Debian Bug Tracking System <597105@bugs.debian.org>
Subject: Re: using setup3.py
Date: Tue, 23 Aug 2011 08:16:10 +0200
Package: debhelper
Version: 8.9.4
Followup-For: Bug #597105

Hi,

> Maybe it is just enough to iterate over the output
> of py3versions too, if dh is called --with python3?

> I'd say existence of "python3-*" binary package and python3-all or
> python3-all-dev in build dependencies is enough to start iterating over
> `py3versions -rv` output (with pythonX.Y setup.py build/install ...)

Either of these solutions would match my naïve user’s expectations.

> Note that setup3.py should be used instead of setup.py if available
I’m not aware that people use that convention.  The 3.x distutils docs
certainly don’t suggest that at all; what I’ve seen are version checks in
setup.py or Makefile.

Regards



-- System Information:
Debian Release: wheezy
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debhelper depends on:
ii  binutils              2.21.52.20110606-2 The GNU assembler, linker and bina
ii  dpkg-dev              1.16.0.3           Debian package development tools
ii  file                  5.04-5+b1          Determines file type using "magic"
ii  html2text             1.3.2a-15          advanced HTML to text converter
ii  man-db                2.6.0.2-2          on-line manual pager
ii  perl                  5.12.4-4           Larry Wall's Practical Extraction 
ii  perl-base             5.12.4-4           minimal Perl system
ii  po-debconf            1.0.16+nmu1        tool for managing templates file t

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make                       0.59       tool that converts source archives

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Sun, 11 Sep 2011 20:54:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Gilbey <jdg@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sun, 11 Sep 2011 20:54:05 GMT) Full text and rfc822 format available.

Message #30 received at 597105@bugs.debian.org (full text, mbox):

From: Julian Gilbey <jdg@debian.org>
To: Joey Hess <joeyh@debian.org>, 597105@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Sun, 11 Sep 2011 21:42:28 +0100
On Wed, Sep 29, 2010 at 04:43:21PM -0400, Joey Hess wrote:
> Matthias Klose wrote:
> > Please add support to build python3-* packages; in #597099 you'll
> > see what is currently necessary to add building a python3-* package.
> > It would be nice if the overrides don't explicitly need to be added.
> > The various python3-* packages are currently in experimental.
> > 
> > Debhelper currently uses `pversions' to iterate over the requested
> > python versions. Maybe it is just enough to iterate over the output
> > of py3versions too, if dh is called --with python3?
> 
> Is there not something in debian/control that can be examined to see if
> the package is intended to be built for python3?

Also, the python_distutils script (called with -Spython_distutils)
barfs as well; perhaps a parallel python3_distutils could be created?

   Julian




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Sun, 11 Sep 2011 21:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Gilbey <jdg@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sun, 11 Sep 2011 21:06:06 GMT) Full text and rfc822 format available.

Message #35 received at 597105@bugs.debian.org (full text, mbox):

From: Julian Gilbey <jdg@debian.org>
To: Joey Hess <joeyh@debian.org>, 597105@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Sun, 11 Sep 2011 22:03:42 +0100
[Message part 1 (text/plain, inline)]
On Sun, Sep 11, 2011 at 09:42:28PM +0100, Julian Gilbey wrote:
> Also, the python_distutils script (called with -Spython_distutils)
> barfs as well; perhaps a parallel python3_distutils could be created?

Attached is a patch for python3_distutils from python_distutils.

   Julian
[python3.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#597105; Package debhelper. (Thu, 08 Dec 2011 22:19:19 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Thu, 08 Dec 2011 22:19:19 GMT) Full text and rfc822 format available.

Message #40 received at 597105@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: 597105@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>, Julian Gilbey <jdg@debian.org>
Subject: Re: Bug#597105: add support to build python3-* packages
Date: Thu, 8 Dec 2011 18:17:40 -0400
[Message part 1 (text/plain, inline)]
Julian's patch adding a --buildsystem=python3 seems problimatic, since
I understand that many packages will want to build for both python2 and
python3, and debhelper only supports using one buildsystem at a time.

Since pyversions/py3versions already look at debian/control,
couldn't one of them get a switch that reads the tea-leaves and
says which python versions a package is intended to build for?
debhelper's python buildsystem could them use that.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Sat, 19 Jan 2013 17:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Piotr Ożarowski <piotr@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 19 Jan 2013 17:15:05 GMT) Full text and rfc822 format available.

Message #45 received at 597105@bugs.debian.org (full text, mbox):

From: Piotr Ożarowski <piotr@debian.org>
To: debian-python@lists.debian.org
Subject: pybuild - one to rule^W build them all
Date: Sat, 19 Jan 2013 18:14:22 +0100
[Message part 1 (text/plain, inline)]
[debhelper's #538978 and #597105 bugs BCCed]

Hi,

FYI: python3 package in experimental (3.3.0-2) contains pybuild tool
with dh command sequencer integration.

You can build modules/extensions for Python 2.X *and* Python 3.X with
this debian/rules file:

 #!/usr/bin/make -f
 %:
 	dh $@ --with python2,python3 --buildsystem=pybuild

pybuild.pm will check Build-Depends* and build Python (python,
python-dev, python-dbg, python-all, python-all-dev, python-all-dbg),
Python 3 (python3, python3-dev, python3-dbg, python3-all,
python3-all-dev, python3-all-dbg) and PyPy (pypy) modules/extensions.

It can be configured via command line or CDBS-like - by exporting
PYBUILD_OPTION / PYBUILD_OPTION_interpreter / 
PYBUILD_OPTION_interpreterversion env. variables in debian/rules, f.e.

* if you don't want to use debian/*.install files,
  you can set DESTDIR for each interpreter (note that you can use "python2" for
  all python2.X interpreters and "python3" for all python3.X ones):

 export PYBUILD_DESTDIR_python2=debian/python-foo/
 export PYBUILD_DESTDIR_python2-dbg=debian/python-foo-dbg/
 export PYBUILD_DESTDIR_python3=debian/python3-foo/
 export PYBUILD_DESTDIR_python3-dbg=debian/python3-foo-dbg/
 export PYBUILD_DESTDIR_python3.1-dbg=debian/spam-pkg-with-python3.1-only/
 export PYBUILD_DESTDIR_pypy=debian/pypy-foo/

* if you want to add some custom arguments to Python 3's install command:

 export PYBUILD_INSTALL_ARGS_python3=--install-scripts=/usr/share/foo/

* you can disable (almost) any action via --disable / DISABLE env. var:

 export PYBUILD_DISABLE=configure
 export PYBUILD_DISABLE_python3.1=test

* if you want to disable Build-Depends detection:

 export PYBUILD_INTERPRETERS=python{version} python{version}-dbg
 export PYBUILD_VERSIONS=2.7 3.3

* if auto detection didn't detect the right build system:

 export PYBUILD_SYSTEM=distutils

* if you want to add a custom command before or after each iteration:

 export PYBUILD_BEFORE_BUILD=echo {version} >> '{dir}/enabled'
 export PYBUILD_AFTER_INSTALL=rm -rf '{destdir}/{install_dir}/foo/tests'


Right now it supports distutils (i.e. setup.py) and custom build systems only
(I tried to add cmake one that uses dh_auto_* tools, but failed to teach cmake
which interpreter should be used).

Anyone wants to contribute more plugins? Let me know if you want some guidance
or if I can make writing plugins easier.

If your build system is not yet supported, you can use custom build system:

 export PYBUILD_SYSTEM=custom
 export PYBUILD_CLEAN_ARGS=rm -rf {build_dir}/python{version}/
 export PYBUILD_CONFIGURE_ARGS=./configure --python={version}
 export PYBUILD_BUILD_ARGS=make build --dir={build_dir} --python={version}
 export PYBUILD_INSTALL_ARGS=make --destdir={destdir} --python={version} --install-dir={install_dir}
 export PYBUILD_TEST_ARGS_python2=cd {build_dir}; nosetests
 export PYBUILD_TEST_ARGS_python3=cd {build_dir}; python{version} -m discover


PS pybuild manpage is available also here: http://deb.li/pybuild
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#597105; Package debhelper. (Fri, 17 May 2013 23:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Fri, 17 May 2013 23:03:04 GMT) Full text and rfc822 format available.

Message #50 received at 597105@bugs.debian.org (full text, mbox):

From: Osamu Aoki <osamu@debian.org>
To: 597105@bugs.debian.org
Subject: RE: Message #5 for add support to build python3-* packages
Date: Sat, 18 May 2013 07:58:08 +0900
Hi,

As I see this bug report, 2 distinct approaches are discussed.

 * Message #5  : just build python3 only
 * Message #45 : fancy build for both python and python3

This comment on Message #5.  http://bugs.debian.org/597105#5

I used this patch to build a package and got hit by an intriguing
Bug#708138.  Jakub Wilk  helped me to understand the problem.

Script in Message #5 containing "$$python setup.py install" should have
"--force".

Here is why.  Let's think if we have 3.2 and 3.3.  This script execute
3.3 first and install script with #! line set to 3.3.  If there is no
--force, second run with python3 will not overwrite this installed
file.  This is not optimal since non-default version is written into
installed script #! line.

Regards,

Osamu



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 06:30:52 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.