#5 Drop python2 and fix hardcoded python3
Closed 3 years ago by kalev. Opened 3 years ago by fepitre.
rpms/ fepitre/pycairo python3  into  master

file modified
+18 -50
@@ -1,3 +1,5 @@ 

+ %bcond_with check

+ 

  Name: pycairo

  Version: 1.18.2

  Release: 6%{?dist}
@@ -10,52 +12,28 @@ 

  BuildRequires: cairo-devel

  BuildRequires: gcc

  BuildRequires: pkgconfig

- BuildRequires: python2-devel

- BuildRequires: python2-setuptools

- BuildRequires: python3-devel

- BuildRequires: python3-pytest

- BuildRequires: python3-setuptools

+ BuildRequires: python%{python3_pkgversion}-devel

+ BuildRequires: python%{python3_pkgversion}-setuptools

+ %if %{with check}

+ BuildRequires: python%{python3_pkgversion}-pytest

+ %endif

  

  %description

  Python bindings for the cairo library.

  

- %package -n python2-cairo

- Summary: Python 2 bindings for the cairo library

- %{?python_provide:%python_provide python2-cairo}

- # Renamed in F27

- Obsoletes: pycairo < 1.15.2

- Provides: pycairo = %{version}-%{release}

- Provides: pycairo%{?_isa} = %{version}-%{release}

- 

- %description -n python2-cairo

- Python 2 bindings for the cairo library.

- 

- %package -n python3-cairo

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

  Summary: Python 3 bindings for the cairo library

- %{?python_provide:%python_provide python3-cairo}

+ %{?python_provide:%python_provide python%{python3_pkgversion}-cairo}

  

- %description -n python3-cairo

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

  Python 3 bindings for the cairo library.

  

- %package -n python2-cairo-devel

- Summary: Libraries and headers for pycairo

- Requires: python2-cairo%{?_isa} = %{version}-%{release}

- Requires: python2-devel

- # Renamed in F27

- Obsoletes: pycairo-devel < 1.15.2

- Provides: pycairo-devel = %{version}-%{release}

- Provides: pycairo-devel%{?_isa} = %{version}-%{release}

- 

- %description -n python2-cairo-devel

- This package contains files required to build wrappers for cairo add-on

- libraries so that they interoperate with pycairo.

- 

- %package -n python3-cairo-devel

+ %package -n python%{python3_pkgversion}-cairo-devel

  Summary: Libraries and headers for py3cairo

- Requires: python3-cairo%{?_isa} = %{version}-%{release}

- Requires: python3-devel

+ Requires: python%{python3_pkgversion}-cairo%{?_isa} = %{version}-%{release}

+ Requires: python%{python3_pkgversion}-devel

  

- %description -n python3-cairo-devel

+ %description -n python%{python3_pkgversion}-cairo-devel

  This package contains files required to build wrappers for cairo add-on

  libraries so that they interoperate with py3cairo.

  
@@ -63,32 +41,22 @@ 

  %autosetup -p1

  

  %build

- %py2_build

  %py3_build

  

  %install

- %py2_install

  %py3_install

  

+ %if %{with check}

  %check

  %{__python3} setup.py test

+ %endif

  

- %files -n python2-cairo

- %license COPYING*

- %{python2_sitearch}/cairo/

- %{python2_sitearch}/pycairo*.egg-info

- 

- %files -n python3-cairo

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

  %license COPYING*

  %{python3_sitearch}/cairo/

  %{python3_sitearch}/pycairo*.egg-info

  

- %files -n python2-cairo-devel

- %dir %{_includedir}/pycairo

- %{_includedir}/pycairo/pycairo.h

- %{_libdir}/pkgconfig/pycairo.pc

- 

- %files -n python3-cairo-devel

+ %files -n python%{python3_pkgversion}-cairo-devel

  %dir %{_includedir}/pycairo

  %{_includedir}/pycairo/py3cairo.h

  %{_libdir}/pkgconfig/py3cairo.pc

no initial comment

3 new commits added

  • spec: add bcond for check
  • spec: replace hardcoded python3
  • spec: drop python2
3 years ago

Sorry, we can't do this yet: gimp still needs the python2 version of this.

Pull-Request has been closed by kalev

3 years ago

Maybe you can just cherry-pick other commits? Else, I can open another PR without the drop of python2.

Why are the other commits needed? e.g. why do you want to add a conditional to disable checks? Why do you want to change hardcoded python3 (hardcoding is what packaging guidelines suggest, https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/)

It's for building it for CentOS 8 with python38 version. I intend to build a COPR repo with more python38 packages than the few ones provided. Preliminary repo is here: https://copr.fedorainfracloud.org/coprs/fepitre/epel-8-python38/. I've added also the possibility to ignore tests if needed. As most of the current built packages, almost all of the same PR as here have been merged in other Fedora repository when no EPEL branch was available or up to date. Please here consider to create at least EPEL 8 branch with the content of the current PR spec.

Oh, that's really nice you are doing this! I am however not really interested in cluttering Fedora the spec file with unnecessary stuff. Sorry.

I don't think an EPEL 8 branch is appropriate here either as the package is in RHEL 8. EPEL packages have a rule to never replace base RHEL packages. Maybe you can just keep a local git repo with your changes for now?

I don't think an EPEL 8 branch is appropriate here either as the package is in RHEL 8. EPEL packages have a rule to never replace base RHEL packages. Maybe you can just keep a local git repo with your changes for now?

I think in this case a better solution would be to update directly https://git.centos.org/rpms/pycairo/blob/c8/f/SPECS/pycairo.spec. I'll do that. Thank you for your interest and time.

Okay! Sounds like a plan.