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

Re: usr/bin/ scripts for console_scripts which lead to binaries-have-file-conflict when python 2 + 3



On Dec 13, 2013, at 05:32 PM, Olivier Berger wrote:

>I'm working on rdflib whose setup.py comes with :
>    entry_points = {
>        'console_scripts': [
>            'rdfpipe = rdflib.tools.rdfpipe:main',
>            'csv2rdf = rdflib.tools.csv2rdf:main',
>            'rdf2dot = rdflib.tools.rdf2dot:main',
>            'rdfs2dot = rdflib.tools.rdfs2dot:main',
>            'rdfgraphisomorpishm = rdflib.tools.graphisomorphism:main',
>            ],
>
>So, when building with pybuild with Python2 and Python3, these are
>installed in 2 sets of scripts in each package's /usr/bin/ and only
>differ on their respective shebang.
>
>Lintian detects the conflict OK (binaries-have-file-conflict) but it
>isn't clear to me how to resolve this.
>
>Should I add a python-rdflib-tools package (depending on either versions
>of python-rdflib or python3-rdflib ?), and then avoid installing
>the Python3 version by using a
>PYBUILD_INSTALL_ARGS_python3=--install-scripts=... and some .pyremove ?)
>
>I though maybe of another option, which is to install in each package's
>/usr/share/python[3]-rdflib/tools and only add symlinks for one of the
>packages...
>
>Is there a best practice in this case ?

Will users of the command line scripts (e.g. rdfpipe, csv2rdf, etc.) care
whether it's Python 2 or Python 3?  For most such projects, it doesn't matter,
in which case, I would say that the /usr/bin scripts should be the Python 3
version, all else being equal.  In which case, you can probably just discard
the Python 2 shebanged versions.

If it still makes sense to have both Python 2 and Python 3 versions of the
libraries, then you might indeed want to have a separate binary package for
the /usr/bin scripts, but they'd only contain the Python 3 version.  Having
the -tools package (or -bin or -cli or -scripts or whatever ;) just contain
symlinks from /usr/bin into /usr/share/python3-rdflib/tools might make sense.

-Barry


Reply to: