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

Re: entry-point script and private module install directory



On 11/05/16 18:55, Piotr Ożarowski wrote:
[Ghislain Vaillant, 2016-05-11]
Dear all,

I have a package (pyfr), which is meant to be used as a command-line
application only.

The main script (pyfr) is installed via setuptools'
entry_points['console_scripts'], which generates the entry-point
automatically and places it under /usr/bin. However, when I install the
implementation module in a private location, such as /usr/share/pyfr,
the entry-point cannot find the module and load the application.

Right now, the module is installed in the dist-packages location,
although it is not intended to be public. It was just the easiest
solution to start with at the time.

What is the standard way to circumvent this? Do other packages use custom

you can create a wrapper or patch /usr/bin script to
sys.path.append('/usr/share/pyfr') but the easiest solution is to
install the script to /usr/share/pyfr/ (if the module is "pyfr" as well,
simply rename the script to "run" or any other name) and then symlink it
to /usr/bin/pyfr)

   override_dh_auto_install:
	dh_auto_install -- --install-lib=/usr/share/pyfr/
	mv debian/pyfr/usr/bin/pyfr debian/pyfr/usr/share/pyfr/run

and add "/usr/share/pyfr/run /usr/bin/pyfr" to debian/pyfr.links

Thanks Piotr, that's the solution I have been looking for.

Ghis


Reply to: