#2 Remove the Python 2 subpackage
Merged 2 years ago by churchyard. Opened 2 years ago by pviktori.
rpms/ pviktori/py4j drop-py2  into  master

file modified
+10 -68
@@ -1,11 +1,6 @@ 

  %global encoding UTF-8

  #%%global fail_fast 1

  

- # python3 for Fedora only (not available at EPEL)

- %if 0%{?fedora}

- %bcond_without python3

- %endif

- 

  # build conditionals for debug performance

  %bcond_without test_python

  %if 0%{?fail_fast} == 0
@@ -16,7 +11,7 @@ 

  

  Name:           py4j

  Version:        0.10.7

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Dynamically access in Python programs to arbitrary Java objects

  

  License:        BSD
@@ -27,21 +22,9 @@ 

  

  BuildArch:      noarch

  

- BuildRequires:  python2-devel python2-setuptools

- 

- %if %{with python3}

  BuildRequires:  python3-devel python3-setuptools

  BuildRequires:  python3-sphinx

  BuildRequires:  python3-nose

- %global python_version_suffix -3

- %else

- BuildRequires:  python2-nose

- %if 0%{?fedora}

- BuildRequires:  python2-sphinx

- %else

- BuildRequires:  python-sphinx

- %endif

- %endif

  

  BuildRequires:  ant-junit maven-local

  BuildRequires:  sonatype-oss-parent
@@ -63,26 +46,6 @@ 

  Py4J also enables Java programs to call back Python objects.

  Py4J is distributed under the BSD license.

  

- %package -n python2-%{name}

- Summary:        Py4J enables Python2 programs to dynamically access arbitrary Java objects

- Requires:       python2

- Requires:       %{name}-java = %{version}-%{release}

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

- Obsoletes:      %{name} < 0.10.3-1

- 

- 

- %description -n python2-%{name}

- Py4J enables Python2 programs running in a Python interpreter

- to dynamically access Java objects in a Java Virtual Machine.

- Methods are called as if the Java objects resided in the Python

- interpreter and Java collections can be accessed through standard

- Python collection methods.

- Py4J also enables Java programs to call back Python objects.

- Py4J is distributed under the BSD license.

- 

- This package is for usage with Python2 only.

- 

- %if %{with python3} 

  %package -n python3-%{name}

  Summary:        Py4J enables Python3 programs to dynamically access arbitrary Java objects

  Requires:       python3
@@ -99,7 +62,6 @@ 

  Py4J is distributed under the BSD license.

  

  This package is for usage with Python3 only.

- %endif

  

  

  %package java
@@ -182,14 +144,11 @@ 

  # install jar later with maven

  sed -i "/data_files/d" %{name}-python/setup.py

  

- # build separately for python3 in special subfolder

- %if %{with python3}

- cp -a %{name}-python %{name}-python3

+ mv %{name}-python %{name}-python3

  sed -i -r -e 's|(executable=")python|\1%{__python3}|g' \

-  -e 's|(executable="nosetests)|\1%{python_version_suffix}|g' \

+  -e 's|(executable="nosetests)|\1-3|g' \

   -e 's|%{name}-python|%{name}-python3|g' \

   %{name}-java/build.xml

- %endif

  

  

  %build
@@ -200,22 +159,17 @@ 

  %endif

  popd

  

- pushd %{name}-python

- %py2_build

- popd

- 

- %if %{with python3}

  pushd %{name}-python3

  %py3_build

  popd

- %endif

  

  %if %{with html}

  # FIXME autodoc does not work for current tarball

  sed -i "s|.sphinx.ext.autodoc.* | |" %{name}-web/conf.py

  # sphinx is restricted in epel

  %if 0%{?fedora}

- sphinx-build%{python_version_suffix} %{?_smp_mflags} -a -b html -v -T %{name}-web html

+ sed -i "s|py4j-python/src|py4j-python3/src|" %{name}-web/conf.py

+ sphinx-build-3 %{?_smp_mflags} -a -b html -v -T %{name}-web html

  %else

  sphinx-build %{name}-web html

  %endif
@@ -226,15 +180,9 @@ 

  

  

  %install

- pushd %{name}-python

- %py2_install

- popd

- 

- %if %{with python3}

  pushd %{name}-python3

  %py3_install

  popd

- %endif

  

  %mvn_artifact %{name}-java/pom.xml %{name}-java/%{name}.jar

  %mvn_install -J %{name}-java/javadoc
@@ -264,28 +212,18 @@ 

  # test go!

  ant -f %{name}-java/build.xml python-test 2>&1 |tee python-test.log

  # be sure we ran with python3

- %if %{with python3}

  if [ ! $(grep -c '\[exec\] Python 3' python-test.log) ]; then

   comment 'error: wrong python version!'

   exit 1

  fi

  %endif

- %endif

  

  

- %files -n python2-%{name}

- %license %{name}-python/LICENSE.txt

- %doc README.rst

- %{python2_sitelib}/*.egg-info

- %{python2_sitelib}/%{name}/

- 

- %if %{with python3}

  %files -n python3-%{name}

- %license %{name}-python/LICENSE.txt

+ %license %{name}-python3/LICENSE.txt

  %doc README.rst

  %{python3_sitelib}/*.egg-info

  %{python3_sitelib}/%{name}/

- %endif

  

  %files java -f .mfiles

  %license %{name}-java/LICENSE.txt
@@ -306,6 +244,10 @@ 

  

  

  %changelog

+ * Wed Sep 19 2018 Petr Viktorin <pviktori@redhat.com> - 0.10.7-2

+ - Remove the Python 2 subpackage

+   rhbz#1628178

+ 

  * Sun Jul 15 2018 Raphael Groner <projects.rg@smart.ms> - 0.10.7-1

  - new version

  - adjust patch for Base64 replacement

Pull-Request has been merged by churchyard

2 years ago

Thanks. How can we get the package compatible with python34 or python36 in EPEL7?

step 1 - check and get all the deps in.
step 2 - follow the specfile outlined in https://fedoraproject.org/wiki/User:Bkabrda/EPEL7_Python3
step 3 - put it in the epel branch(es) only

I can not agree with step 3. The linked wiki page states the specfile is backwards compatible to Fedora. That said, it's not needed to handle two versions of specfile to not let it get more complicated with merges than needed.

Maybe you focus with step 3 on the python2 parts. Of course, that should not get into Fedora. But we can provide python3 only in EPEL7, so no chance to get accidently in touch with python2 anywhere.

whatever you prefer, step 3 is just my humble opinion.