Path: csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Piotr =?utf-8?Q?O=C5=BCarowski?= Newsgroups: linux.debian.maint.python,linux.debian.devel.mentors Subject: Re: entry-point script and private module install directory Date: Wed, 11 May 2016 20:00:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Wed May 11 17:56:01 2016 Old-Return-Path: X-Amavis-Spam-Status: No, score=-6.979 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, HEADER_FROM_DIFFERENT_DOMAINS=0.001, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -6.1 Mail-Followup-To: debian-python@lists.debian.org, "debian-mentors@lists.debian.org" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: Debian GNU/Linux (4.3.0-0.bpo.1-amd64) User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailing-List: archive/latest/13847 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/20160511175539.GS2764@sar0.p1otr.com Approved: robomod@news.nic.it Lines: 33 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 11 May 2016 19:55:39 +0200 X-Original-Message-ID: <20160511175539.GS2764@sar0.p1otr.com> X-Original-References: <57335528.2070405@gmail.com> Xref: csiph.com linux.debian.maint.python:8518 linux.debian.devel.mentors:36061 [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