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

Re: entry-point script and private module install directory



[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
-- 
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


Reply to: