Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8517 > unrolled thread

entry-point script and private module install directory

Started byGhislain Vaillant <ghisvail@gmail.com>
First post2016-05-11 18:10 +0200
Last post2016-05-12 15:00 +0200
Articles 7 — 2 participants

Back to article view | Back to linux.debian.maint.python


Contents

  entry-point script and private module install directory Ghislain Vaillant <ghisvail@gmail.com> - 2016-05-11 18:10 +0200
    Re: entry-point script and private module install directory Piotr Ożarowski <piotr@debian.org> - 2016-05-11 20:00 +0200
      Re: entry-point script and private module install directory Piotr Ożarowski <piotr@debian.org> - 2016-05-11 20:20 +0200
      Re: entry-point script and private module install directory Ghislain Vaillant <ghisvail@gmail.com> - 2016-05-12 10:30 +0200
        Bug in pybuild's handling of --install-lib? [Was: Re: entry-point  script and private module install directory] Ghislain Vaillant <ghisvail@gmail.com> - 2016-05-12 13:30 +0200
          Re: Bug in pybuild's handling of --install-lib? [Was: Re:  entry-point script and private module install directory] Piotr Ożarowski <piotr@debian.org> - 2016-05-12 14:20 +0200
            Re: Bug in pybuild's handling of --install-lib? [Was: Re: entry-point  script and private module install directory] Ghislain Vaillant <ghisvail@gmail.com> - 2016-05-12 15:00 +0200

#8517 — entry-point script and private module install directory

FromGhislain Vaillant <ghisvail@gmail.com>
Date2016-05-11 18:10 +0200
Subjectentry-point script and private module install directory
Message-ID<rxEIi-2LV-13@gated-at.bofh.it>
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 wrapper scripts, or is there a more clever way to tell the
entry-point to look for a custom package location? Is there a good
example you guys can point me to?

There was a similar discussion for the grip [1] package on this list,
but it did not lead to something I can use, or so I believe.

[1] https://lists.debian.org/debian-python/2016/04/msg00001.html

Many thanks,
Ghis

[toc] | [next] | [standalone]


#8518

FromPiotr Ożarowski <piotr@debian.org>
Date2016-05-11 20:00 +0200
Message-ID<rxGAp-4yw-7@gated-at.bofh.it>
In reply to#8517
[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

[toc] | [prev] | [next] | [standalone]


#8519

FromPiotr Ożarowski <piotr@debian.org>
Date2016-05-11 20:20 +0200
Message-ID<rxGTM-5ei-7@gated-at.bofh.it>
In reply to#8518
FTR:

[Piotr Ożarowski, 2016-05-11]
> 	dh_auto_install -- --install-lib=/usr/share/pyfr/
 
this one ^ should be:

 dh_auto_install -- --install-args='--install-lib=/usr/share/pyfr/'

or you can:

 export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/pyfr/

(thanks to Dmitry Shachnev for noticing)
-- 
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

[toc] | [prev] | [next] | [standalone]


#8522

FromGhislain Vaillant <ghisvail@gmail.com>
Date2016-05-12 10:30 +0200
Message-ID<rxUam-1Mc-13@gated-at.bofh.it>
In reply to#8518
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

[toc] | [prev] | [next] | [standalone]


#8523 — Bug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]

FromGhislain Vaillant <ghisvail@gmail.com>
Date2016-05-12 13:30 +0200
SubjectBug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]
Message-ID<rxWOS-4u5-23@gated-at.bofh.it>
In reply to#8522
On 12/05/16 09:22, Ghislain Vaillant wrote:
> On 11/05/16 18:55, Piotr Ożarowski wrote:
>> 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

Actually, on second look, Piotr's solution currently fails:

d/rules:

export PYBUILD_DESTDIR=$(CURDIR)/debian/tmp
[...]
override_dh_auto_install:
	dh_auto_install -- --install-lib=/usr/share/pyfr
	mv $(PYBUILD_DESTDIR)/usr/bin/pyfr $(PYBUILD_DESTDIR)/usr/share/pyfr/run


build log:

dh_auto_install -- --install-lib=/usr/share/pyfr
	install -d debian/pyfr
	install -d debian/pyfr-doc
	pybuild --install -i python{version} -p 3.5 
--install-lib=/usr/share/pyfr --dir . --dest-dir /<<PKGBUILDDIR>>/debian/tmp
usage: pybuild [ACTION] [BUILD SYSTEM ARGS] [DIRECTORIES] [OPTIONS]
pybuild: error: unrecognized arguments: --install-lib=/usr/share/pyfr


Whereas this succeeds:

d/rules:

export PYBUILD_DESTDIR=$(CURDIR)/debian/tmp
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/pyfr
[...]
override_dh_auto_install:
         dh_auto_install
         mv $(PYBUILD_DESTDIR)/usr/bin/pyfr 
$(PYBUILD_DESTDIR)/usr/share/pyfr/run


build log:

dh_auto_install
	install -d debian/pyfr
	install -d debian/pyfr-doc
	pybuild --install -i python{version} -p 3.5 --dir . --dest-dir 
/<<PKGBUILDDIR>>/debian/tmp
I: pybuild base:184: /usr/bin/python3 setup.py install --root 
/<<PKGBUILDDIR>>/debian/tmp --install-lib=/usr/share/pyfr
running install
running build
running build_py
running install_lib
[...]


Is this a bug in pybuild or am I missing something?

[toc] | [prev] | [next] | [standalone]


#8524 — Re: Bug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]

FromPiotr Ożarowski <piotr@debian.org>
Date2016-05-12 14:20 +0200
SubjectRe: Bug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]
Message-ID<rxXKV-5Dw-3@gated-at.bofh.it>
In reply to#8523
[Ghislain Vaillant, 2016-05-12]
> Is this a bug in pybuild or am I missing something?

you're missing my second reply¹

[¹] https://lists.debian.org/debian-python/2016/05/msg00043.html

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

[toc] | [prev] | [next] | [standalone]


#8525 — Re: Bug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]

FromGhislain Vaillant <ghisvail@gmail.com>
Date2016-05-12 15:00 +0200
SubjectRe: Bug in pybuild's handling of --install-lib? [Was: Re: entry-point script and private module install directory]
Message-ID<rxY4j-5Qr-43@gated-at.bofh.it>
In reply to#8524
On 12/05/16 13:16, Piotr Ożarowski wrote:
> [Ghislain Vaillant, 2016-05-12]
>> Is this a bug in pybuild or am I missing something?
>
> you're missing my second reply¹
>
> [¹] https://lists.debian.org/debian-python/2016/05/msg00043.html

Indeed, sorry for the noise.

Thanks again for the support.

Ghis

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web