#5 Add %python3_other_* counterparts for %python3_* macros in EPEL 7
Merged 5 years ago by tibbs. Opened 5 years ago by tadej.
rpms/ tadej/python-rpm-macros python3_other  into  epel7

file modified
-1
@@ -1,5 +1,4 @@ 

  %__python3 /usr/bin/python3.4

- %__python3_other /usr/bin/python3.6

  

  %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

  %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

file added
+38
@@ -0,0 +1,38 @@ 

+ %__python3_other /usr/bin/python3.6

+ 

+ %python3_other_sitelib %(%{__python3_other} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

+ %python3_other_sitearch %(%{__python3_other} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

+ %python3_other_version %(%{__python3_other} -c "import sys; sys.stdout.write(sys.version[:3])")

+ %python3_other_version_nodots %(%{__python3_other} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")

+ 

+ %py3_other_shbang_opts -s

+ 

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

+ # the macro

+ %py3_other_build() %{expand:\\\

+   CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} build --executable="%{__python3_other} %{py3_other_shbang_opts}" %{?*}

+   sleep 1

+ }

+ 

+ %py3_other_build_egg() %{expand:\\\

+   CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} bdist_egg %{?*}

+   sleep 1

+ }

+ 

+ %py3_other_build_wheel() %{expand:\\\

+   CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}

+   sleep 1

+ }

+ 

+ %py3_other_install() %{expand:\\\

+   CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}

+ }

+ 

+ %py3_other_install_egg() %{expand:\\\

+   mkdir -p %{buildroot}%{python3_other_sitelib}

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

+ }

+ 

+ %py3_other_install_wheel() %{expand:\\\

+   pip%{python3_other_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps

+ }

file modified
+7 -2
@@ -1,6 +1,6 @@ 

  Name:           python-rpm-macros

  Version:        3

- Release:        19%{?dist}

+ Release:        20%{?dist}

  Summary:        The unversioned Python RPM macros

  

  License:        MIT
@@ -8,6 +8,7 @@ 

  Source1:        macros.python-srpm

  Source2:        macros.python2

  Source3:        macros.python3

+ Source4:        macros.python3_other

  

  BuildArch:      noarch

  # For %%python3_pkgversion used in %%python_provide
@@ -45,7 +46,7 @@ 

  

  %install

  mkdir -p %{buildroot}/%{rpmmacrodir}

- install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \

+ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \

    %{buildroot}/%{rpmmacrodir}/

  

  
@@ -60,9 +61,13 @@ 

  

  %files -n python3-rpm-macros

  %{rpmmacrodir}/macros.python3

+ %{rpmmacrodir}/macros.python3_other

  

  

  %changelog

+ * Thu Jun 21 2018 Tadej Janež <tadej.j@nez.si> - 3-20

+ - Add %%python3_other_* counterparts for %%python3_* macros in EPEL 7

+ 

  * Mon Jun 18 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3-19

  - Add %%pypi_source macro.

  

This will make packaging for the other Python 3 version in EPEL 7 (currently, Python 3.6), as easy and convenient as packaging for the main Python 3 version in EPEL 7 (currently, Python 3.4).

I created a new file, macros.python3_other because it follows the macros.python2/macros.python3 separation and makes it easy to compare/diff with the macros.python3 file.

One thing I'm not sure about is the %py3dir macro. What should we do about it?

Let the %py3dir macro die. It has been a bad practice and it's just kept for backward compatibility.

I'd rather be explicit here.

rebased onto 26f8224f8db27b1c9db1fc8bd0921f62d648fb97

5 years ago

I'd rather be explicit here.

Agreed, I've updated the PR.

Let the %py3dir macro die. It has been a bad practice and it's just kept for backward compatibility.

Thanks for the info.

As far as this PR is concerned, it is probably enough to not introduce a %py3dir_other macro.
And deal with the removal of %py3dir macro in the future.

OK. I'm +1 here. @cstratak, could you please also review this? I'm not an admin de jure here.

rebased onto 8ef2281

5 years ago

I've rebased the PR on top of @tibbs's %pypi_source macro addition.

@cstratak, could you take a look?

I'm sorry; I would have pulled this in with my %pypi_source update but I wasn't sure what had been decided about %py3dir.

Unfortunately if this gets pushed now it will obsolete the %pypi_source update. If we do it soon it will only slow things down by three days which isn't too bad.

Unfortunately nobody ever gives karma on this kind of update, so they it takes the whole 16 days to hit stable.

py3dir for py3 other is not desired. so we don't add it.

Pull-Request has been merged by tibbs

5 years ago

I'm sorry; I would have pulled this in with my %pypi_source update but I wasn't sure what had been decided about %py3dir.

No worries, I understand.

Unfortunately if this gets pushed now it will obsolete the %pypi_source update. If we do it soon it will only slow things down by three days which isn't too bad.
Unfortunately nobody ever gives karma on this kind of update, so they it takes the whole 16 days to hit stable.

Yea, agreed.

As @churchyard wrote, we don't want to introduce %py3dir_other since %py3dir is on its way to retirement.

@tibbs, maybe you could fill in for @cstratak and review this so we could push this together with %pypi_source?

:) This got merged while I was writing my comment. @tibbs, thanks!

Update is https://bodhi.fedoraproject.org/updates/python-rpm-macros-3-20.el7

A buildroot override will be in place soon (so these macros will work for koji builds).

@tibbs maybe edit the update description?

I thought I did, but these things rarely seem to work for me.