- Remove shebangs from from python-base libraries in _libdir

(bsc#1193179).
- Readjust patches:
  - bpo-31046_ensurepip_honours_prefix.patch
  - decimal.patch
  - python-3.3.0b1-fix_date_time_compiler.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=91
This commit is contained in:
Matej Cepl 2021-11-29 16:33:18 +00:00 committed by Git OBS Bridge
parent b52e0022b1
commit 14c194c885
5 changed files with 22 additions and 12 deletions

View File

@ -55,7 +55,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
.. note::
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -56,27 +56,27 @@ def _disable_pip_configuration_settings(
@@ -52,27 +52,27 @@ def _disable_pip_configuration_settings(
os.environ['PIP_CONFIG_FILE'] = os.devnull
@ -88,7 +88,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
Note that calling this function will alter both sys.path and os.environ.
"""
@@ -119,6 +119,8 @@ def _bootstrap(*, root=None, upgrade=Fal
@@ -115,6 +115,8 @@ def _bootstrap(*, root=None, upgrade=Fal
args = ["install", "--no-cache-dir", "--no-index", "--find-links", tmpdir]
if root:
args += ["--root", root]
@ -97,7 +97,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
if upgrade:
args += ["--upgrade"]
if user:
@@ -191,6 +193,11 @@ def _main(argv=None):
@@ -187,6 +189,11 @@ def _main(argv=None):
help="Install everything relative to this alternate root directory.",
)
parser.add_argument(
@ -109,7 +109,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
"--altinstall",
action="store_true",
default=False,
@@ -209,6 +216,7 @@ def _main(argv=None):
@@ -205,6 +212,7 @@ def _main(argv=None):
return _bootstrap(
root=args.root,
@ -139,7 +139,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1263,7 +1263,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoni
@@ -1262,7 +1262,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoni
install|*) ensurepip="" ;; \
esac; \
$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
@ -148,7 +148,7 @@ Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
fi
altinstall: commoninstall
@@ -1273,7 +1273,7 @@ altinstall: commoninstall
@@ -1272,7 +1272,7 @@ altinstall: commoninstall
install|*) ensurepip="--altinstall" ;; \
esac; \
$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \

View File

@ -25,7 +25,7 @@
if (sep == NULL) {
--- a/setup.py
+++ b/setup.py
@@ -2201,7 +2201,7 @@ class PyBuildExt(build_ext):
@@ -2203,7 +2203,7 @@ class PyBuildExt(build_ext):
undef_macros = []
if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
include_dirs = []

View File

@ -4,7 +4,7 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -782,11 +782,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
@@ -781,11 +781,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(DTRACE_OBJS) \
$(srcdir)/Modules/getbuildinfo.c
$(CC) -c $(PY_CORE_CFLAGS) \

View File

@ -1,8 +1,12 @@
-------------------------------------------------------------------
Mon Nov 29 00:17:07 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Don't collect automatic Requires from python-base libraries in
%_libdir (bsc#1192249).
- Remove shebangs from from python-base libraries in _libdir
(bsc#1193179).
- Readjust patches:
- bpo-31046_ensurepip_honours_prefix.patch
- decimal.patch
- python-3.3.0b1-fix_date_time_compiler.patch
-------------------------------------------------------------------
Wed Nov 17 09:49:22 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -315,8 +315,6 @@ Provides: python3-typing = %{version}
Obsoletes: python3-typing < %{version}
Provides: python3-xml = %{version}
Obsoletes: python3-xml < %{version}
%else
%define __requires_exclude_from ^%{_libdir}/python%{python_version}/.*$
%endif
%description -n %{python_pkg_name}-base
@ -416,6 +414,7 @@ other applications.
# drop Autoconf version requirement
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
%if %{primary_interpreter}
# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
for dir in Lib Tools; do
# find *.py, filter to files that contain bad shebangs
@ -424,6 +423,13 @@ for dir in Lib Tools; do
| xargs -0 grep -lE '^#! *(/''usr/.*bin/(env +)?)?python' \
| xargs sed -r -i -e '1s@^#![[:space:]]*(/''usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!%{_bindir}/python3@'
done
%else
# For non-primary Python, just don't bother (bsc#1193179) and remove all
# those shebangs
for dir in Lib Tools; do
find $dir -name '*.py' -type f -exec sed -i '1{/^#!.*python/ d}' '{}' \;
done
%endif
# drop in-tree libffi and expat
rm -r Modules/_ctypes/libffi* Modules/_ctypes/darwin