virtualenv and make DESTDIR=

Kirill Ratkin kvratkin at yandex.ru
Sat Mar 5 12:18:36 EST 2022


Hi,

As far I know there is tool rpmvenv 
(https://github.com/kevinconway/rpmvenv).

Try it, maybe ot helps.

04.03.2022 16:03, Hartmut Goebel wrote:
> Hi,
>
> How can I make installing a virtual environment honor DESTDIR? How can 
> I install a virtual environment in $(DESTDIR)$(PREFIX), which behaves 
> as being set-up in $(PREFIX)? (Of course, this virtual environment can 
> not be used. My aim is to ship it as part of a rpm package)
>
> In Makefiles is good practice to honor DESTDIR in the "install" 
> target, like this
>
> install:
>     install -t $(DESTDIR)$(PREFIX)/bin build/bin/my-tool
>
> Now when running
>
>     python3 -m venv $(DESTDIR)$(PREFIX)
>
> all paths in this virtual environment refer to $(DESTDIR)$(PREFIX) 
> instead of just $$(PREFIX)
>
> Any ideas?
>
>
> Background:
>
> More about DESTDIR: 
> https://www.gnu.org/prep/standards/html_node/DESTDIR.html
>
> Following Redhat's commendations, I want to install my (somewhat 
> complex) software into /opt/my-software. To make it easier for users 
> to use the software, my idea was to setup a virtual environment in 
> /opt/my-software. Thus users can easily use 
> /opt/my-software/bin/python and have the library provided by 
> my-software available. My Software also includes some scripts, which 
> will also reside in /opt/my-software/bin and refer to 
> /opt/my-software/bin/python. This will avoid to require users to set 
> up PYTHONPATH when thy want to use MY Software.
>
>


More information about the Python-list mailing list