forked from pool/python313
- Security
- gh-113659: Skip .pth files with names starting with a dot or
hidden file attribute.
- gh-112302: Created a Software Bill-of-Materials document and
tooling for tracking dependencies.
- Core and Builtins
- gh-107901: Compiler duplicates basic blocks that have an eval
breaker check, no line number, and multiple predecessors.
- gh-107901: A jump leaving an exception handler back to normal
code no longer checks the eval breaker.
- gh-113655: Set the C recursion limit to 4000 on Windows, and
10000 on Linux/OSX. This seems to be near the sweet spot to
maintain safety, but not compromise backwards compatibility.
- gh-113710: Add typed stack effects to the interpreter DSL, along
with various instruction annotations.
- gh-77046: On Windows, file descriptors wrapping Windows handles
are now created non inheritable by default (PEP 446). Patch by
Zackery Spytz and Victor Stinner.
- gh-113853: Guarantee that all executors make progress. This then
guarantees that tier 2 execution always makes progress.
- gh-113753: Fix an issue where the finalizer of PyAsyncGenASend
objects might not be called if they were allocated from a free
list.
- gh-107901: Compiler changed so that synthetic jumps which are
not at loop end no longer check the eval breaker.
- gh-113703: Fix a regression in the codeop module that was
causing it to incorrectly identify incomplete f-strings. Patch
by Pablo Galindo
- gh-89811: Check for a valid tp_version_tag before performing
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python313?expand=0&rev=3
96 lines
4.4 KiB
Diff
96 lines
4.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
Date: Mon, 15 Feb 2021 12:19:27 +0100
|
|
Subject: [PATCH] 00251: Change user install location
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Set values of base and platbase in sysconfig from /usr
|
|
to /usr/local when RPM build is not detected
|
|
to make pip and similar tools install into separate location.
|
|
|
|
Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
|
|
Downstream only.
|
|
|
|
We've tried to rework in Fedora 36/Python 3.10 to follow https://bugs.python.org/issue43976
|
|
but we have identified serious problems with that approach,
|
|
see https://bugzilla.redhat.com/2026979 or https://bugzilla.redhat.com/2097183
|
|
|
|
pypa/distutils integration: https://github.com/pypa/distutils/pull/70
|
|
|
|
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
|
|
Co-authored-by: Michal Cyprian <m.cyprian@gmail.com>
|
|
Co-authored-by: Lumír Balhar <frenzy.madness@gmail.com>
|
|
---
|
|
Lib/site.py | 9 ++++++-
|
|
Lib/sysconfig.py | 49 +++++++++++++++++++++++++++++++++++++-
|
|
Lib/test/test_sysconfig.py | 17 +++++++++++--
|
|
3 files changed, 71 insertions(+), 4 deletions(-)
|
|
|
|
Index: Python-3.13.0a3/Lib/site.py
|
|
===================================================================
|
|
--- Python-3.13.0a3.orig/Lib/site.py
|
|
+++ Python-3.13.0a3/Lib/site.py
|
|
@@ -395,8 +395,15 @@ def getsitepackages(prefixes=None):
|
|
return sitepackages
|
|
|
|
def addsitepackages(known_paths, prefixes=None):
|
|
- """Add site-packages to sys.path"""
|
|
+ """Add site-packages to sys.path
|
|
+
|
|
+ '/usr/local' is included in PREFIXES if RPM build is not detected
|
|
+ to make packages installed into this location visible.
|
|
+
|
|
+ """
|
|
_trace("Processing global site-packages")
|
|
+ if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ:
|
|
+ PREFIXES.insert(0, "/usr/local")
|
|
for sitedir in getsitepackages(prefixes):
|
|
if os.path.isdir(sitedir):
|
|
addsitedir(sitedir, known_paths)
|
|
Index: Python-3.13.0a3/Lib/test/test_sysconfig.py
|
|
===================================================================
|
|
--- Python-3.13.0a3.orig/Lib/test/test_sysconfig.py
|
|
+++ Python-3.13.0a3/Lib/test/test_sysconfig.py
|
|
@@ -115,8 +115,19 @@ class TestSysConfig(unittest.TestCase):
|
|
for scheme in _INSTALL_SCHEMES:
|
|
for name in _INSTALL_SCHEMES[scheme]:
|
|
expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars)
|
|
+ tested = get_path(name, scheme)
|
|
+ # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
|
|
+ if tested.startswith('/usr/local'):
|
|
+ # /usr/local should only be used in posix_prefix
|
|
+ self.assertEqual(scheme, 'posix_prefix')
|
|
+ # Fedora CI runs tests for venv and virtualenv that check for other prefixes
|
|
+ self.assertEqual(sys.prefix, '/usr')
|
|
+ # When building the RPM of Python, %check runs this with RPM_BUILD_ROOT set
|
|
+ # Fedora CI runs this with RPM_BUILD_ROOT unset
|
|
+ self.assertNotIn('RPM_BUILD_ROOT', os.environ)
|
|
+ tested = tested.replace('/usr/local', '/usr')
|
|
self.assertEqual(
|
|
- os.path.normpath(get_path(name, scheme)),
|
|
+ os.path.normpath(tested),
|
|
os.path.normpath(expected),
|
|
)
|
|
|
|
@@ -340,7 +351,7 @@ class TestSysConfig(unittest.TestCase):
|
|
self.assertTrue(os.path.isfile(config_h), config_h)
|
|
|
|
def test_get_scheme_names(self):
|
|
- wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv']
|
|
+ wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv', 'rpm_prefix']
|
|
if HAS_USER_BASE:
|
|
wanted.extend(['nt_user', 'osx_framework_user', 'posix_user'])
|
|
self.assertEqual(get_scheme_names(), tuple(sorted(wanted)))
|
|
@@ -352,6 +363,8 @@ class TestSysConfig(unittest.TestCase):
|
|
cmd = "-c", "import sysconfig; print(sysconfig.get_platform())"
|
|
self.assertEqual(py.call_real(*cmd), py.call_link(*cmd))
|
|
|
|
+ @unittest.skipIf('RPM_BUILD_ROOT' not in os.environ,
|
|
+ "Test doesn't expect Fedora's paths")
|
|
def test_user_similar(self):
|
|
# Issue #8759: make sure the posix scheme for the users
|
|
# is similar to the global posix_prefix one
|