[python-wstool/epel7] Update to 0.1.5
Scott K Logan
cottsay at fedoraproject.org
Mon Dec 15 04:57:35 UTC 2014
commit b3fae5d1a96cb5356c18b74b76ae4d216a20a5d9
Author: Scott K Logan <logans at cottsay.net>
Date: Sun Dec 14 20:50:46 2014 -0800
Update to 0.1.5
Also:
- Update to python packaging guidelines
- Add check section
.gitignore | 1 +
python-wstool-0.1.5-cwd-independent-tests.patch | 88 ++++++++++++++++++++
python-wstool.spec | 97 ++++++++++++++++++-----
sources | 2 +-
4 files changed, 167 insertions(+), 21 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 64a115c..987a5ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/wstool-0.0.3.tar.gz
/wstool-0.1.1-d0d3ab8.tar.gz
+/wstool-0.1.5-8b280d4.tar.gz
diff --git a/python-wstool-0.1.5-cwd-independent-tests.patch b/python-wstool-0.1.5-cwd-independent-tests.patch
new file mode 100644
index 0000000..a50d7d1
--- /dev/null
+++ b/python-wstool-0.1.5-cwd-independent-tests.patch
@@ -0,0 +1,88 @@
+From b5fe1641a0dff0fe9ac9833efef907bac0f81c21 Mon Sep 17 00:00:00 2001
+From: Scott K Logan <logans at cottsay.net>
+Date: Sun, 14 Dec 2014 19:14:09 -0800
+Subject: [PATCH] Make tests independent of CWD
+
+Tests currently rely on the CWD being the project root
+---
+ test/local/test_config.py | 8 +++++---
+ test/local/test_config_yaml.py | 6 ++++--
+ test/local/test_interation.py | 4 ++--
+ 3 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/test/local/test_config.py b/test/local/test_config.py
+index ce6d236..254763f 100644
+--- a/test/local/test_config.py
++++ b/test/local/test_config.py
+@@ -41,6 +41,8 @@
+
+ from . import mock_client
+
++_test_root = os.path.dirname(os.path.dirname(__file__))
++
+
+ class MockVcsConfigElement(wstool.config_elements.VCSConfigElement):
+
+@@ -102,9 +104,9 @@ def test_init(self):
+ self.assertEqual(install_path, config.get_base_path())
+ self.assertEqual([], config.get_config_elements())
+ config = Config([PathSpec("foo"),
+- PathSpec(os.path.join("test", "example_dirs", "ros_comm")),
+- PathSpec(os.path.join("test", "example_dirs", "ros")),
+- PathSpec(os.path.join("test", "example_dirs", "roscpp")),
++ PathSpec(os.path.join(_test_root, "example_dirs", "ros_comm")),
++ PathSpec(os.path.join(_test_root, "example_dirs", "ros")),
++ PathSpec(os.path.join(_test_root, "example_dirs", "roscpp")),
+ PathSpec("bar")],
+ ".",
+ None)
+diff --git a/test/local/test_config_yaml.py b/test/local/test_config_yaml.py
+index a6edcde..a6da357 100644
+--- a/test/local/test_config_yaml.py
++++ b/test/local/test_config_yaml.py
+@@ -42,11 +42,13 @@
+ get_path_spec_from_yaml, get_yaml_from_uri, get_path_specs_from_uri, \
+ PathSpec, aggregate_from_uris
+
++_test_root = os.path.dirname(os.path.dirname(__file__))
++
+
+ class YamlIO_Test(unittest.TestCase):
+
+ def test_get_yaml_from_uri_from_file(self):
+- filename = os.path.join("test", "example.yaml")
++ filename = os.path.join(_test_root, "example.yaml")
+ yamlstr = get_yaml_from_uri(filename)
+
+ self.assertTrue("text" in yamlstr)
+@@ -57,7 +59,7 @@ def test_get_yaml_from_uri_from_file(self):
+ # invalid
+ try:
+ yaml = get_yaml_from_uri(
+- os.path.join("test", "example-broken.yaml"))
++ os.path.join(_test_root, "example-broken.yaml"))
+ except MultiProjectException:
+ pass
+ try:
+diff --git a/test/local/test_interation.py b/test/local/test_interation.py
+index 108d466..e84b35b 100644
+--- a/test/local/test_interation.py
++++ b/test/local/test_interation.py
+@@ -72,7 +72,7 @@ def test_twice_with_relpath(self):
+
+ self.rel_uri_rosinstall = os.path.join(self.test_root_path, "rel_uri.rosinstall")
+ _create_yaml_file([_create_config_elt_dict("git", "ros", self.ros_path),
+- _create_config_elt_dict("git", "gitrepo", os.path.relpath(self.git_path))],
++ _create_config_elt_dict("git", "gitrepo", os.path.relpath(self.git_path, self.directory))],
+ self.rel_uri_rosinstall)
+
+ config = wstool.multiproject_cmd.get_config(self.directory, [self.rel_uri_rosinstall, self.ros_path])
+@@ -85,7 +85,7 @@ def test_twice_with_relpath(self):
+
+ self.rel_uri_rosinstall2 = os.path.join(self.test_root_path, "rel_uri.wstool2")
+ # switch URIs to confuse config
+- _create_yaml_file([_create_config_elt_dict("git", "ros", os.path.relpath(self.git_path)),
++ _create_yaml_file([_create_config_elt_dict("git", "ros", os.path.relpath(self.git_path, self.directory)),
+ _create_config_elt_dict("git", "gitrepo", self.ros_path)],
+ self.rel_uri_rosinstall2)
+
diff --git a/python-wstool.spec b/python-wstool.spec
index 45e35ef..39f4339 100644
--- a/python-wstool.spec
+++ b/python-wstool.spec
@@ -1,27 +1,48 @@
-%global commit d0d3ab817cc83c9dcc379ae8a9ca6b2ec9e853c0
+%global commit 8b280d44ef9e7c89f63e5bd7b77702159582177f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
-%global with_python3 0
%global module_name wstool
+%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())")}
+%endif
+
Name: python-%{module_name}
-Version: 0.1.1
+Version: 0.1.5
Release: 1%{?dist}
Summary: Tool for managing a workspace of multiple heterogeneous SCM repositories
License: BSD
URL: http://www.ros.org/wiki/%{module_name}
Source0: https://github.com/vcstools/%{module_name}/archive/%{commit}/%{module_name}-%{version}-%{shortcommit}.tar.gz
+Patch0: %{name}-0.1.5-cwd-independent-tests.patch
BuildArch: noarch
-BuildRequires: python2-devel python-setuptools
-
-%if 0%{?with_python3}
-BuildRequires: python3-devel python3-setuptools
-%endif # if with_python3
-Requires: python-vcstools
-Requires: python-rosinstall
+BuildRequires: bzr
+BuildRequires: git
+BuildRequires: mercurial
+BuildRequires: python-coverage
+BuildRequires: python-dateutil
+BuildRequires: python2-devel
+BuildRequires: python-mock
+BuildRequires: python-nose
+BuildRequires: python-rosinstall
+BuildRequires: python-setuptools
+BuildRequires: python-vcstools >= 0.1.34
+BuildRequires: PyYAML
+BuildRequires: subversion
+
+Requires: bzr
+Requires: git
+Requires: mercurial
Requires: python-dateutil
+Requires: python-rosinstall
+Requires: python-vcstools >= 0.1.34
+Requires: PyYAML
+Requires: subversion
%description
wstool provides commands to manage several local SCM repositories (supports
@@ -35,13 +56,29 @@ does not allow adding non-version controlled elements to workspaces. In all
other respects, it behaves the same as rosws.
%if 0%{?with_python3}
-%package -n python3-wstool
+%package -n python3-%{module_name}
Summary: Tool for managing a workspace of multiple heterogeneous SCM repositories
-Requires: python3-vcstools
-Requires: python-rosinstall
+
+BuildRequires: python3-coverage
+BuildRequires: python3-dateutil
+BuildRequires: python3-devel
+BuildRequires: python3-mock
+BuildRequires: python3-nose
+BuildRequires: python-rosinstall
+BuildRequires: python3-setuptools
+BuildRequires: python3-vcstools >= 0.1.34
+BuildRequires: python3-PyYAML
+
+Requires: bzr
+Requires: git
+Requires: mercurial
Requires: python3-dateutil
+Requires: python-rosinstall
+Requires: python3-vcstools >= 0.1.34
+Requires: python3-PyYAML
+Requires: subversion
-%description -n python3-wstool
+%description -n python3-%{module_name}
wstool provides commands to manage several local SCM repositories (supports
git, mercurial, subversion, bazaar) based on a single workspace definition file
(.rosinstall).
@@ -55,7 +92,7 @@ other respects, it behaves the same as rosws.
%prep
%setup -qn %{module_name}-%{commit}
-
+%patch0 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
@@ -63,21 +100,36 @@ cp -a . %{py3dir}
%endif # with_python3
%build
-%{__python} setup.py build
+%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
-mv -v build/scripts-3.3/wstool build/scripts-3.3/python3-wstool
+mv -v build/scripts-%{python3_version}/%{module_name} build/scripts-%{python3_version}/python3-%{module_name}
popd
%endif # with_python3
%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 $RPM_BUILD_ROOT
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif # with_python3
+
+%check
+export BZR_EMAIL="Foo Bar <foo at example.com>"
+export GIT_AUTHOR_EMAIL="foo at example.com"
+export GIT_AUTHOR_NAME="Foo Bar"
+export GIT_COMMITTER_EMAIL="foo at example.com"
+export GIT_COMMITTER_NAME="Foo Bar"
+
+nosetests --with-coverage --cover-package=%{module_name} -w test
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+nosetests-%{python3_version} --with-coverage --cover-package=%{module_name} -w test
popd
%endif # with_python3
@@ -88,7 +140,7 @@ popd
%{python_sitelib}/%{module_name}-%{version}-py?.?.egg-info/
%if 0%{?with_python3}
-%files -n python3-wstool
+%files -n python3-%{module_name}
%doc LICENSE README.rst doc/changelog.rst
%{_bindir}/python3-%{module_name}
%{python3_sitelib}/%{module_name}/
@@ -96,6 +148,11 @@ popd
%endif # with_python3
%changelog
+* Sun Dec 14 2014 Scott K Logan <logans at cottsay.net> - 0.1.5-1
+- Update to 0.1.5
+- Update to python packaging guidelines
+- Add check section
+
* Sun Jan 12 2014 Rich Mattes <richmattes at gmail.com> - 0.1.1-1
- Update to 0.1.1
diff --git a/sources b/sources
index 8882ca9..70b202e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b6267fd12a8b9ae273e2d12eb8424601 wstool-0.1.1-d0d3ab8.tar.gz
+7ba735f573f3fceb7af0d5081fe60e62 wstool-0.1.5-8b280d4.tar.gz
More information about the scm-commits
mailing list