[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ‘dh’ invoking Python 2 ‘pyversions’ in a Python 3-only package



On Sunday, March 30, 2014 17:01:05 Ben Finney wrote:
> Howdy all,
> 
> I'm attempting to build a Python 3-only package, but ‘dh’ insists on
> trying to find some Python 2 versions.
> 
> The ‘debian/control’ contains a “X-Python3-Versions” field, and does not
> contain any “X-Python-Versions” field. This is as I want it, because
> there are no valid Python 2 versions for this package.
> 
> However, ‘dh_auto_clean(1)’ ignores the “X-Python3-Versions” field and
> blithely assumes I have omitted the “X-Python-Versions” field by mistake::
> 
>     $ dh clean --with python3
>        dh_testdir
>        debian/rules override_dh_auto_clean
>     dh_auto_clean
>     pyversions: missing X(S)-Python-Version in control file, fall back to
> debian/pyversions pyversions: missing debian/pyversions file, fall back to
> supported versions
> 
> This has the result ‘python setup.py clean -a’ is called, even though
> I've deliberately set this up as a Python 3-only package.
> 
> Since the package's ‘setup.py’ knows it's not compatible with Python 2,
> it exits with an error, breaking the build.
> 
> How can I inform Debhelper that it should not attempt to find any Python
> 2 versions for building or cleaning this package?

Using pybuild should do it.

dh $@ --with python3 --buildsystem=pybuild

That will avoid the assumption that python2 should be attempted.

Scott K


Reply to: