#358 Python 2/3, RHEL/Fedora fixes
Merged 5 years ago by clime. Opened 5 years ago by praiskup.
Unknown source python-fixes  into  master

file modified
+4 -15
@@ -23,9 +23,6 @@

  BuildRequires: systemd

  BuildRequires: redis

  

- %global _python_bytecompile_extra 0

- %global __python %{__python3}

- 

  BuildRequires: python3-devel

  BuildRequires: python3-setuptools

  BuildRequires: python3-requests
@@ -94,21 +91,16 @@

  This package include documentation for COPR code. Mostly useful for developers

  only.

  

+ 

  %prep

  %setup -q

  

+ 

  %build

+ make -C docs %{?_smp_mflags} html

  

- %if 0%{?fedora}

- # build documentation

- pushd docs

-     PYTHONDONTWRITEBYTECODE=1 make %{?_smp_mflags} html

-     rm build/html/.buildinfo

- popd

- %endif # ?fedora

  

  %install

- 

  install -d %{buildroot}%{_sharedstatedir}/copr

  install -d %{buildroot}%{_sharedstatedir}/copr/jobs

  install -d %{buildroot}%{_sharedstatedir}/copr/public_html/results
@@ -159,9 +151,7 @@

  install -d %{buildroot}%{_pkgdocdir}/examples/%{_sysconfdir}/logstash.d

  cp -a conf/logstash/copr_backend.conf %{buildroot}%{_pkgdocdir}/examples/%{_sysconfdir}/logstash.d/copr_backend.conf

  

- %if 0%{?fedora}

-     cp -a docs/build/html %{buildroot}%{_pkgdocdir}/

- %endif

+ cp -a docs/build/html %{buildroot}%{_pkgdocdir}/

  

  %py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/backend

  
@@ -217,7 +207,6 @@

  %files doc

  %license LICENSE

  %doc

- # %{_pkgdocdir}/python-doc

  %{_pkgdocdir}/

  %exclude %{_pkgdocdir}/lighttpd

  %exclude %{_pkgdocdir}/playbooks

file modified
+41 -88
@@ -1,15 +1,9 @@

- %if 0%{?rhel} > 0

- %if 0%{?rhel} <= 7

- %global _pkgdocdir %{_docdir}/%{name}-%{version}

- %endif

- %if 0%{?rhel} <= 6

- %global __python2 %{__python}

- %endif

- %endif

- 

- %if 0%{?fedora} >= 26 || 0%{?rhel} >= 8

- %global use_python3 1

- %global __python %{__python3}

+ %if 0%{?rhel} > 7 || 0%{?fedora}

+ %global __python %_bindir/python3

+ %global with_python3 1

+ %else

+ %global __python %_bindir/python2

+ %global with_python2 1

  %endif

  

  Name:       {{{ git_dir_name }}}
@@ -27,131 +21,90 @@

  Source0:    {{{ git_dir_pack }}}

  

  BuildArch:  noarch

+ 

+ Requires:      wget

+ 

  BuildRequires: asciidoc

  BuildRequires: libxslt

  BuildRequires: util-linux

- %if 0%{?use_python3}

- BuildRequires: python3-devel

- BuildRequires: python3-setuptools

+ 

+ %if %{with python3}

+ Requires:      python3-copr >= 1.63

+ Requires:      python3-jinja2

+ Requires:      python3-simplejson

+ 

+ Recommends:    python3-progress

+ 

  BuildRequires: python3-copr

+ BuildRequires: python3-devel

+ BuildRequires: python3-jinja2

  BuildRequires: python3-pylint

  BuildRequires: python3-pytest

+ BuildRequires: python3-setuptools

  BuildRequires: python3-simplejson

- BuildRequires: python3-jinja2

- Requires:   python3-setuptools

- Requires:   python3-copr >= 1.63

- Requires:   python3-simplejson

- Requires:   python3-jinja2

- Recommends: python3-progress

  %else

- BuildRequires: python2-devel

- BuildRequires: python-setuptools

- BuildRequires: python-copr

- Requires:   python-setuptools

- Requires:   python-copr >= 1.63

- Requires:   python-simplejson

- Requires:   python-jinja2

+ Requires:      python-copr >= 1.63

+ Requires:      python-jinja2

+ Requires:      python-progress

+ Requires:      python-simplejson

  

- %if 0%{?rhel} > 6

  BuildRequires: pytest

- BuildRequires: python-simplejson

+ BuildRequires: python-copr

+ BuildRequires: python-devel

  BuildRequires: python-jinja2

  BuildRequires: python-mock

- 

- Requires:   python-progress

+ BuildRequires: python-setuptools

+ BuildRequires: python-simplejson

  %endif

  

- %endif

+ # We historically shipped empty doc package, uninstall it.

+ Obsoletes:     copr-cli-doc < 1.72

  

- %if 0%{?rhel} < 7 && 0%{?rhel} > 0

- BuildRequires: python-argparse

- %endif

+ %if 0%{?rhel} == 6

+ Requires:      python-argparse

  

- %if 0%{?rhel} < 7 && 0%{?rhel} > 0

- Requires:   python-argparse

+ BuildRequires: python-argparse

  %endif

  

- Requires:   wget

- 

  %description

  COPR is lightweight build system. It allows you to create new project in WebUI,

  and submit new builds and COPR will create yum repository from latests builds.

  

  This package contains command line interface.

  

- %if 0%{?fedora}

- %package doc

- Summary:    Code documentation for COPR

- 

- %description doc

- COPR is lightweight build system. It allows you to create new project in WebUI,

- and submit new builds and COPR will create yum repository from latests builds.

- 

- This package include documentation for COPR code. Mostly useful for developers

- only.

- %endif

- 

  %prep

  %setup -q

  

  

  %build

- %if 0%{?use_python3}

- version="%{version}" %{__python3} setup.py build

- %else

- version="%{version}" %{__python2} setup.py build

- %endif

- 

+ version="%{version}" %py_build

  mv copr_cli/README.rst ./

- 

  # convert manages

  a2x -d manpage -f manpage man/copr-cli.1.asciidoc

  

- %install

- install -d %{buildroot}%{_pkgdocdir}/

- %if 0%{?use_python3}

- version="%{version}" %{__python3} setup.py install --root %{buildroot}

- %else

- version="%{version}" %{__python2} setup.py install --root %{buildroot}

- %endif

  

+ %install

+ version="%{version}" %py_install

  ln -sf %{_bindir}/copr-cli %{buildroot}%{_bindir}/copr

- 

  install -d %{buildroot}%{_mandir}/man1

  install -p -m 644 man/copr-cli.1 %{buildroot}/%{_mandir}/man1/

  install -p man/copr.1 %{buildroot}/%{_mandir}/man1/

  

+ 

  %check

- %if 0%{?use_python3}

- python3-pylint ./copr_cli/*.py || :

- %{__python3} -m pytest tests

- %else

- %if 0%{?rhel} > 6

- # elif because we need: from _pytest.capture import capsys

- %{__python2} -m pytest tests

- %endif

- %endif

+ %{__python} -m pytest tests

+ 

  

  %files

  %{!?_licensedir:%global license %doc}

  %license LICENSE

  %doc README.rst

+ %{_bindir}/copr

  %{_bindir}/copr-cli

- %if 0%{?use_python3}

- %{python3_sitelib}/*

- %else

- %{python2_sitelib}/*

- %endif

  %{_mandir}/man1/copr-cli.1*

  %{_mandir}/man1/copr.1*

- %{_bindir}/copr

- 

+ %{python_sitelib}/*

  

- %if 0%{?fedora}

- %files doc

- %{!?_licensedir:%global license %doc}

- %license LICENSE

- %endif

  

  %changelog

  {{{ git_dir_changelog since_tag=copr-cli-1.68-1 }}}

file modified
+20 -14
@@ -3,7 +3,6 @@

  from collections import defaultdict

  import json

  from pprint import pprint

- from _pytest.capture import capsys

  import pytest

  

  import six
@@ -19,6 +18,13 @@

  from copr_cli.main import no_config_warning

  

  

+ def exit_wrap(value):

+     if type(value) == int:

+         return value

+     else:

+         return value.code

+ 

+ 

  if six.PY3:

      from unittest import mock

      from unittest.mock import MagicMock
@@ -55,7 +61,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status", "123"])

  

-     assert err.value.code == 1

+     assert exit_wrap(err.value) == 1

      stdout, stderr = capsys.readouterr()

      assert "Interrupted by user" in stderr

  
@@ -71,7 +77,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status", "123"])

  

-     assert err.value.code == 1

+     assert exit_wrap(err.value) == 1

      stdout, stderr = capsys.readouterr()

      assert "Something went wrong" in stderr

      assert error_msg in stderr
@@ -91,7 +97,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status", "123"])

  

-     assert err.value.code == 2

+     assert exit_wrap(err.value) == 2

      stdout, stderr = capsys.readouterr()

      assert error_msg in stderr

  
@@ -105,7 +111,7 @@

          with pytest.raises(SystemExit) as err:

              main.main(argv=[func_name])

  

-         assert err.value.code == 2

+         assert exit_wrap(err.value) == 2

  

          stdout, stderr = capsys.readouterr()

          assert "usage: copr" in stderr
@@ -123,7 +129,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status", "123"])

  

-     assert err.value.code == 3

+     assert exit_wrap(err.value) == 3

      stdout, stderr = capsys.readouterr()

      assert error_msg in stderr

  
@@ -140,7 +146,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["build", "prj1", "src1"])

  

-     assert err.value.code == 4

+     assert exit_wrap(err.value) == 4

      stdout, stderr = capsys.readouterr()

      assert error_msg in stderr

  
@@ -157,7 +163,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status", "123"])

  

-     assert err.value.code == 5

+     assert exit_wrap(err.value) == 5

      stdout, stderr = capsys.readouterr()

      assert error_msg in stderr

  
@@ -169,7 +175,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["cancel", "123400"])

  

-     assert err.value.code == 6

+     assert exit_wrap(err.value) == 6

      out, err = capsys.readouterr()

  

      assert "Error: Operation requires api authentication" in err
@@ -228,7 +234,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["list"])

  

-     assert err.value.code == 6

+     assert exit_wrap(err.value) == 6

      out, err = capsys.readouterr()

      assert "Pass username to command or create `~/.config/copr`" in err

  
@@ -240,7 +246,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["list"])

  

-     assert err.value.code == 6

+     assert exit_wrap(err.value) == 6

      out, err = capsys.readouterr()

      assert "Pass username to command or add it to `~/.config/copr`" in err

  
@@ -314,7 +320,7 @@

      with pytest.raises(SystemExit) as err:

          main.main(argv=["status"])

  

-     assert err.value.code == 2

+     assert exit_wrap(err.value) == 2

  

      stdout, stderr = capsys.readouterr()

      assert "usage: copr" in stderr
@@ -525,7 +531,7 @@

              "build",

              "copr_name", "http://example.com/pkgs.srpm"

          ])

-         assert err.value.code == 1

+         assert exit_wrap(err.value) == 1

  

      stdout, stderr = capsys.readouterr()

      assert response_message in stdout
@@ -554,7 +560,7 @@

              "build",

              "copr_name", "http://example.com/pkgs.srpm"

          ])

-         assert err.value.code == 1

+         assert exit_wrap(err.value) == 1

  

      stdout, stderr = capsys.readouterr()

      assert response_message in stdout

file modified
+39 -34
@@ -1,20 +1,16 @@

  {{{ export srcname=copr-common }}}

  %global srcname {{{ printf "$srcname" }}}

  

- %if 0%{?rhel} < 7 && 0%{?rhel} > 0

+ %if 0%{?rhel} && 0%{?rhel} <= 6

+ %{!?_licensedir:%global license %%doc}

  %global _pkgdocdir %{_docdir}/%{name}-%{version}

- %global __python2 %{__python}

  %endif

  

- %if 0%{?fedora} || 0%{?rhel} >= 8

+ %if 0%{?fedora} || 0%{?rhel} > 7

  %global with_python3 1

- %else

- %global with_python3 0

  %endif

  

- %if 0%{?fedora} >= 28 || 0%{?rhel} >= 8

- %global with_python2 0

- %else

+ %if 0%{?fedora} < 28 || 0%{?rhel} && 0%{?rhel} <= 7

  %global with_python2 1

  %endif

  
@@ -34,13 +30,15 @@

  

  BuildArch: noarch

  

- %if 0%{?with_python2}

+ %if %{with python2}

  BuildRequires: python2-devel

- %endif # with_python2

+ BuildRequires: python-setuptools

+ %endif

  

- %if 0%{?with_python3}

+ %if %{with python3}

  BuildRequires: python3-devel

- %endif # with_python3

+ BuildRequires: python3-setuptools

+ %endif

  

  %global _description\

  COPR is lightweight build system. It allows you to create new project in WebUI,\
@@ -52,53 +50,60 @@

  

  %description %_description

  

- %if 0%{?with_python2}

+ 

+ %if %{with python2}

  %package -n python2-%{srcname}

  Summary: %{summary}

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

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

- %endif # with_python2

+ %endif

+ 

  

- %if 0%{?with_python3}

+ %if %{with python3}

  %package -n python3-%{srcname}

  Summary: %{summary}

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

  %description -n python3-%{srcname} %_description

- %endif # with_python3

+ %endif

  

- %prep

- rm -rf *.pyc *.pyo

  

+ %prep

  %setup -q

+ 

+ 

  %build

- %if 0%{?with_python3}

- version="%{version}" %py3_build

- %endif # with_python3

+ %if %{with python3}

+ version="%version" %py3_build

+ %endif

+ 

+ %if %{with python2}

+ version="%version" %py2_build

+ %endif

  

- %if 0%{?with_python2}

- version="%{version}" %py2_build

- %endif # with_python2

  

  %install

- %if 0%{?with_python2}

- version="%{version}" %py2_install

- %endif # with_python2

+ %if %{with python3}

+ version=%version %py3_install

+ %endif

+ 

+ %if %{with python2}

+ version=%version %py2_install

+ %endif

  

- %if 0%{?with_python3}

- version="%{version}" %py3_install

- %endif # with_python3

  

- %if 0%{?with_python3}

+ %if %{with python3}

  %files -n python3-%{srcname}

  %license LICENSE

  %{python3_sitelib}/*

- %endif # with_python3

+ %endif

+ 

  

- %if 0%{?with_python2}

+ %if %{with python2}

  %files -n python2-%{srcname}

  %license LICENSE

  %{python2_sitelib}/*

- %endif # with_python2

+ %endif

+ 

  

  %changelog

  {{{ git_changelog since_tag="python-$srcname-0.3-1" }}}

file modified
+3 -7
@@ -14,9 +14,6 @@

  

  BuildArch:  noarch

  

- # switch off byte-compilation in %%{_datadir}

- %global _python_bytecompile_extra 0

- 

  BuildRequires: systemd

  BuildRequires: python3-devel

  BuildRequires: python3-munch
@@ -56,8 +53,6 @@

  useradd -r -m -g copr-dist-git -G packager,apache -c "copr-dist-git user" copr-dist-git

  /usr/bin/passwd -l copr-dist-git >/dev/null

  

- exit 0
clime commented 5 years ago

So again, this is not python2/3 related change. If you want to keep this, explain why exit 0 is not needed here in the issue description.

It is python 2/3, RHEL/Feodora change. I documented that in commit message, see commandline ... but if you prefer me to create separate commit for that, it's matter of seconds..

clime commented 5 years ago

This is ok as well. Thanks.

- 

  %install

  

  install -d %{buildroot}%{_datadir}/copr/dist_git
@@ -82,9 +77,10 @@

  

  %py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/dist_git

  

- %check

  

- PYTHONPATH=.:$PYTHONPATH python3 -B -m pytest \

+ %check

+ PYTHONPATH=".${PYTHONPATH+:$PYTHONPATH}" \

+ python3 -m pytest \

    -v --cov-report term-missing --cov ./dist_git ./tests/

  

  %post

file modified
+3 -8
@@ -25,7 +25,7 @@

  %staticdir/css/style-overwrite.css              \

  %templatedir/project_info.html                  \

  %templatedir/user_meta.html                     \

- %templatedir/welcome.html   			\

+ %templatedir/welcome.html                       \

  %templatedir/contact_us.html

  

  %global devel_files \
@@ -63,9 +63,6 @@

  BuildRequires: graphviz

  %endif

  

- %global _python_bytecompile_extra 0

- %global __python %{__python3}

- 

  BuildRequires: python3-devel

  

  %if %{with check}
@@ -196,11 +193,9 @@

  

  

  %build

- # build documentation

  %if %{with doc}

- pushd documentation

- PYTHONDONTWRITEBYTECODE=1 COPR_CONFIG=../../documentation/copr-documentation.conf make %{?_smp_mflags} python

- popd

+ COPR_CONFIG=../../documentation/copr-documentation.conf \

+   make -C documentation %{?_smp_mflags} python

  %endif

  

  

file modified
+4 -22
@@ -1,7 +1,4 @@

  %global with_test 1

- %if 0%{?rhel} < 7 && 0%{?rhel} > 0

- %global _pkgdocdir %{_docdir}/%{name}-%{version}

- %endif

  

  Name:       {{{ git_dir_name }}}

  Version:    {{{ git_dir_version lead=1 }}}
@@ -21,7 +18,6 @@

  BuildRequires: util-linux

  BuildRequires: systemd

  

- %global _python_bytecompile_extra 0

  BuildRequires: python3-devel

  BuildRequires: python3-setuptools

  BuildRequires: python3-six
@@ -87,23 +83,12 @@

  

  

  %build

- 

- CFLAGS="%{optflags}" %{__python3} setup.py build

- 

- %if 0%{?fedora}

- # build documentation

- pushd docs

- make %{?_smp_mflags} html

- rm _build/html/.buildinfo

- popd

- %endif # ?fedora

- 

+ %py3_build

+ make -C docs %{?_smp_mflags} html

  

  %install

- 

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

- find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f

- 

+ %py3_install

+ find %{buildroot} -name '*.exe' -delete

  

  install -d %{buildroot}%{_sysconfdir}/copr-keygen

  install -d %{buildroot}%{_sysconfdir}/sudoers.d
@@ -127,10 +112,7 @@

  

  cp -a configs/sudoers/copr_signer %{buildroot}%{_sysconfdir}/sudoers.d/copr_signer

  

- # docs

- %if 0%{?fedora}

  cp -a docs/_build/html %{buildroot}%{_pkgdocdir}/

- %endif

  

  %check

  

file modified
+41 -60
@@ -1,17 +1,14 @@

- %if 0%{?rhel} < 7 && 0%{?rhel} > 0

+ %if 0%{?rhel} && 0%{?rhel} <= 6

+ %{!?_licensedir:%global license %%doc}

  %global _pkgdocdir %{_docdir}/%{name}-%{version}

- %global __python2 %{__python}

+ %global sphinxbuild SPHINXBUILD=%_bindir/sphinx-1.0-build

  %endif

  

- %if 0%{?fedora} || 0%{?rhel} >= 8

+ %if 0%{?fedora} || 0%{?rhel} > 7

  %global with_python3 1

- %else

- %global with_python3 0

  %endif

  

- %if 0%{?fedora} >= 28 || 0%{?rhel} >= 8

- %global with_python2 0

- %else

+ %if 0%{?fedora} < 28 || 0%{?rhel} && 0%{?rhel} <= 7

  %global with_python2 1

  %endif

  
@@ -34,8 +31,8 @@

  BuildRequires: libxslt

  BuildRequires: util-linux

  

- %if 0%{?with_python2}

- %if 0%{?rhel} < 8 && 0%{?rhel} > 0

+ %if %{with python2}

+ %if 0%{?rhel} && 0%{?rhel} <= 7

  BuildRequires: python-setuptools

  BuildRequires: python-requests

  BuildRequires: python-requests-toolbelt
@@ -47,7 +44,11 @@

  BuildRequires: pytest

  BuildRequires: python2-devel

  # for doc package

+ %if 0%{?rhel} && 0%{?rhel} == 6

+ BuildRequires: python-sphinx10

+ %else

  BuildRequires: python-sphinx

+ %endif

  BuildRequires: python-docutils

  %else

  BuildRequires: python2-setuptools
@@ -76,7 +77,7 @@

  

  %description %_description

  

- %if 0%{?with_python2}

+ %if %{with python2}

  %package -n python2-copr

  Summary: %summary

  
@@ -101,9 +102,9 @@

  %{?python_provide:%python_provide python2-copr}

  

  %description -n python2-copr %_description

- %endif # with_python2

+ %endif # with python2

  

- %if 0%{?with_python3}

+ %if %{with python3}

  %package -n python3-copr

  Summary:        Python interface for Copr

  
@@ -137,10 +138,9 @@

  This package contains python interface to access Copr service. Mostly useful

  for developers only.

  

- %endif # with_python3

+ %endif # with python3

  

  

- %if 0%{?fedora}

  %package -n python-copr-doc

  Summary:    Code documentation for python-copr package

  
@@ -151,90 +151,71 @@

  This package includes documentation for python-copr. Mostly useful for

  developers only.

  

- %endif # ?fedora

  

  %prep

  %setup -q

  

- %if 0%{?with_python3}

+ %if %{with python3}

  rm -rf %{py3dir}

  cp -a . %{py3dir}

- %endif # with_python3

+ %endif # with python3

  

  %build

- %if 0%{?with_python3}

- pushd %{py3dir}

- CFLAGS="%{optflags}" version="%{version}" %{__python3} setup.py build

- popd

- %endif # with_python3

+ %if %{with python3}

+ version=%version %py3_build

+ %endif

  

- %if 0%{?with_python2}

- CFLAGS="%{optflags}" version="%{version}" %{__python2} setup.py build

- %endif # with_python2

+ %if %{with python2}

+ version=%version %py2_build

+ %endif

  

  mv copr/README.rst ./

  

- %if 0%{?fedora}

  # build documentation

- pushd docs

- make %{?_smp_mflags} html

- popd

- %endif # ?fedora

+ make -C docs %{?_smp_mflags} html %{?sphinxbuild}

  

- %install

  

- %if 0%{?with_python3}

- pushd %{py3dir}

- version="%{version}" %{__python3} setup.py install --skip-build --root %{buildroot}

- find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f

- popd

- %endif # with_python3

+ %install

+ %if %{with python3}

+ version=%version %py3_install

+ %endif

  

- %if 0%{?with_python2}

- version="%{version}" %{__python2} setup.py install --skip-build --root %{buildroot}

- find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f

- %endif # with_python2

+ %if %{with python2}

+ version=%version %py2_install

+ %endif

  

- #doc

- install -d %{buildroot}%{_pkgdocdir}/

+ find %{buildroot} -name '*.exe' -delete

  

- %if 0%{?fedora}

+ install -d %{buildroot}%{_pkgdocdir}

  cp -a docs/_build/html %{buildroot}%{_pkgdocdir}/

- %endif

  

  %check

- %if 0%{?with_python3}

- python3-pylint copr/*py copr/client/ copr/client_v2/ || :

- pushd %{py3dir}

+ %if %{with python3}

  %{__python3} -m pytest copr/test

- %endif # with_python3

+ %endif

  

- %if 0%{?with_python2}

+ %if %{with python2}

  %{__python2} -m pytest copr/test

- %endif # with_python2

+ %endif

  

- # compatibility for RHEL <= 6

- %{!?_licensedir:%global license %%doc}

  

- %if 0%{?with_python3}

+ %if %{with python3}

  %files -n python3-copr

  %license LICENSE

  %doc README.rst

  %{python3_sitelib}/*

- %endif # with_python3

+ %endif # with python3

  

- %if 0%{?with_python2}

+ %if %{with python2}

  %files -n python2-copr

  %license LICENSE

  %doc README.rst

  %{python2_sitelib}/*

- %endif # with_python2

+ %endif # with python2

  

- %if 0%{?fedora}

  %files -n python-copr-doc

  %license LICENSE

  %doc %{_pkgdocdir}

- %endif

  

  %changelog

  {{{ git_changelog since_tag=python-copr-1.88-1 }}}

file modified
+4 -6
@@ -1,14 +1,12 @@

  %if 0%{?fedora} || 0%{?rhel} > 7

+ %global __python        %__python3

  %global python          python3

  %global python_pfx      python3

- %global python_build    %py3_build

- %global python_install  %py3_install

  %global rpm_python      python3-rpm

  %else

+ %global __python        %__python2

  %global python          python2

  %global python_pfx      python

- %global python_build    %py2_build

- %global python_install  %py2_install

  %global rpm_python      rpm-python

  %endif

  
@@ -68,7 +66,7 @@

  PYTHON=%{python} ./run_tests.sh

  

  %build

- name="%{name}" version="%{version}" summary="%{summary}" %python_build

+ name="%{name}" version="%{version}" summary="%{summary}" %py_build

  a2x -d manpage -f manpage man/copr-rpmbuild.1.asciidoc

  

  %install
@@ -88,7 +86,7 @@

  install -p -m 644 man/copr-rpmbuild.1 %{buildroot}/%{_mandir}/man1/

  install -p -m 755 bin/copr-sources-custom %buildroot%_bindir

  

- name="%{name}" version="%{version}" summary="%{summary}" %python_install

+ name="%{name}" version="%{version}" summary="%{summary}" %py_install

  

  %files

  %license LICENSE

@@ -1,6 +1,5 @@

  %if 0%{?rhel} < 7 && 0%{?rhel} > 0

  %global _pkgdocdir %{_docdir}/%{name}-%{version}

- %global __python2 %{__python}

  %endif

  

  %global moduletype apps

(documented in commit messages)

rebased onto a5e6a33c834a367acbe7ebb9482152b373dab1dc

5 years ago

rebased onto 08fc43f0c526af35cc56057e7d824fa97b63280c

5 years ago

Why getting rid of this package. I find it nice to have documentation separated because it is not small any more.

I think that this subpackage is some leftover; check that it contains no files except for license.

We are not building any docs for python-copr-common.

This change has not been commented in the PR description and it is also not python2/3 related fix. Please, add a note about it into PR description with explanation for the change.

Ouch, thanks for pining this, this is not complete.. Yes, it's just useless command here, but we should have passwd || : above.

rebased onto 5aa1b783f78ff21157a8eeac5d902f24c50047ef

5 years ago

So again, this is not python2/3 related change. If you want to keep this, explain why exit 0 is not needed here in the issue description.

Please don't squash your commits at least until PR is over. Thanks to that I needed to go through the whole changeset again instead of just looking what you have changed based on the comments.

rebased onto 9324752

5 years ago

It is python 2/3, RHEL/Feodora change. I documented that in commit message, see commandline ... but if you prefer me to create separate commit for that, it's matter of seconds..

This is ok as well. Thanks.

LGTM. Please, don't squash your commits prematurely.

Otherwise, thanks for the good work on this.

Pull-Request has been merged by clime

5 years ago

Please don't squash your commits at least until PR is over. Thanks to that I needed to go through the whole changeset again instead of just looking what you have changed based on the comments.

Mind that pagure is a toy; and we should rather focus on commandline use. So:
As well you can checkout old commit id (mentioned here in PR: 08fc43f) do the rebase (git rebase origin/master), and diff change ... (git diff 9324752).