From f6698e60eb7df9074c24e5bbe7cee958d6600f3e Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Tue, 8 Aug 2023 17:53:47 +0200
Subject: [PATCH] override denied userspace installation of packages with
 Python>=3.11

---
 Makefile | 5 +++--
 README   | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 5003806..46c2404 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ python-requirements:
 	@echo "+-----------------------------+"
 	@echo "| installing Python modules   |"
 	@echo "+-----------------------------+"
-		if [ -z $VIRTUAL_ENV ]; then pip install --user -U -r $(CURDIR)/requirements.txt; else pip install -U -r $(CURDIR)/requirements.txt; fi
+		if [ -z $(VIRTUAL_ENV) ]; then pip install --user --break-system-packages -U -r $(CURDIR)/requirements.txt; else pip install -U -r $(CURDIR)/requirements.txt; fi
 	@echo "+-----------------------------+"
 	@echo "| installed Python modules    |"
 	@echo "+-----------------------------+"
@@ -22,7 +22,7 @@ confignator:
 	@echo "| installing confignator Python package |"
 	@echo "+---------------------------------------+"
 		$(MAKE) build -C $(CURDIR)/Tst/confignator
-	    if [ -z $VIRTUAL_ENV ]; then pip install --user -U --force-reinstall $(CURDIR)/Tst/confignator/dist/*.whl; else pip install -U --force-reinstall $(CURDIR)/Tst/confignator/dist/*.whl; fi
+	    if [ -z $(VIRTUAL_ENV) ]; then pip install --user --break-system-packages -U --force-reinstall $(CURDIR)/Tst/confignator/dist/*.whl; else pip install -U --force-reinstall $(CURDIR)/Tst/confignator/dist/*.whl; fi
 		$(MAKE) build-doc -C $(CURDIR)/Tst/confignator
 	@echo "+--------------------------------------+"
 	@echo "| installed confignator Python package |"
@@ -86,3 +86,4 @@ set-start-scripts-permissions:
 	@echo "| setting permissions for the start scripts (execute) |"
 	@echo "+-----------------------------------------------------+"
 	    $(MAKE) all -C $(CURDIR)/Tst/
+
diff --git a/README b/README
index 35acd00..6536d14 100644
--- a/README
+++ b/README
@@ -33,6 +33,9 @@ This file documents the required steps to get the UVIE EGSE software up and runn
    'make python-requirements' in the CCS base directory or use 'pip install [--user] -r requirements.txt'.
    If using a venv, it must have been created using the --system-site-packages option.
    For more details, see requirements.txt
+   Since Python 3.11, pip --user installs of packages are denied by default to avoid conflicts with
+   system-managed packages - the recommended solution is to use a venv. Alternatively, installing in
+   local userspace is still possible by passing the --break-system-packages flag.
 
 
 # INSTALLATION
-- 
GitLab