#3 Adaptations to build Python 3 on EPEL
Closed 2 years ago by jcline. Opened 2 years ago by duck.
rpms/ duck/python-isodate python3_epel  into  master

file modified
+9 -21
@@ -3,11 +3,10 @@ 



  %global modulename isodate

- %global with_python3 1


  Name:           python-%{modulename}

  Version:        0.5.4

- Release:        12%{?dist}

+ Release:        13%{?dist}

  Summary:        An ISO 8601 date/time/duration parser and formatter

  License:        BSD

  URL:            https://pypi.python.org/pypi/%{modulename}
@@ -16,10 +15,8 @@ 

  BuildRequires:  python2-devel

  BuildRequires:  python2-setuptools


- %if 0%{?with_python3}

- BuildRequires:  python3-devel

- BuildRequires:  python3-setuptools

- %endif # if with_python3

+ BuildRequires:  python%{python3_pkgversion}-devel

+ BuildRequires:  python%{python3_pkgversion}-setuptools


  %global _description\

  This module implements ISO 8601 date, time and duration parsing. The\
@@ -48,11 +45,10 @@ 


  %description -n python2-%{modulename} %_description


- %if 0%{?with_python3}

- %package -n python3-%{modulename}

+ %package -n python%{python3_pkgversion}-%{modulename}

  Summary:        An ISO 8601 date/time/duration parser and formatter


- %description -n python3-%{modulename}

+ %description -n python%{python3_pkgversion}-%{modulename}

  This module implements ISO 8601 date, time and duration parsing. The

  implementation follows ISO8601:2004 standard, and implements only date/time

  representations mentioned in the standard. If something is not mentioned there,
@@ -70,15 +66,12 @@ 

  the Python date and datetime classes. Additionally fractional seconds are

  limited to microseconds. That means if the parser finds for instance

  nanoseconds it will round it to microseconds.

- %endif



  %setup -qn %{modulename}-%{version}


- %if 0%{?with_python3}

  rm -rf %{py3dir}

  cp -a . %{py3dir}

- %endif


While this still works, it is not needed anymore.


  %if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
@@ -87,20 +80,16 @@ 

  CFLAGS="%{optflags}" %{__python2} -c 'import setuptools; execfile("setup.py")' build



- %if 0%{?with_python3}

  pushd %{py3dir}

  %{__python3} setup.py build


- %endif



  rm -rf %{buildroot}


- %if 0%{?with_python3}

  pushd %{py3dir}

  %{__python3} setup.py install -O1 --skip-build --root %{buildroot}


- %endif


  %if 0%{?fedora} >= 11 || 0%{?rhel} >= 6

  %{__python2} setup.py install -O1 --skip-build --root %{buildroot}
@@ -111,11 +100,9 @@ 


  %{__python2} setup.py test


- %if 0%{?with_python3}

  pushd %{py3dir}

  %{__python3} setup.py test


- %endif



  %files -n python2-%{modulename}
@@ -123,14 +110,15 @@ 




- %if 0%{?with_python3}

- %files -n python3-%{modulename}

+ %files -n python%{python3_pkgversion}-%{modulename}

  %doc CHANGES.txt README.rst TODO.txt



- %endif 



+ * Mon Mar 18 2019 Marc Dequènes (Duck) <duck@redhat.com> - 0.5.4-13

+ - Adaptations to build Python 3 on EPEL


  * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-12

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild


Based on what I can see in other packages of the current adaptations needed for Python 3 in EPEL, I made similar changes to this package.

A successful build was made with these changes: https://copr.fedorainfracloud.org/coprs/duck/osas-infra-team-rpm-repo-devel/build/869960/

Please merge #2 first.

While this still works, it is not needed anymore.

The change looks good to me, would it be possible to merge it?

rebased onto 1c582eb

2 years ago

Seems reasonable to me, although I'm inclined to only apply it to the epel7 branch and clean up the master branch for rawhide. I'm not the primary contact for this package, but if no one else chimes in I'll do that (no need to open another PR).

@jcline it was tested on rawhide too and built well. the goal being to avoid the spec file to diverge and cause extra burden. Anyway, I'm a newbie RPM packager, so I may not see the whole picture.


Yeah, most people have strong opinions about this particular issue. I'm in the "Git has branches so we should use them" camp, which gets rid of most or all of the conditionals in specfiles. Others like to maintain a single specfile for all supported releases and not mess with branches.

Okay, so I applied this patch to the epel7 branch and did a little bit of additional tidying and a bump to 0.5.4 for EPEL7. The update is filed at https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-e5cd5069af. Thanks!

Pull-Request has been closed by jcline

2 years ago