Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

But it does move! -- Galileo Galilei


devel / comp.lang.python / Re: virtualenv and make DESTDIR=

SubjectAuthor
o Re: virtualenv and make DESTDIR=Barry Scott

1
Re: virtualenv and make DESTDIR=

<mailman.189.1646498091.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17377&group=comp.lang.python#17377

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry Scott)
Newsgroups: comp.lang.python
Subject: Re: virtualenv and make DESTDIR=
Date: Sat, 5 Mar 2022 16:34:41 +0000
Lines: 78
Message-ID: <mailman.189.1646498091.2329.python-list@python.org>
References: <05a5b570-d917-2b25-33ea-560fcbd76ce8@goebel-consult.de>
<F926CB1C-79DE-4833-A551-119B64B94675@barrys-emacs.org>
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de CkiSlP6/0YF3mEOF6rStcg+k8kxztKFWepor4DFrozLg==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pip': 0.04; 'mar': 0.07;
'used.': 0.07; 'cc:addr:python-list': 0.09; 'dependencies': 0.09;
'fedora': 0.09; 'from:addr:barry': 0.09; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'url:de': 0.09; 'url:mailman': 0.15; '2022,': 0.16; 'barry': 0.16;
'blog:': 0.16; 'from:addr:barrys-emacs.org': 0.16;
'from:name:barry scott': 0.16; 'hartmut': 0.16; 'iso': 0.16;
'message-id:@barrys-emacs.org': 0.16; 'paths': 0.16; 'python3':
0.16; 'skip:$ 20': 0.16; 'wrote:': 0.16; 'instead': 0.17;
'installing': 0.19; 'cc:addr:python.org': 0.20; 'install': 0.23;
'code': 0.23; 'idea': 0.24; 'url-ip:188.166.95.178/32': 0.25;
'url-ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'cannot':
0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25; 'library': 0.26;
'etc': 0.28; 'environment': 0.29; 'url-ip:188/8': 0.31;
'disabled': 0.32; 'url:blog': 0.33; 'script': 0.33; 'package':
0.34; 'header:In-Reply-To:1': 0.34; 'running': 0.34; 'following':
0.35; 'two': 0.39; 'use': 0.39; 'management,': 0.40; 'skip:$ 10':
0.40; 'want': 0.40; 'skip:b 10': 0.63; 'security': 0.64; 'thus':
0.64; 'lead': 0.67; 'received:217': 0.67; 'skip:/ 10': 0.69;
'note:': 0.71; 'virtual': 0.71; 'url-ip:209/8': 0.76; 'ship':
0.81; 'honor': 0.84; 'subject:make': 0.84; 'target,': 0.84
In-Reply-To: <05a5b570-d917-2b25-33ea-560fcbd76ce8@goebel-consult.de>
X-Mailer: Apple Mail (2.3693.60.0.1.1)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <F926CB1C-79DE-4833-A551-119B64B94675@barrys-emacs.org>
X-Mailman-Original-References: <05a5b570-d917-2b25-33ea-560fcbd76ce8@goebel-consult.de>
 by: Barry Scott - Sat, 5 Mar 2022 16:34 UTC

> On 4 Mar 2022, at 13:03, Hartmut Goebel <h.goebel@goebel-consult.de> 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.

If you are packaging the code then I do not see the need to use a venv at all.

Have the RPM install all the pythone code and dependencies and also install a short script that
sets up PYTHONPATH, LD_LIBRARY_PATH, etc and execs the python3 <main>.py.

Note: you usually cannot use pip when building an RPM with mock as the network is disabled inside the build for
security reasons.

I package two of my projects this was for Fedora as RPMs.

Barry

>
>
> --
> Schönen Gruß
> Hartmut Goebel
> Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
> Information Security Management, Security Governance, Secure Software Development
>
> Goebel Consult, Landshut
> http://www.goebel-consult.de
>
> Blog: https://www.goe-con.de/blog/why-a-pki-is-barely-trustworthy
> Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-11-in-troja-nichts-neues
> --
> https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor