[python-hgapi] Initial import (#1129903)

Julien Enselme jujens at fedoraproject.org
Thu Aug 14 13:41:56 UTC 2014


commit d0058cc36a26813315b14e53540141be9c691495
Author: Julien Enselme <jujens at jujens.eu>
Date:   Thu Aug 14 15:39:53 2014 +0200

    Initial import (#1129903)

 .gitignore                          |    1 +
 python-hgapi-1.7.1-test_suite.patch |   11 ++++
 python-hgapi.spec                   |   92 +++++++++++++++++++++++++++++++++++
 sources                             |    1 +
 4 files changed, 105 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ab91285 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/hgapi-1.7.1.tar.gz
diff --git a/python-hgapi-1.7.1-test_suite.patch b/python-hgapi-1.7.1-test_suite.patch
new file mode 100644
index 0000000..2b10ade
--- /dev/null
+++ b/python-hgapi-1.7.1-test_suite.patch
@@ -0,0 +1,11 @@
+--- hgapi/testhgapi.py	2014-08-03 19:00:15.521960176 +0200
++++ hgapi/testhgapi.py	2014-08-03 19:00:27.168082805 +0200
+@@ -437,7 +437,7 @@
+     def test_410_root(self):
+         # regular test repo
+         reply = hgapi.Repo.hg_root("./test")
+-        self.assertTrue(reply.endswith("/hgapi/test"))
++        self.assertTrue(reply.endswith("/test"))
+         # non existing repo
+         self.assertRaises(hgapi.HgException, hgapi.Repo.hg_root, "./whatever")
+ 
diff --git a/python-hgapi.spec b/python-hgapi.spec
new file mode 100644
index 0000000..0f4781c
--- /dev/null
+++ b/python-hgapi.spec
@@ -0,0 +1,92 @@
+Name:           python-hgapi
+Version:        1.7.1
+Release:        4%{?dist}
+Summary:        Python API to Mercurial using the command-line interface
+
+License:        MIT
+URL:            https://bitbucket.org/haard/hgapi
+Source0:        https://pypi.python.org/packages/source/h/hgapi/hgapi-%{version}.tar.gz
+# A path defined in the test suite supposes that the tests are launched with an hgapi folder.
+Patch0:         %{name}-%{version}-test_suite.patch
+
+BuildArch:      noarch
+BuildRequires:  python2-devel python-setuptools mercurial
+Requires:       mercurial
+
+%description
+hgapi is a pure-Python API to Mercurial, that uses the command-line interface
+instead of the internal Mercurial API. The rationale for this is twofold: the
+internal API is unstable, and it is GPL.
+
+hgapi works for all versions of Mercurial, and will instantly reflect any
+changes to the repository (including hgrc).
+
+%package -n     python3-hgapi
+Summary:        Python 3 API to Mercurial using the command-line interface
+BuildRequires:  python3-devel python3-setuptools
+Requires:       mercurial
+
+%description -n python3-hgapi
+hgapi is a pure-Python API to Mercurial, that uses the command-line interface
+instead of the internal Mercurial API. The rationale for this is twofold: the
+internal API is unstable, and it is GPL.
+
+hgapi works for all versions of Mercurial, and will instantly reflect any
+changes to the repository (including hgrc).
+
+%prep
+%setup -q -n hgapi-%{version}
+# Remove egg
+rm -r hgapi.egg-info
+sed $'s/\r$//' hgapi/testhgapi.py > tmp &&
+mv tmp hgapi/testhgapi.py
+%patch0
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+
+%build
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+
+%{__python2} setup.py build
+
+
+%install
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+popd
+
+%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+
+%check
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+
+%{__python2} setup.py test
+
+
+%files
+%doc README.rst
+%{python2_sitelib}/hgapi-%{version}-py%{python2_version}.egg-info
+%{python2_sitelib}/hgapi/
+
+%files -n python3-hgapi
+%doc README.rst
+%{python3_sitelib}/hgapi-%{version}-py%{python3_version}.egg-info
+%{python3_sitelib}/hgapi/
+
+%changelog
+* Thu Aug 14 2014 Julien Enselme <jujens at jujens.eu> - 1.7.1-4
+- Don't duplicate the BR of mercurial.
+
+* Thu Aug 14 2014 Julien Enselme <jujens at jujens.eu> - 1.7.1-3
+- Remove egg-info from upstream.
+
+* Thu Aug 14 2014 Julien Enselme <jujens at jujens.eu> - 1.7.1-2
+- Add mercurial as a BuildRequires in order for the tests to succeed.
+
+* Sun Aug 03 2014 Julien Enselme <jujens at jujens.eu> - 1.7.1-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..a0efaf7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+bddaf5bb08116790f4f16aa05934fd43  hgapi-1.7.1.tar.gz


More information about the scm-commits mailing list