From 2bd113a0be166decf4f10f6480d58ac13e664218 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Oct 19 2014 00:28:54 +0000 Subject: Update to 0.2.5 Also: - Add python3 package - Exclude tests which are not compatible with python 2.6 --- diff --git a/.gitignore b/.gitignore index 82f044f..9044ab6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /catkin_pkg-0.2.2-8314c2e.tar.gz /catkin_pkg-0.2.3.tar.gz /catkin_pkg-0.2.4.tar.gz +/catkin_pkg-0.2.5.tar.gz diff --git a/python-catkin_pkg.spec b/python-catkin_pkg.spec index 2e902d5..848ff18 100644 --- a/python-catkin_pkg.spec +++ b/python-catkin_pkg.spec @@ -1,9 +1,17 @@ -%global commit cc824225107a2c3de95d0c69867e5c8d9d55e619 +%global commit b055637aad36fe0c6a35d721c9dbf64ea8c8015c %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global module_name catkin_pkg +%if 0%{?fedora} > 12 +%global with_python3 1 +%else +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} +%{!?python2_version: %global python2_version %(%{__python2} -c "from sys import stdout, version; stdout.write(version[:3])")} +%endif + Name: python-%{module_name} -Version: 0.2.4 +Version: 0.2.5 Release: 1%{?dist} Summary: Library for retrieving information about catkin packages @@ -12,40 +20,111 @@ URL: https://github.com/ros-infrastructure/%{module_name} BuildArch: noarch Source0: https://pypi.python.org/packages/source/c/%{module_name}/%{module_name}-%{version}.tar.gz +Requires: python-argparse Requires: python-dateutil Requires: python-docutils -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: python2-devel +BuildRequires: python-argparse BuildRequires: python-dateutil BuildRequires: python-docutils -BuildRequires: python-nose BuildRequires: python-mock +BuildRequires: python-nose +BuildRequires: python-setuptools + +%if 0%{?with_python3} +%package -n python3-%{module_name} +Summary: Library for retrieving information about catkin packages + +Requires: python3-dateutil +Requires: python3-docutils +BuildRequires: python3-dateutil +BuildRequires: python3-devel +BuildRequires: python3-docutils +BuildRequires: python3-mock +BuildRequires: python3-nose +BuildRequires: python3-setuptools +%endif %description Library for retrieving information about catkin packages +%if 0%{?with_python3} +%description -n python3-%{module_name} +Library for retrieving information about catkin packages +%endif + %prep %setup -q -n %{module_name}-%{version} +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' + %build -%{__python} setup.py build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +pushd build/scripts-%{python3_version} +for f in *; do mv $f python3-$f; done +popd +popd +%endif %install -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%{__python2} setup.py install --skip-build --root %{buildroot} + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif %check -PYTHONPATH=$RPM_BUILD_ROOT%{python_sitelib} nosetests -w test - +%if "%{python2_version}" == "2.6" +# Skip tests that use python 2.7 assertions +PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w test -e "(test_topological_order_packages_with_duplicates|test_validate_metapackage|test_package_decorator_init|test_create_package_template)" +%else +PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests-%{python2_version} -w test +%endif + +%if 0%{?with_python3} +pushd %{py3dir} +PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w test +popd +%endif + %files %{_bindir}/catkin_create_pkg %{_bindir}/catkin_find_pkg %{_bindir}/catkin_generate_changelog %{_bindir}/catkin_tag_changelog %{_bindir}/catkin_test_changelog -%{python_sitelib}/%{module_name}/ -%{python_sitelib}/%{module_name}-%{version}-py?.?.egg-info +%{python2_sitelib}/%{module_name}/ +%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info + +%if 0%{?with_python3} +%files -n python3-%{module_name} +%{_bindir}/python3-catkin_create_pkg +%{_bindir}/python3-catkin_find_pkg +%{_bindir}/python3-catkin_generate_changelog +%{_bindir}/python3-catkin_tag_changelog +%{_bindir}/python3-catkin_test_changelog +%{python3_sitelib}/%{module_name}/ +%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info +%endif %changelog +* Sat Oct 18 2014 Scott K Logan - 0.2.5-1 +- Update to 0.2.5 +- Add python3 package +- Exclude tests which are not compatible with python 2.6 + * Thu Jul 31 2014 Scott K Logan - 0.2.4-1 - Update to 0.2.4 - Remove README.rst (not present in Pypi sources) diff --git a/sources b/sources index 1569c59..eb64ebe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2432483a7f294491d335840194e551d0 catkin_pkg-0.2.4.tar.gz +e8c91b081228c461dffbc387a2811ec7 catkin_pkg-0.2.5.tar.gz