From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] [RFC] python3: mark as EXTERNALLY-MANAGED
Date: Wed, 03 May 2023 23:47:00 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43735@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]
There is a new pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages python3-ext-mgr
https://github.com/void-linux/void-packages/pull/43735
[RFC] python3: mark as EXTERNALLY-MANAGED
this prevents users from breaking xbps-installed python3 packages by using pip outside of a virtual environment. Error message adapted from gentoo's, debian's, and the example from PEP 668
see https://peps.python.org/pep-0668/ for more details
closes #43703
```
$ pip install --user foo
error: externally-managed-environment
× This environment is externally managed
╰─>
The system-wide Python installation in Void should be maintained
using the system package manager, xbps.
If the package in question is not packaged for Void, please
consider installing it inside a virtual environment, e.g.:
python3 -m venv /path/to/venv
. /path/to/venv/bin/activate
pip install mypackage
To exit the virtual environment, run:
deactivate
The virtual environment is not deleted, and can be re-entered by
re-sourcing the activate file.
To automatically manage virtual environments, pipx (from python3-pipx)
can be used.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
```
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### TODOs
- [ ] write a news post notifying users of this change
- [ ] (potentially) update [void-linux/void-docker](https://github.com/void-linux/void-docker) containers to not break due to this change
cc: @ahesford
A patch file from https://github.com/void-linux/void-packages/pull/43735.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python3-ext-mgr-43735.patch --]
[-- Type: text/x-diff, Size: 2293 bytes --]
From d6cbc9cc388c44b58d69db6e731dda30d66f80a5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 3 May 2023 17:41:28 -0400
Subject: [PATCH] python3: mark as EXTERNALLY-MANAGED
this prevents users from breaking xbps-installed python3 packages by
using pip outside of a virtual environment. Error message adapted from
gentoo's, debian's, and the example from PEP 668
see https://peps.python.org/pep-0668/ for more details
closes #43703
---
srcpkgs/python3/files/EXTERNALLY-MANAGED | 21 +++++++++++++++++++++
srcpkgs/python3/template | 5 ++++-
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/python3/files/EXTERNALLY-MANAGED
diff --git a/srcpkgs/python3/files/EXTERNALLY-MANAGED b/srcpkgs/python3/files/EXTERNALLY-MANAGED
new file mode 100644
index 000000000000..507c9e917628
--- /dev/null
+++ b/srcpkgs/python3/files/EXTERNALLY-MANAGED
@@ -0,0 +1,21 @@
+[externally-managed]
+Error=
+ The system-wide Python installation in Void should be maintained
+ using the system package manager, xbps.
+
+ If the package in question is not packaged for Void, please
+ consider installing it inside a virtual environment, e.g.:
+
+ python3 -m venv /path/to/venv
+ . /path/to/venv/bin/activate
+ pip install mypackage
+
+ To exit the virtual environment, run:
+
+ deactivate
+
+ The virtual environment is not deleted, and can be re-entered by
+ re-sourcing the activate file.
+
+ To automatically manage virtual environments, pipx (from python3-pipx)
+ can be used.
diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template
index aebf41852764..45852a17bcc6 100644
--- a/srcpkgs/python3/template
+++ b/srcpkgs/python3/template
@@ -4,7 +4,7 @@
#
pkgname=python3
version=3.11.3
-revision=1
+revision=2
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
@@ -135,6 +135,9 @@ do_install() {
${DESTDIR}/usr/bin/python${version%.*}-config \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+
+ # https://peps.python.org/pep-0668/
+ vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 usr/lib/python${version%.*}
}
python3-devel_package() {
next reply other threads:[~2023-05-03 21:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 21:47 classabbyamp [this message]
2023-10-06 16:25 ` ahesford
2023-10-06 16:25 ` [PR PATCH] [Closed]: " ahesford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43735@inbox.vuxu.org \
--to=classabbyamp@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).