#5 Update to 0.12.2 (rhbz#1476259)
Merged 5 years ago by rmattes. Opened 5 years ago by cottsay.
Unknown source master  into  master

file modified
+1
@@ -12,3 +12,4 @@

  /rosdep-0.11.0-13a9b20.tar.gz

  /rosdep-23f30f7e42f4a7184de001fe1ef21ad44a015a4c.tar.gz

  /rosdep-6cdef863382f5c812030ee1c15e43c4f0b98149e.tar.gz

+ /rosdep-0.12.2.tar.gz

@@ -0,0 +1,41 @@

+ From 1fc7cb713c3062a9e689a2adf38d9082ed33e781 Mon Sep 17 00:00:00 2001

+ From: Scott K Logan <logans@cottsay.net>

+ Date: Fri, 14 Sep 2018 20:52:03 -0700

+ Subject: [PATCH] Decode stdout during documentation build (#628)

+ 

+ I think that I'm seeing this because doc builds are happening with

+ python 3 on Fedora. Here is the error I'm seeing:

+ 

+ ```

+ ...

+   File "./rosdep_doc_utils.py", line 38, in run

+     nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out))

+   File "/usr/lib64/python3.6/re.py", line 191, in sub

+     return _compile(pattern, flags).sub(repl, string, count)

+ TypeError: cannot use a string pattern on a bytes-like object

+ ```

+ ---

+  doc/rosdep_doc_utils.py | 4 ++--

+  1 file changed, 2 insertions(+), 2 deletions(-)

+ 

+ diff --git a/doc/rosdep_doc_utils.py b/doc/rosdep_doc_utils.py

+ index b94a71a..6832a9b 100644

+ --- a/doc/rosdep_doc_utils.py

+ +++ b/doc/rosdep_doc_utils.py

+ @@ -35,14 +35,14 @@ def run(self):

+                  [py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['-h'])"]

+              )

+              return [

+ -                nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out))

+ +                nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode()))

+              ]

+          if 'install' in self.arguments:

+              out = subprocess.check_output(

+                  [py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['install', '-h'])"]

+              )

+              return [

+ -                nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out))

+ +                nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode()))

+              ]

+  

+  

@@ -0,0 +1,45 @@

+ From 0fd352821e0c77253445510cbe867df69d726e68 Mon Sep 17 00:00:00 2001

+ From: Scott K Logan <logans@cottsay.net>

+ Date: Fri, 14 Sep 2018 20:51:29 -0700

+ Subject: [PATCH] Direct test for redhat.rpm_expand_cmd at the function itself

+  (#627)

+ 

+ This test only applies to rpm_expand_cmd - if they RPM python module

+ is installed, that will be used instead, which makes this test break

+ on those systems (when %fedora doesn't expand to 27).

+ 

+ If we want to cover redhat.rpm_expand or redhat.rpm_expand_py, we

+ should devise a different approach.

+ ---

+  test/test_rosdep_redhat.py | 8 ++++----

+  1 file changed, 4 insertions(+), 4 deletions(-)

+ 

+ diff --git a/test/test_rosdep_redhat.py b/test/test_rosdep_redhat.py

+ index 512b467..4069e8c 100644

+ --- a/test/test_rosdep_redhat.py

+ +++ b/test/test_rosdep_redhat.py

+ @@ -37,20 +37,20 @@ def get_test_dir():

+      return os.path.abspath(os.path.join(os.path.dirname(__file__), 'redhat'))

+  

+  

+ -def test_rpm_expand():

+ -    from rosdep2.platforms.redhat import rpm_expand

+ +def test_rpm_expand_cmd():

+ +    from rosdep2.platforms.redhat import rpm_expand_cmd

+  

+      m = Mock()

+      m.return_value = ''

+  

+      # Non-macro test, should return the string unmodified

+ -    val = rpm_expand('test-string', exec_fn=m)

+ +    val = rpm_expand_cmd('test-string', exec_fn=m)

+      assert val == 'test-string', val

+  

+      # Macro test, should return expanded rpm tag

+      with open(os.path.join(get_test_dir(), 'rpm-E-fedora'), 'r') as f:

+          m.return_value = f.read()

+ -    val = rpm_expand('%fedora', exec_fn=m)

+ +    val = rpm_expand_cmd('%fedora', exec_fn=m)

+      assert val == '27', val

+  

+  

file modified
+44 -44
@@ -5,18 +5,20 @@

  %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}

  %endif

  

- %global commit 6cdef863382f5c812030ee1c15e43c4f0b98149e

- %global shortcommit %(c=%{commit}; echo ${c:0:7})

  %global realname rosdep

  

  Name:           python-%{realname}

- Version:        0.11.4

- Release:        13%{?dist}

+ Version:        0.12.2

+ Release:        1%{?dist}

  Summary:        ROS System Dependency Installer

  

  License:        BSD

  URL:            http://ros.org/wiki/%{realname}

- Source0:        https://github.com/ros-infrastructure/%{realname}/archive/%{commit}/%{realname}-%{commit}.tar.gz

+ Source0:        https://github.com/ros-infrastructure/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz

+ 

+ # Already accepted upstream

+ Patch0:         %{name}-0.12.2-rpm_expand.patch

+ Patch1:         %{name}-0.12.2-doc-build-python3.patch

  

  BuildArch:      noarch

  # Documentation
@@ -27,6 +29,7 @@

  BuildRequires:  python2-pyyaml

  BuildRequires:  python2-catkin_pkg

  BuildRequires:  python2-devel

+ BuildRequires:  python2-mock

  BuildRequires:  python2-nose

  BuildRequires:  python2-rosdistro >= 0.4.0

  BuildRequires:  python2-rospkg >= 1.0.34
@@ -35,6 +38,7 @@

  BuildRequires:  python3-PyYAML

  BuildRequires:  python3-catkin_pkg

  BuildRequires:  python3-devel

+ BuildRequires:  python3-mock

  BuildRequires:  python3-nose

  BuildRequires:  python3-rosdistro >= 0.4.0

  BuildRequires:  python3-rospkg >= 1.0.34
@@ -54,6 +58,9 @@

  Requires:       python2-catkin_pkg

  Requires:       python2-rosdistro >= 0.4.0

  Requires:       python2-rospkg >= 1.0.34

+ %if 0%{?fedora}

+ Recommends:     python2-rpm

+ %endif

  Obsoletes:      python-%{realname} < 0.11.4-5

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

  
@@ -72,6 +79,9 @@

  Requires:       python3-catkin_pkg

  Requires:       python3-rosdistro >= 0.4.0

  Requires:       python3-rospkg >= 1.0.34

+ %if 0%{?fedora}

+ Recommends:     python3-rpm

+ %endif

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

  

  %description -n python3-%{realname}
@@ -84,83 +94,73 @@

  %endif

  

  %prep

- %setup -qn %{realname}-%{commit}

+ %autosetup -p1 -n %{realname}-%{version}

  

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

- %endif # with_python3

- 

- find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'

+ # Get rid of non-executable-script errors from rpmlint

+ sed -i 's|#!/usr/bin/env python||' src/%{realname}2/*.py src/%{realname}2/platforms/*.py

  

  %build

- %{__python2} setup.py build

- pushd doc

- make man

- make html

- rm -f html/.buildinfo

- popd

+ %py2_build

+ 

+ PYTHONPATH=$PWD/src make -C doc man html

+ rm doc/_build/html/.buildinfo

  

  %if 0%{?with_python3}

- pushd %{py3dir}

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

- popd

+ %py3_build

  %endif # with_python3

  

  %install

- rm -rf $RPM_BUILD_ROOT

+ %py2_install

  

- %{__python2} setup.py install --force --skip-build --root $RPM_BUILD_ROOT

  mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1

  install -p -m 0644 doc/man/rosdep.1 $RPM_BUILD_ROOT%{_mandir}/man1

  mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ros/rosdep/sources.list.d/

  touch $RPM_BUILD_ROOT%{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list

  

- # Get rid of non-executable-script errors from rpmlint

- sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python2_sitelib}/%{realname}2/*.py

- sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python2_sitelib}/%{realname}2/platforms/*.py

- 

  %if 0%{?with_python3}

- pushd %{py3dir}

- %{__python3} setup.py install --force --skip-build --root $RPM_BUILD_ROOT

- popd

- 

- sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python3_sitelib}/%{realname}2/*.py

- sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python3_sitelib}/%{realname}2/*.py

+ %py3_install

  %endif # with_python3

  

- # Get rid of hidden file in documentation folder

- rm -f doc/_build/.buildinfo

- 

- 

- # Cannot currently run tests because they need to query Github

- # %check

- # PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitelib} nosetests -w test

+ # Cannot currently run all of the tests because some need to query Github

+ %check

+ PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitelib} nosetests-2 test.test_rosdep_redhat

  

+ %if 0%{?with_python3}

+ PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} nosetests-3 test.test_rosdep_redhat

+ %endif

  

  %files -n python2-%{realname}

  %license LICENSE

  %doc README.md doc/_build/html

  %if !0%{?with_python3}

  %{_bindir}/*

- %endif

- %{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info

- %{python2_sitelib}/%{realname}2

  %{_mandir}/man1/*.gz

  %dir %{_sysconfdir}/ros/rosdep/

  %dir %{_sysconfdir}/ros/rosdep/sources.list.d/

  %ghost %{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list

+ %endif

+ %{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info

+ %{python2_sitelib}/%{realname}2

  

  %if 0%{?with_python3}

  %files -n python3-%{realname}

  %license LICENSE

  %{_bindir}/*

+ %{_mandir}/man1/*.gz

+ %dir %{_sysconfdir}/ros/rosdep/

+ %dir %{_sysconfdir}/ros/rosdep/sources.list.d/

+ %ghost %{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list

  %{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info

  %{python3_sitelib}/%{realname}2

  %endif

  

  %changelog

+ * Fri Sep 14 2018 Scott K Logan <logans@cottsay.net> - 0.12.2-1

+ - Update to 0.12.2 (rhbz#1476259)

+ - Fix missing infrastructure files after making python 3 the default

+ - Enable at least SOME tests

+ - Make python-rpm recommended (will fall back to RPM CLI if not present)

+ 

  * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.4-13

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

  

file modified
+1 -1
@@ -1,1 +1,1 @@

- b88fcb14b610f7dd82fb0f1ade2ca4ec  rosdep-6cdef863382f5c812030ee1c15e43c4f0b98149e.tar.gz

+ SHA512 (rosdep-0.12.2.tar.gz) = 0932a5ff9874bbdffa1160fe0a391d27eef9a2f2435d7a89fa3b5e4eab0fc08205d4417aaea1254ab7bfe679cfeb61a6f1b199f06d65154b30505e2a280c0b61

Also:
- Fix missing infrastructure files after making python 3 the default
- Enable at least SOME tests
- Make python-rpm recommended (will fall back to RPM CLI if not present)

rebased onto 58c58ae

5 years ago

It seems the "default" binary got moved to python3 (if present). I have doubts that this is working correctly (because of process invocations between ROS python packages), but if the "default" moves, so should the support files.

Metadata Update from @cottsay:
- Request assigned

5 years ago

rebased onto d19f8ff

5 years ago

Pull-Request has been merged by rmattes

5 years ago