#85 Remove python2-rpm-macros
Merged 2 months ago by churchyard. Opened 2 months ago by churchyard.
rpms/ churchyard/python-rpm-macros py2_remove  into  rawhide

file removed
-64
@@ -1,64 +0,0 @@ 

- %python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

- %python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

- %python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")

- %python2_version_nodots %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")

- %python2_platform %(%{__python2} -Esc "import sysconfig; print(sysconfig.get_platform())")

- 

- %py2_shbang_opts -s

- %py2_shbang_opts_nodash %(opts=%{py2_shbang_opts}; echo ${opts#-})

- %py2_shebang_flags %(opts=%{py2_shbang_opts}; echo ${opts#-})

- %py2_shebang_fix %{expand:\\\

-   if [ -z "%{?py_shebang_flags}" ]; then

-     shebang_flags="-k"

-   else

-     shebang_flags="-ka%{py2_shebang_flags}"

-   fi

-   /usr/bin/pathfix.py -pni %{__python2} $shebang_flags}

- 

- # Use the slashes after expand so that the command starts on the same line as

- # the macro

- # The `sleep 1` commands work around a race in install; see:

- #   https://bugzilla.redhat.com/show_bug.cgi?id=1644923

- %py2_build() %{expand:\\\

-   sleep 1

-   CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\

-   %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*}

-   sleep 1

- }

- 

- %py2_build_egg() %{expand:\\\

-   sleep 1

-   CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\

-   %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*}

-   sleep 1

- }

- 

- %py2_build_wheel() %{expand:\\\

-   sleep 1

-   CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\

-   %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}

-   sleep 1

- }

- 

- %py2_install() %{expand:\\\

-   CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\

-   %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}

-   rm -rfv %{buildroot}%{_bindir}/__pycache__

- }

- 

- %py2_install_egg() %{expand:\\\

-   mkdir -p %{buildroot}%{python2_sitelib}

-   %{__python2} -m easy_install  -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}

-   rm -rfv %{buildroot}%{_bindir}/__pycache__

- }

- 

- %py2_install_wheel() %{expand:\\\

-   %{__python2} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location

-   rm -rfv %{buildroot}%{_bindir}/__pycache__

-   for distinfo in %{buildroot}%{python2_sitelib}/*.dist-info %{buildroot}%{python2_sitearch}/*.dist-info; do

-     if [ -f ${distinfo}/direct_url.json ]; then

-       rm -fv ${distinfo}/direct_url.json

-       sed -i '/direct_url.json/d' ${distinfo}/RECORD

-     fi

-   done

- }

file modified
+5 -18
@@ -1,6 +1,6 @@ 

  Name:           python-rpm-macros

  Version:        3.9

- Release:        13%{?dist}

+ Release:        34%{?dist}

  Summary:        The common Python RPM macros

  

  # macros and lua: MIT, compileall2.py: PSFv2
@@ -9,7 +9,6 @@ 

  # Macros:

  Source101:      macros.python

  Source102:      macros.python-srpm

- Source103:      macros.python2

  Source104:      macros.python3

  Source105:      macros.pybytecompile

  
@@ -48,19 +47,6 @@ 

  RPM macros for building Python source packages.

  

  

- %package -n python2-rpm-macros

- Summary:        RPM macros for building Python 2 packages

- 

- # For %%__python2 and %%python2

- Requires:       python-srpm-macros = %{version}-%{release}

- 

- # For %%py_setup

- Requires:       python-rpm-macros = %{version}-%{release}

- 

- %description -n python2-rpm-macros

- RPM macros for building Python 2 packages.

- 

- 

  %package -n python3-rpm-macros

  Summary:        RPM macros for building Python 3 packages

  
@@ -99,14 +85,15 @@ 

  %{_rpmconfigdir}/redhat/compileall2.py

  %{_rpmluadir}/fedora/srpm/python.lua

  

- %files -n python2-rpm-macros

- %{rpmmacrodir}/macros.python2

- 

  %files -n python3-rpm-macros

  %{rpmmacrodir}/macros.python3

  

  

  %changelog

+ * Mon Feb 08 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-34

+ - Remove python2-rpm-macros

+ - https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros

+ 

  * Fri Feb 05 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-13

  - Automatically word-wrap the description of extras subpackages

  - Fixes: rhbz#1922442

https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros

This is to be shipped together with an upgrade of python2.7:
The python2.7 RPM package will contain the removed macros instead.

Build succeeded.

Looks good to me.

Thanks. What have you checked? Just the diff? Or also the upgrade path to python2.7?

Thanks. What have you checked? Just the diff? Or also the upgrade path to python2.7?

Just the diff. I cannot find the PR for Python 2.7.

They all built (without python2-rpm-macros) and the upgrade path works:

$ mock -r fedora-rawhide-x86_64 --install python2-rpm-macros
...
$ mock -r fedora-rawhide-x86_64 -a 'https://download.copr.fedorainfracloud.org/results/@python/python2_macros_chnages/fedora-rawhide-$basearch/' --update
...
Installing:
 python2.7     x86_64     2.7.18-9.fc34    13 M
     replacing  python2-rpm-macros.noarch 3.9-12.fc34
...
$ mock -r fedora-rawhide-x86_64 -a 'https://download.copr.fedorainfracloud.org/results/@python/python2_macros_chnages/fedora-rawhide-$basearch/' --install python2-rpm-macros
...
Package python2.7-2.7.18-9.fc34.x86_64 is already installed.
...

If you could sanity check https://src.fedoraproject.org/fork/churchyard/rpms/python2.7/commits/py2_macros (ideally from a local clone, pagure displays the history weirdly), I'll ship both.

rebased onto 2a4d6cb

2 months ago

I've amended a change of release number and added this to the commit message:

The release is intentionally over-bumped to allow some changes of
python-rpm-macros in lower versions of Fedora without the need to bump
the version-release of python2-rpm-macros obsoleted by python2.7.

Build succeeded.

rebased onto c746b25

2 months ago

rebased onto 6261687

2 months ago

Build succeeded.

The diff here and the history in the py2_macros branch look good. Upgrade path works in mock for me as well and some python2 packages build for me too. I think this is ready to be shipped.

Pull-Request has been merged by churchyard

2 months ago
Metadata