From 2d86782b6fe0686bb8fa9da093428fa39d596d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kie=C5=9B?= Date: Fri, 27 Dec 2013 15:02:26 +0100 Subject: [PATCH 01/57] - updated to 0.20.1 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index c51acd5..5723b5d 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -7,15 +7,15 @@ %define module pygit2 Summary: Python bindings for libgit2 library Name: python-%{module} -Version: 0.20.0 +Version: 0.20.1 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz -# Source0-md5: e4b42ad3abde5f5c9911bf1e4278d69a +# Source0-md5: accb51744a488ca1f5d595c97698d1c5 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.19.0 +BuildRequires: libgit2-devel >= 0.20.0 BuildRequires: python-devel BuildRequires: python-distribute BuildRequires: rpm-pythonprov From f3983b54cb620d14a471494b6c7efd02093a4be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kie=C5=9B?= Date: Wed, 5 Feb 2014 12:38:51 +0100 Subject: [PATCH 02/57] - updated to 0.20.2 --- python-pygit2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 5723b5d..7788b73 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -7,12 +7,12 @@ %define module pygit2 Summary: Python bindings for libgit2 library Name: python-%{module} -Version: 0.20.1 +Version: 0.20.2 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz -# Source0-md5: accb51744a488ca1f5d595c97698d1c5 +# Source0-md5: ddfe43076a45418a1122ca668b7b0247 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.20.0 From a7da3c5d0021dffdfe4afb8ad4258ed160e4b6d6 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 6 Feb 2014 19:22:11 +0100 Subject: [PATCH 03/57] - pl, versioned install time dependencies --- python-pygit2.spec | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 7788b73..7126626 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -5,13 +5,14 @@ %bcond_without docs # documentation %define module pygit2 -Summary: Python bindings for libgit2 library +Summary: Python 2.x bindings for libgit2 library +Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.20.2 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python -Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz +Source0: http://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz # Source0-md5: ddfe43076a45418a1122ca668b7b0247 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 @@ -26,17 +27,27 @@ BuildRequires: python3-distribute BuildRequires: python3-modules %endif %{?with_docs:BuildRequires: sphinx-pdg} +Requires: libgit2 >= 0.20.0 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description pygit2 is a set of Python bindings to the libgit2 shared library. +%description -l pl.UTF-8 +pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. + %package -n python3-%{module} -Summary: Python bindings for libgit2 library +Summary: Python 3.x bindings for libgit2 library +Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 +Group: Libraries/Python +Requires: libgit2 >= 0.20.0 %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. +%description -n python3-%{module} -l pl.UTF-8 +pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. + %package apidoc Summary: pygit2 API documentation Summary(pl.UTF-8): Dokumentacja API pygit2 @@ -71,7 +82,8 @@ Dokumentacja API %{module}. %if %{with docs} cd docs -PACKAGE_BUILD=../build-2 %{__make} -j1 html +PACKAGE_BUILD=../build-2 \ +%{__make} -j1 html rm -rf _build/html/_sources %endif From be2c376415a3ca43ec8baa395a5c7f7d33fc8a6c Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 3 Apr 2014 19:26:14 +0200 Subject: [PATCH 04/57] - updated to 0.20.3 - disable tests which require remote repository access --- python-pygit2.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 7126626..9d38fe8 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.20.2 +Version: 0.20.3 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python -Source0: http://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: ddfe43076a45418a1122ca668b7b0247 +Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz +# Source0-md5: 1efcc58383fd2e558a8d3cba4dcc4754 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.20.0 @@ -63,6 +63,9 @@ Dokumentacja API %{module}. %setup -q -n %{module}-%{version} %patch0 -p0 +# these tests use network +%{__rm} test/test_{credentials,repository}.py + %build %{__python} setup.py build --build-base build-2 %if %{with python3} From f193cb9b29308265b39f9f010281efdf657290c4 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 29 Jun 2014 11:08:01 +0200 Subject: [PATCH 05/57] - updated to 0.21.0 --- python-pygit2.spec | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 9d38fe8..2699cc0 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.20.3 +Version: 0.21.0 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: 1efcc58383fd2e558a8d3cba4dcc4754 +# Source0-md5: ffd1df8fa73e65bc6d2b66ad8f90412c Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.20.0 @@ -118,22 +118,26 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt -%dir %{py_sitedir}/%{module} +%dir %{py_sitedir}/pygit2 %{py_sitedir}/pygit2/*.py[co] -%attr(755,root,root) %{py_sitedir}/*.so +%{py_sitedir}/pygit2/decl.h +%attr(755,root,root) %{py_sitedir}/_cffi__*.so +%attr(755,root,root) %{py_sitedir}/_pygit2.so %if "%{py_ver}" > "2.4" -%{py_sitedir}/pygit2-*.egg-info +%{py_sitedir}/pygit2-%{version}-py*.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt -%dir %{py3_sitedir}/%{module} -%attr(755,root,root) %{py3_sitedir}/*.so -%{py3_sitedir}/%{module}/*.py -%{py3_sitedir}/%{module}/__pycache__ -%{py3_sitedir}/pygit2-*.egg-info +%dir %{py3_sitedir}/pygit2 +%attr(755,root,root) %{py3_sitedir}/_cffi__*.so +%attr(755,root,root) %{py3_sitedir}/_pygit2.*.so +%{py3_sitedir}/pygit2/decl.h +%{py3_sitedir}/pygit2/*.py +%{py3_sitedir}/pygit2/__pycache__ +%{py3_sitedir}/pygit2-%{version}-py*.egg-info %endif %if %{with docs} From 41cf266e63c2441d43d0a93152663f3f99411fb7 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 30 Jul 2014 20:48:37 +0200 Subject: [PATCH 06/57] - updated to 0.21.1 --- python-pygit2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 2699cc0..c610a10 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.21.0 +Version: 0.21.1 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: ffd1df8fa73e65bc6d2b66ad8f90412c +# Source0-md5: b8ba74d268a3b9c7d2cfa6305f570f92 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.20.0 From 06eff6d710c5f6ed9a89894fb9377374f4fb8c0b Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 3 Sep 2014 20:22:07 +0200 Subject: [PATCH 07/57] - updated to 0.21.2 --- python-pygit2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index c610a10..be89566 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.21.1 +Version: 0.21.2 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: b8ba74d268a3b9c7d2cfa6305f570f92 +# Source0-md5: bcb35b873e70628ad1c8f72cb137f310 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.20.0 From 439d372548d4ddc6ebd5da05991357a5ff31e06f Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 3 Sep 2014 20:22:27 +0200 Subject: [PATCH 08/57] - updated to 0.21.2 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index be89566..3051644 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -16,7 +16,7 @@ Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.t # Source0-md5: bcb35b873e70628ad1c8f72cb137f310 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.20.0 +BuildRequires: libgit2-devel >= 0.21.0 BuildRequires: python-devel BuildRequires: python-distribute BuildRequires: rpm-pythonprov @@ -27,7 +27,7 @@ BuildRequires: python3-distribute BuildRequires: python3-modules %endif %{?with_docs:BuildRequires: sphinx-pdg} -Requires: libgit2 >= 0.20.0 +Requires: libgit2 >= 0.21.0 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -40,7 +40,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 0.20.0 +Requires: libgit2 >= 0.21.0 %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. From 6a54849d3cd8e94b10d246b5b34e6ce5a74b2782 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 18 Sep 2014 16:43:43 +0200 Subject: [PATCH 09/57] - updated to 0.21.3 - updated docbuild patch --- python-pygit2-docbuild.patch | 17 ++++++----------- python-pygit2.spec | 6 +++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/python-pygit2-docbuild.patch b/python-pygit2-docbuild.patch index 6b9b8f4..90866e8 100644 --- a/python-pygit2-docbuild.patch +++ b/python-pygit2-docbuild.patch @@ -1,17 +1,12 @@ ---- docs/conf.py.orig 2013-10-13 17:53:38.807267727 +0100 -+++ docs/conf.py 2013-10-13 18:06:24.038047114 +0100 -@@ -12,11 +12,13 @@ - # serve to show the default. - - import sys, os -+from distutils.util import get_platform - - # If extensions (or modules to document with autodoc) are in another directory, +--- pygit2-0.21.3/docs/conf.py.orig 2014-09-18 16:25:58.336102616 +0200 ++++ pygit2-0.21.3/docs/conf.py 2014-09-18 16:30:38.056090370 +0200 +@@ -18,7 +18,8 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. --sys.path.insert(0, os.path.abspath('../build/lib.linux-x86_64-2.7')) + version_string = sys.platform.rstrip(digits) + "-" + os.uname()[4] + "-" + ".".join(platform.python_version_tuple()[0:2]) +-sys.path.insert(0, os.path.abspath('../build/lib.' + version_string)) +builddir = os.getenv('PACKAGE_BUILD', '../build') -+sys.path.insert(0, os.path.abspath('%s/lib.%s-%s' % (builddir, get_platform(), sys.version[0:3]))) ++sys.path.insert(0, os.path.abspath(builddir + '/lib.' + version_string)) # -- General configuration ----------------------------------------------------- diff --git a/python-pygit2.spec b/python-pygit2.spec index 3051644..272b61f 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.21.2 +Version: 0.21.3 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: bcb35b873e70628ad1c8f72cb137f310 +# Source0-md5: c929bb958f91ffaa942cac754218aa92 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.21.0 @@ -61,7 +61,7 @@ Dokumentacja API %{module}. %prep %setup -q -n %{module}-%{version} -%patch0 -p0 +%patch0 -p1 # these tests use network %{__rm} test/test_{credentials,repository}.py From 82c88b413977be71bf6d2d0624f9a8c24972581d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 19 Oct 2014 18:12:47 +0200 Subject: [PATCH 10/57] - python 3.4 - release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 272b61f..f818358 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.21.3 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz From 2492592e63d1ef12b3f9c7fadec19696af288cc5 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 7 Nov 2014 21:54:50 +0100 Subject: [PATCH 11/57] - updated to 0.21.4 --- python-pygit2.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index f818358..259e579 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,12 +8,12 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.21.3 -Release: 2 +Version: 0.21.4 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: c929bb958f91ffaa942cac754218aa92 +# Source0-md5: 8a3d02eded2bef2e0af18172814eec32 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.21.0 @@ -121,7 +121,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{py_sitedir}/pygit2 %{py_sitedir}/pygit2/*.py[co] %{py_sitedir}/pygit2/decl.h -%attr(755,root,root) %{py_sitedir}/_cffi__*.so +%attr(755,root,root) %{py_sitedir}/pygit2_cffi_*.so %attr(755,root,root) %{py_sitedir}/_pygit2.so %if "%{py_ver}" > "2.4" %{py_sitedir}/pygit2-%{version}-py*.egg-info @@ -132,8 +132,8 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt %dir %{py3_sitedir}/pygit2 -%attr(755,root,root) %{py3_sitedir}/_cffi__*.so -%attr(755,root,root) %{py3_sitedir}/_pygit2.*.so +%attr(755,root,root) %{py3_sitedir}/pygit2_cffi_*.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so %{py3_sitedir}/pygit2/decl.h %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/__pycache__ From a66114b593038c243585ef71e01c2bd4f9439d48 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 3 Mar 2015 21:27:08 +0100 Subject: [PATCH 12/57] - updated to 0.22.0 (with #487 fix from git) --- 487.patch | 169 +++++++++++++++++++++++++++++++++++++++++++++ python-pygit2.spec | 14 ++-- 2 files changed, 178 insertions(+), 5 deletions(-) create mode 100644 487.patch diff --git a/487.patch b/487.patch new file mode 100644 index 0000000..344b3ed --- /dev/null +++ b/487.patch @@ -0,0 +1,169 @@ +From 0ba17a5b4608706f696c2212315ea0bb301db209 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= +Date: Fri, 6 Feb 2015 03:41:37 +0100 +Subject: [PATCH] Safer handling of string arrays + +We need to keep hold of the strings which we create. We must also hold +on to the array of strings which we assing to our git_strarray. + +We were not doing the latter, which meant that our strings may have been +freed too early, leaving us with with memory access errors (though often +not leading to a crash due to the custom allocator in python). + +As we need to keep hold of two/three pieces of information, this looks +like a good place to introduce a context manager. This allows us to +keep these pointers alive without burdening the call sites with a return +of multiple objects they have no use for. +--- + pygit2/index.py | 8 ++++---- + pygit2/remote.py | 20 ++++++++++---------- + pygit2/utils.py | 46 +++++++++++++++++++++++----------------------- + 3 files changed, 37 insertions(+), 37 deletions(-) + +diff --git a/pygit2/index.py b/pygit2/index.py +index 61b7c97..47d4cd6 100644 +--- a/pygit2/index.py ++++ b/pygit2/index.py +@@ -32,7 +32,7 @@ + from _pygit2 import Oid, Tree, Diff + from .errors import check_error + from .ffi import ffi, C +-from .utils import is_string, strings_to_strarray, to_bytes, to_str ++from .utils import is_string, to_bytes, to_str, StrArray + + + class Index(object): +@@ -175,9 +175,9 @@ def add_all(self, pathspecs=[]): + If pathspecs are specified, only files matching those pathspecs will + be added. + """ +- arr, refs = strings_to_strarray(pathspecs) +- err = C.git_index_add_all(self._index, arr, 0, ffi.NULL, ffi.NULL) +- check_error(err, True) ++ with StrArray(pathspecs) as arr: ++ err = C.git_index_add_all(self._index, arr, 0, ffi.NULL, ffi.NULL) ++ check_error(err, True) + + def add(self, path_or_entry): + """add([path|entry]) +diff --git a/pygit2/remote.py b/pygit2/remote.py +index c4a195f..d2fbdcf 100644 +--- a/pygit2/remote.py ++++ b/pygit2/remote.py +@@ -34,7 +34,7 @@ + from .ffi import ffi, C + from .credentials import KeypairFromAgent + from .refspec import Refspec +-from .utils import to_bytes, strarray_to_strings, strings_to_strarray ++from .utils import to_bytes, strarray_to_strings, StrArray + + + def maybe_string(ptr): +@@ -253,9 +253,9 @@ def fetch_refspecs(self): + + @fetch_refspecs.setter + def fetch_refspecs(self, l): +- arr, refs = strings_to_strarray(l) +- err = C.git_remote_set_fetch_refspecs(self._remote, arr) +- check_error(err) ++ with StrArray(l) as arr: ++ err = C.git_remote_set_fetch_refspecs(self._remote, arr) ++ check_error(err) + + @property + def push_refspecs(self): +@@ -269,9 +269,9 @@ def push_refspecs(self): + + @push_refspecs.setter + def push_refspecs(self, l): +- arr, refs = strings_to_strarray(l) +- err = C.git_remote_set_push_refspecs(self._remote, arr) +- check_error(err) ++ with StrArray(l) as arr: ++ err = C.git_remote_set_push_refspecs(self._remote, arr) ++ check_error(err) + + def add_fetch(self, spec): + """add_fetch(refspec) +@@ -305,7 +305,6 @@ def push(self, specs, signature=None, message=None): + err = C.git_remote_init_callbacks(defaultcallbacks, 1) + check_error(err) + +- refspecs, refspecs_refs = strings_to_strarray(specs) + if signature: + sig_cptr = ffi.new('git_signature **') + ffi.buffer(sig_cptr)[:] = signature._pointer[:] +@@ -333,8 +332,9 @@ def push(self, specs, signature=None, message=None): + raise + + try: +- err = C.git_remote_push(self._remote, refspecs, ffi.NULL, sig_ptr, to_bytes(message)) +- check_error(err) ++ with StrArray(specs) as refspecs: ++ err = C.git_remote_push(self._remote, refspecs, ffi.NULL, sig_ptr, to_bytes(message)) ++ check_error(err) + finally: + self._self_handle = None + +diff --git a/pygit2/utils.py b/pygit2/utils.py +index 3c5fc88..17582a4 100644 +--- a/pygit2/utils.py ++++ b/pygit2/utils.py +@@ -50,34 +50,34 @@ def strarray_to_strings(arr): + return l + + +-def strings_to_strarray(l): +- """Convert a list of strings to a git_strarray ++class StrArray(object): ++ """A git_strarray wrapper + +- We return first the git_strarray* you can pass to libgit2 and a +- list of references to the memory, which we must keep around for as +- long as the git_strarray must live. +- """ ++ Use this in order to get a git_strarray* to pass to libgit2 out of a ++ list of strings. This has a context manager, which you should use, e.g. + +- if not isinstance(l, list): +- raise TypeError("Value must be a list") ++ with StrArray(list_of_strings) as arr: ++ C.git_function_that_takes_strarray(arr) ++ """ + +- arr = ffi.new('git_strarray *') +- strings = ffi.new('char *[]', len(l)) ++ def __init__(self, l): ++ if not isinstance(l, list): ++ raise TypeError("Value must be a list") + +- # We need refs in order to keep a reference to the value returned +- # by the ffi.new(). Otherwise, they will be freed and the memory +- # re-used, with less than great consequences. +- refs = [None] * len(l) ++ arr = ffi.new('git_strarray *') ++ strings = [None] * len(l) ++ for i in range(len(l)): ++ if not is_string(l[i]): ++ raise TypeError("Value must be a string") + +- for i in range(len(l)): +- if not is_string(l[i]): +- raise TypeError("Value must be a string") ++ strings[i] = ffi.new('char []', to_bytes(l[i])) + +- s = ffi.new('char []', to_bytes(l[i])) +- refs[i] = s +- strings[i] = s ++ self._arr = ffi.new('char *[]', strings) ++ self._strings = strings ++ self.array = ffi.new('git_strarray *', [self._arr, len(strings)]) + +- arr.strings = strings +- arr.count = len(l) ++ def __enter__(self): ++ return self.array + +- return arr, refs ++ def __exit__(self, type, value, traceback): ++ pass diff --git a/python-pygit2.spec b/python-pygit2.spec index 259e579..7a6ea0a 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,15 +8,18 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.21.4 +Version: 0.22.0 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python +#Source0Download: https://pypi.python.org/pypi/pygit2 Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: 8a3d02eded2bef2e0af18172814eec32 +# Source0-md5: 31dc65b3cbe6e39d75a39db86dd7cd8c Patch0: %{name}-docbuild.patch +# https://github.com/libgit2/pygit2/pull/487.patch +Patch1: 487.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.21.0 +BuildRequires: libgit2-devel >= 0.22.0 BuildRequires: python-devel BuildRequires: python-distribute BuildRequires: rpm-pythonprov @@ -27,7 +30,7 @@ BuildRequires: python3-distribute BuildRequires: python3-modules %endif %{?with_docs:BuildRequires: sphinx-pdg} -Requires: libgit2 >= 0.21.0 +Requires: libgit2 >= 0.22.0 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -40,7 +43,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 0.21.0 +Requires: libgit2 >= 0.22.0 %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. @@ -62,6 +65,7 @@ Dokumentacja API %{module}. %prep %setup -q -n %{module}-%{version} %patch0 -p1 +%patch1 -p1 # these tests use network %{__rm} test/test_{credentials,repository}.py From e507b989d12854c41106727ac69cb55f585c92f0 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 5 Mar 2015 21:40:01 +0100 Subject: [PATCH 13/57] - requires cffi now --- python-pygit2.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 7a6ea0a..b7f21e9 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.22.0 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 @@ -20,17 +20,20 @@ Patch0: %{name}-docbuild.patch Patch1: 487.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.22.0 -BuildRequires: python-devel +BuildRequires: python-cffi +BuildRequires: python-devel >= 1:2.7 BuildRequires: python-distribute BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.219 %if %{with python3} -BuildRequires: python3-devel +BuildRequires: python3-cffi +BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-distribute -BuildRequires: python3-modules +BuildRequires: python3-modules >= 1:3.2 %endif %{?with_docs:BuildRequires: sphinx-pdg} Requires: libgit2 >= 0.22.0 +Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -44,6 +47,7 @@ Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python Requires: libgit2 >= 0.22.0 +Requires: python3-cffi %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. From 6b9ad5f47914201cd6fced31a9a631f76265abdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 13 Sep 2015 22:24:45 +0200 Subject: [PATCH 14/57] - python 3.5 rebuild - release 3 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index b7f21e9..27f2e46 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.22.0 -Release: 2 +Release: 3 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 From c94be27932256105078bb16ce2653e9835fe2e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Mon, 14 Sep 2015 20:31:48 +0200 Subject: [PATCH 15/57] - python3.5 rebuild - release 4 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 27f2e46..d46cc01 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.22.0 -Release: 3 +Release: 4 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 From 067cd5adb0414288fee07bbd68289afe2fac9db7 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 18 Oct 2015 17:43:31 +0200 Subject: [PATCH 16/57] - updated to 0.23.2 - removed obsolete 487 patch --- 487.patch | 169 --------------------------------------------- python-pygit2.spec | 25 +++---- 2 files changed, 11 insertions(+), 183 deletions(-) delete mode 100644 487.patch diff --git a/487.patch b/487.patch deleted file mode 100644 index 344b3ed..0000000 --- a/487.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 0ba17a5b4608706f696c2212315ea0bb301db209 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= -Date: Fri, 6 Feb 2015 03:41:37 +0100 -Subject: [PATCH] Safer handling of string arrays - -We need to keep hold of the strings which we create. We must also hold -on to the array of strings which we assing to our git_strarray. - -We were not doing the latter, which meant that our strings may have been -freed too early, leaving us with with memory access errors (though often -not leading to a crash due to the custom allocator in python). - -As we need to keep hold of two/three pieces of information, this looks -like a good place to introduce a context manager. This allows us to -keep these pointers alive without burdening the call sites with a return -of multiple objects they have no use for. ---- - pygit2/index.py | 8 ++++---- - pygit2/remote.py | 20 ++++++++++---------- - pygit2/utils.py | 46 +++++++++++++++++++++++----------------------- - 3 files changed, 37 insertions(+), 37 deletions(-) - -diff --git a/pygit2/index.py b/pygit2/index.py -index 61b7c97..47d4cd6 100644 ---- a/pygit2/index.py -+++ b/pygit2/index.py -@@ -32,7 +32,7 @@ - from _pygit2 import Oid, Tree, Diff - from .errors import check_error - from .ffi import ffi, C --from .utils import is_string, strings_to_strarray, to_bytes, to_str -+from .utils import is_string, to_bytes, to_str, StrArray - - - class Index(object): -@@ -175,9 +175,9 @@ def add_all(self, pathspecs=[]): - If pathspecs are specified, only files matching those pathspecs will - be added. - """ -- arr, refs = strings_to_strarray(pathspecs) -- err = C.git_index_add_all(self._index, arr, 0, ffi.NULL, ffi.NULL) -- check_error(err, True) -+ with StrArray(pathspecs) as arr: -+ err = C.git_index_add_all(self._index, arr, 0, ffi.NULL, ffi.NULL) -+ check_error(err, True) - - def add(self, path_or_entry): - """add([path|entry]) -diff --git a/pygit2/remote.py b/pygit2/remote.py -index c4a195f..d2fbdcf 100644 ---- a/pygit2/remote.py -+++ b/pygit2/remote.py -@@ -34,7 +34,7 @@ - from .ffi import ffi, C - from .credentials import KeypairFromAgent - from .refspec import Refspec --from .utils import to_bytes, strarray_to_strings, strings_to_strarray -+from .utils import to_bytes, strarray_to_strings, StrArray - - - def maybe_string(ptr): -@@ -253,9 +253,9 @@ def fetch_refspecs(self): - - @fetch_refspecs.setter - def fetch_refspecs(self, l): -- arr, refs = strings_to_strarray(l) -- err = C.git_remote_set_fetch_refspecs(self._remote, arr) -- check_error(err) -+ with StrArray(l) as arr: -+ err = C.git_remote_set_fetch_refspecs(self._remote, arr) -+ check_error(err) - - @property - def push_refspecs(self): -@@ -269,9 +269,9 @@ def push_refspecs(self): - - @push_refspecs.setter - def push_refspecs(self, l): -- arr, refs = strings_to_strarray(l) -- err = C.git_remote_set_push_refspecs(self._remote, arr) -- check_error(err) -+ with StrArray(l) as arr: -+ err = C.git_remote_set_push_refspecs(self._remote, arr) -+ check_error(err) - - def add_fetch(self, spec): - """add_fetch(refspec) -@@ -305,7 +305,6 @@ def push(self, specs, signature=None, message=None): - err = C.git_remote_init_callbacks(defaultcallbacks, 1) - check_error(err) - -- refspecs, refspecs_refs = strings_to_strarray(specs) - if signature: - sig_cptr = ffi.new('git_signature **') - ffi.buffer(sig_cptr)[:] = signature._pointer[:] -@@ -333,8 +332,9 @@ def push(self, specs, signature=None, message=None): - raise - - try: -- err = C.git_remote_push(self._remote, refspecs, ffi.NULL, sig_ptr, to_bytes(message)) -- check_error(err) -+ with StrArray(specs) as refspecs: -+ err = C.git_remote_push(self._remote, refspecs, ffi.NULL, sig_ptr, to_bytes(message)) -+ check_error(err) - finally: - self._self_handle = None - -diff --git a/pygit2/utils.py b/pygit2/utils.py -index 3c5fc88..17582a4 100644 ---- a/pygit2/utils.py -+++ b/pygit2/utils.py -@@ -50,34 +50,34 @@ def strarray_to_strings(arr): - return l - - --def strings_to_strarray(l): -- """Convert a list of strings to a git_strarray -+class StrArray(object): -+ """A git_strarray wrapper - -- We return first the git_strarray* you can pass to libgit2 and a -- list of references to the memory, which we must keep around for as -- long as the git_strarray must live. -- """ -+ Use this in order to get a git_strarray* to pass to libgit2 out of a -+ list of strings. This has a context manager, which you should use, e.g. - -- if not isinstance(l, list): -- raise TypeError("Value must be a list") -+ with StrArray(list_of_strings) as arr: -+ C.git_function_that_takes_strarray(arr) -+ """ - -- arr = ffi.new('git_strarray *') -- strings = ffi.new('char *[]', len(l)) -+ def __init__(self, l): -+ if not isinstance(l, list): -+ raise TypeError("Value must be a list") - -- # We need refs in order to keep a reference to the value returned -- # by the ffi.new(). Otherwise, they will be freed and the memory -- # re-used, with less than great consequences. -- refs = [None] * len(l) -+ arr = ffi.new('git_strarray *') -+ strings = [None] * len(l) -+ for i in range(len(l)): -+ if not is_string(l[i]): -+ raise TypeError("Value must be a string") - -- for i in range(len(l)): -- if not is_string(l[i]): -- raise TypeError("Value must be a string") -+ strings[i] = ffi.new('char []', to_bytes(l[i])) - -- s = ffi.new('char []', to_bytes(l[i])) -- refs[i] = s -- strings[i] = s -+ self._arr = ffi.new('char *[]', strings) -+ self._strings = strings -+ self.array = ffi.new('git_strarray *', [self._arr, len(strings)]) - -- arr.strings = strings -- arr.count = len(l) -+ def __enter__(self): -+ return self.array - -- return arr, refs -+ def __exit__(self, type, value, traceback): -+ pass diff --git a/python-pygit2.spec b/python-pygit2.spec index d46cc01..eccb48c 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,31 +8,29 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.22.0 -Release: 4 +Version: 0.23.2 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: 31dc65b3cbe6e39d75a39db86dd7cd8c +# Source0-md5: c4b00f2add53e17a98c0ebe558d4db80 Patch0: %{name}-docbuild.patch -# https://github.com/libgit2/pygit2/pull/487.patch -Patch1: 487.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.22.0 +BuildRequires: libgit2-devel >= 0.23.0 BuildRequires: python-cffi BuildRequires: python-devel >= 1:2.7 -BuildRequires: python-distribute +BuildRequires: python-setuptools BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.219 %if %{with python3} BuildRequires: python3-cffi BuildRequires: python3-devel >= 1:3.2 -BuildRequires: python3-distribute BuildRequires: python3-modules >= 1:3.2 +BuildRequires: python3-setuptools %endif %{?with_docs:BuildRequires: sphinx-pdg} -Requires: libgit2 >= 0.22.0 +Requires: libgit2 >= 0.23.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -46,7 +44,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 0.22.0 +Requires: libgit2 >= 0.23.0 Requires: python3-cffi %description -n python3-%{module} @@ -69,7 +67,6 @@ Dokumentacja API %{module}. %prep %setup -q -n %{module}-%{version} %patch0 -p1 -%patch1 -p1 # these tests use network %{__rm} test/test_{credentials,repository}.py @@ -129,7 +126,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{py_sitedir}/pygit2 %{py_sitedir}/pygit2/*.py[co] %{py_sitedir}/pygit2/decl.h -%attr(755,root,root) %{py_sitedir}/pygit2_cffi_*.so +%attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so %attr(755,root,root) %{py_sitedir}/_pygit2.so %if "%{py_ver}" > "2.4" %{py_sitedir}/pygit2-%{version}-py*.egg-info @@ -140,11 +137,11 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt %dir %{py3_sitedir}/pygit2 -%attr(755,root,root) %{py3_sitedir}/pygit2_cffi_*.cpython-*.so -%attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so %{py3_sitedir}/pygit2/decl.h %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/__pycache__ +%attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so %{py3_sitedir}/pygit2-%{version}-py*.egg-info %endif From 859cf23398fc833748f4760276575b4db47f9113 Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Sat, 28 Nov 2015 18:06:43 +0100 Subject: [PATCH 17/57] automatic change: use py_build/py_install macros --- python-pygit2.spec | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index eccb48c..430a696 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -72,19 +72,19 @@ Dokumentacja API %{module}. %{__rm} test/test_{credentials,repository}.py %build -%{__python} setup.py build --build-base build-2 +%py_build %if %{with python3} -%{__python3} setup.py build --build-base build-3 +%py3_build %endif -%{?with_tests:%{__python} setup.py build -b build-2 test} +%{?with_tests:%py_build test} %if %{with python3} %{__python3} setup.py \ build -b build-3 %if %{with tests} -%{__python3} setup.py build -b build-3 test +%py3_build test %endif %endif @@ -106,11 +106,7 @@ rm -rf $RPM_BUILD_ROOT %py_postclean %if %{with python3} -%{__python3} setup.py \ - build --build-base build-3 \ - install \ - --root=$RPM_BUILD_ROOT \ - --optimize=2 +%py3_install %endif %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} From 4b0cff0982581ae2e86f704a930fb44ee69bd69d Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Sat, 28 Nov 2015 21:42:11 +0100 Subject: [PATCH 18/57] - release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 430a696..2a3d468 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.23.2 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 From da8a102271f273bfde4c86e896652c7a17750afc Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Sun, 29 Nov 2015 11:00:52 +0100 Subject: [PATCH 19/57] BR: rpmbuild(macros) >= 1.710 --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 2a3d468..57721ea 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -22,7 +22,7 @@ BuildRequires: python-cffi BuildRequires: python-devel >= 1:2.7 BuildRequires: python-setuptools BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.219 +BuildRequires: rpmbuild(macros) >= 1.710 %if %{with python3} BuildRequires: python3-cffi BuildRequires: python3-devel >= 1:3.2 From d127099ea561782a053a3c9df185feaaa8ab820e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 19 Mar 2016 19:10:50 +0200 Subject: [PATCH 20/57] fix build with new py macros --- python-pygit2.spec | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 57721ea..61f76bc 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -1,3 +1,5 @@ +# TODO: +# building doc requires pygit2 installed in system # # Conditional build: %bcond_without tests # do not perform "make test" @@ -22,7 +24,7 @@ BuildRequires: python-cffi BuildRequires: python-devel >= 1:2.7 BuildRequires: python-setuptools BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.710 +BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python3} BuildRequires: python3-cffi BuildRequires: python3-devel >= 1:3.2 @@ -73,19 +75,11 @@ Dokumentacja API %{module}. %build %py_build -%if %{with python3} -%py3_build -%endif - %{?with_tests:%py_build test} %if %{with python3} -%{__python3} setup.py \ - build -b build-3 - -%if %{with tests} -%py3_build test -%endif +%py3_build +%{?with_tests:%py3_build test} %endif %if %{with docs} @@ -97,22 +91,13 @@ rm -rf _build/html/_sources %install rm -rf $RPM_BUILD_ROOT -%{__python} -- setup.py \ - build -b build-2 \ - install \ - --root=$RPM_BUILD_ROOT \ - --optimize=2 - +%py_install %py_postclean %if %{with python3} %py3_install %endif -%py_ocomp $RPM_BUILD_ROOT%{py_sitedir} -%py_comp $RPM_BUILD_ROOT%{py_sitedir} -%py_postclean - %clean rm -rf $RPM_BUILD_ROOT @@ -124,9 +109,7 @@ rm -rf $RPM_BUILD_ROOT %{py_sitedir}/pygit2/decl.h %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so %attr(755,root,root) %{py_sitedir}/_pygit2.so -%if "%{py_ver}" > "2.4" %{py_sitedir}/pygit2-%{version}-py*.egg-info -%endif %if %{with python3} %files -n python3-%{module} From 9630e8ce4e81a064ce9f736273b683349ffc5741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 19 Mar 2016 19:11:41 +0200 Subject: [PATCH 21/57] unify doc bcond name --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 61f76bc..1865b2b 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -4,7 +4,7 @@ # Conditional build: %bcond_without tests # do not perform "make test" %bcond_without python3 # CPython 3.x module -%bcond_without docs # documentation +%bcond_without doc # documentation %define module pygit2 Summary: Python 2.x bindings for libgit2 library @@ -82,7 +82,7 @@ Dokumentacja API %{module}. %{?with_tests:%py3_build test} %endif -%if %{with docs} +%if %{with doc} cd docs PACKAGE_BUILD=../build-2 \ %{__make} -j1 html @@ -124,7 +124,7 @@ rm -rf $RPM_BUILD_ROOT %{py3_sitedir}/pygit2-%{version}-py*.egg-info %endif -%if %{with docs} +%if %{with doc} %files apidoc %defattr(644,root,root,755) %doc docs/_build/html/* From e269d40acd5e76661868d022e38f7004647b9665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 19 Mar 2016 19:12:16 +0200 Subject: [PATCH 22/57] up to 0.23.3 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 1865b2b..0067d4c 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -10,13 +10,13 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.23.2 -Release: 2 +Version: 0.23.3 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/pypi/pygit2 Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: c4b00f2add53e17a98c0ebe558d4db80 +# Source0-md5: 1c20926ad48ce622b0087ab2bb812ae3 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.23.0 From eff4580e92f087666cdbf9645c77700bf8b75855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 19 Mar 2016 19:13:43 +0200 Subject: [PATCH 23/57] fix br dep --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 0067d4c..f9bc34a 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -31,7 +31,7 @@ BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools %endif -%{?with_docs:BuildRequires: sphinx-pdg} +%{?with_doc:BuildRequires: sphinx-pdg} Requires: libgit2 >= 0.23.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) From e209e12cd1968619df32d93262ba4b9e7b77dce8 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 21 Mar 2016 19:41:00 +0100 Subject: [PATCH 24/57] - updated to 0.24.0 - added python2 bcond --- python-pygit2.spec | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index f9bc34a..8516bcd 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -3,6 +3,7 @@ # # Conditional build: %bcond_without tests # do not perform "make test" +%bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %bcond_without doc # documentation @@ -10,21 +11,23 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.23.3 +Version: 0.24.0 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python -#Source0Download: https://pypi.python.org/pypi/pygit2 +#Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: 1c20926ad48ce622b0087ab2bb812ae3 +# Source0-md5: 05f62d21f054c1a1559a726c7fdaeff1 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.23.0 +BuildRequires: libgit2-devel >= 0.24.0 +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.714 +%if %{with python2} BuildRequires: python-cffi BuildRequires: python-devel >= 1:2.7 BuildRequires: python-setuptools -BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.714 +%endif %if %{with python3} BuildRequires: python3-cffi BuildRequires: python3-devel >= 1:3.2 @@ -32,7 +35,7 @@ BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools %endif %{?with_doc:BuildRequires: sphinx-pdg} -Requires: libgit2 >= 0.23.0 +Requires: libgit2 >= 0.24.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -46,7 +49,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 0.23.0 +Requires: libgit2 >= 0.24.0 Requires: python3-cffi %description -n python3-%{module} @@ -56,15 +59,15 @@ pygit2 is a set of Python bindings to the libgit2 shared library. pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %package apidoc -Summary: pygit2 API documentation -Summary(pl.UTF-8): Dokumentacja API pygit2 +Summary: pygit2 module API documentation +Summary(pl.UTF-8): Dokumentacja API modułu pygit2 Group: Documentation %description apidoc -API documentation for %{module}. +API documentation for pygit2 module. %description apidoc -l pl.UTF-8 -Dokumentacja API %{module}. +Dokumentacja API modułu pygit2. %prep %setup -q -n %{module}-%{version} @@ -74,8 +77,10 @@ Dokumentacja API %{module}. %{__rm} test/test_{credentials,repository}.py %build +%if %{with python2} %py_build %{?with_tests:%py_build test} +%endif %if %{with python3} %py3_build @@ -86,13 +91,16 @@ Dokumentacja API %{module}. cd docs PACKAGE_BUILD=../build-2 \ %{__make} -j1 html -rm -rf _build/html/_sources +%{__rm} -r _build/html/_sources %endif %install rm -rf $RPM_BUILD_ROOT + +%if%{with python2} %py_install %py_postclean +%endif %if %{with python3} %py3_install @@ -101,6 +109,7 @@ rm -rf $RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT +%if %{with python2} %files %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt @@ -110,6 +119,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so %attr(755,root,root) %{py_sitedir}/_pygit2.so %{py_sitedir}/pygit2-%{version}-py*.egg-info +%endif %if %{with python3} %files -n python3-%{module} From 4dc13554fa197c9d99af1d53c95447189b65b072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 29 Apr 2016 19:15:51 +0300 Subject: [PATCH 25/57] unify apidocs package name, build noarch --- python-pygit2.spec | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 8516bcd..a328955 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -12,7 +12,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.24.0 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ @@ -58,15 +58,19 @@ pygit2 is a set of Python bindings to the libgit2 shared library. %description -n python3-%{module} -l pl.UTF-8 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. -%package apidoc +%package apidocs Summary: pygit2 module API documentation Summary(pl.UTF-8): Dokumentacja API modułu pygit2 Group: Documentation +Obsoletes: python-pygit2-apidoc < 0.24.0-2 +%if "%{_rpmversion}" >= "5" +BuildArch: noarch +%endif -%description apidoc +%description apidocs API documentation for pygit2 module. -%description apidoc -l pl.UTF-8 +%description apidocs -l pl.UTF-8 Dokumentacja API modułu pygit2. %prep @@ -135,7 +139,7 @@ rm -rf $RPM_BUILD_ROOT %endif %if %{with doc} -%files apidoc +%files apidocs %defattr(644,root,root,755) %doc docs/_build/html/* %endif From 1c3eeac0702a63fccfff864aa9ea500ac30cd701 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 9 Dec 2016 23:24:02 +0100 Subject: [PATCH 26/57] - updated to 0.24.2 --- python-pygit2.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index a328955..b4ddc15 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -11,13 +11,13 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.24.0 -Release: 2 +Version: 0.24.2 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ -Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz -# Source0-md5: 05f62d21f054c1a1559a726c7fdaeff1 +Source0: https://pypi.python.org/packages/29/fb/fd98403ed4ec5554ed4f6de3719d2c672ca2518598061ff7231301ff864b/%{module}-%{version}.tar.gz +# Source0-md5: 6feb3a5539e8ce1c251cef4401478060 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.24.0 From dedf2ec27abf867e1ecd2ed382c68d50d323009f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 10 Dec 2016 21:46:11 +0200 Subject: [PATCH 27/57] use pythonhosted for sane url --- python-pygit2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index b4ddc15..ade9c50 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -7,7 +7,9 @@ %bcond_without python3 # CPython 3.x module %bcond_without doc # documentation -%define module pygit2 +%define module pygit2 +%define egg_name pygit2 +%define pypi_name pygit2 Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} @@ -16,7 +18,7 @@ Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ -Source0: https://pypi.python.org/packages/29/fb/fd98403ed4ec5554ed4f6de3719d2c672ca2518598061ff7231301ff864b/%{module}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # Source0-md5: 6feb3a5539e8ce1c251cef4401478060 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 From 10ff4474aaebc882c1fffd4109c79e3d1d8c5103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 29 Dec 2016 00:40:31 +0100 Subject: [PATCH 28/57] - python 3.6 - release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index ade9c50..df79378 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -14,7 +14,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.24.2 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ From 776498466b08263b3215b4835ba9514837747c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Tue, 28 Mar 2017 20:14:35 +0200 Subject: [PATCH 29/57] - up to 0.25.0 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index df79378..65daa29 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -13,13 +13,13 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.24.2 -Release: 2 +Version: 0.25.0 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 6feb3a5539e8ce1c251cef4401478060 +# Source0-md5: 1c300ed15a15ce3a51a8ce589702db79 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.24.0 From 1b7c38dc7d87ec342512f6b4941ba76918d63803 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 28 Apr 2017 23:01:24 +0200 Subject: [PATCH 30/57] - adjusted for cffi 1.8.1+ --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 65daa29..87e20da 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -26,12 +26,12 @@ BuildRequires: libgit2-devel >= 0.24.0 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} -BuildRequires: python-cffi +BuildRequires: python-cffi >= 1.8.1 BuildRequires: python-devel >= 1:2.7 BuildRequires: python-setuptools %endif %if %{with python3} -BuildRequires: python3-cffi +BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools @@ -135,7 +135,7 @@ rm -rf $RPM_BUILD_ROOT %{py3_sitedir}/pygit2/decl.h %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/__pycache__ -%attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so %attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so %{py3_sitedir}/pygit2-%{version}-py*.egg-info %endif From 11a6130b19a46766d33b42647f1ffe1cfbf0fcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Wed, 22 Nov 2017 22:39:13 +0100 Subject: [PATCH 31/57] - up to 0.26.1 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 87e20da..bccf1fc 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -13,16 +13,16 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.25.0 +Version: 0.26.1 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 1c300ed15a15ce3a51a8ce589702db79 +# Source0-md5: 961b53b62c36c8ef9df3cc4e5884f039 Patch0: %{name}-docbuild.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.24.0 +BuildRequires: libgit2-devel >= 0.26.0 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} From e11402ba7bd19d832e48056aa81b28d55c0e8159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Wed, 22 Nov 2017 22:48:37 +0100 Subject: [PATCH 32/57] - rel 2; disable network tests from FC --- 0001-Remove-remote-calling-unit-tests.patch | 110 ++++++++++++++++++++ python-pygit2.spec | 7 +- 2 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 0001-Remove-remote-calling-unit-tests.patch diff --git a/0001-Remove-remote-calling-unit-tests.patch b/0001-Remove-remote-calling-unit-tests.patch new file mode 100644 index 0000000..4b31d2c --- /dev/null +++ b/0001-Remove-remote-calling-unit-tests.patch @@ -0,0 +1,110 @@ +From a36d3bebba08471caafe3e976a74afd040e90480 Mon Sep 17 00:00:00 2001 +From: Mathieu Bridon +Date: Wed, 21 Jan 2015 09:33:46 +0100 +Subject: [PATCH] Remove remote-calling unit tests + +These can only fail when building in Koji, as the builder can't access +the Internet. +--- + test/test_credentials.py | 21 --------------------- + test/test_repository.py | 7 ------- + test/test_submodule.py | 28 ---------------------------- + 3 files changed, 56 deletions(-) + +diff --git a/test/test_credentials.py b/test/test_credentials.py +index ff014c6..019f420 100644 +--- a/test/test_credentials.py ++++ b/test/test_credentials.py +@@ -81,26 +81,5 @@ class CredentialCallback(utils.RepoTestCase): + + self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) + +- def test_bad_cred_type(self): +- class MyCallbacks(pygit2.RemoteCallbacks): +- @staticmethod +- def credentials(url, username, allowed): +- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) +- return Keypair("git", "foo.pub", "foo", "sekkrit") +- +- url = "https://github.com/github/github" +- remote = self.repo.create_remote("github", url) +- self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks())) +- +-class CallableCredentialTest(utils.RepoTestCase): +- +- def test_user_pass(self): +- credentials = UserPass("libgit2", "libgit2") +- callbacks = pygit2.RemoteCallbacks(credentials=credentials) +- +- url = "https://bitbucket.org/libgit2/testgitrepository.git" +- remote = self.repo.create_remote("bb", url) +- remote.fetch(callbacks=callbacks) +- + if __name__ == '__main__': + unittest.main() +diff --git a/test/test_repository.py b/test/test_repository.py +index 0969fc0..033a1de 100644 +--- a/test/test_repository.py ++++ b/test/test_repository.py +@@ -551,13 +551,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): + self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) + self.assertIsNotNone(repo.remotes["custom_remote"]) + +- def test_clone_with_credentials(self): +- repo = clone_repository( +- "https://bitbucket.org/libgit2/testgitrepository.git", +- self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) +- +- self.assertFalse(repo.is_empty) +- + def test_clone_with_checkout_branch(self): + # create a test case which isolates the remote + test_repo = clone_repository('./test/data/testrepo.git', +diff --git a/test/test_submodule.py b/test/test_submodule.py +index f123b8b..a42736a 100644 +--- a/test/test_submodule.py ++++ b/test/test_submodule.py +@@ -53,14 +53,6 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase): + self.assertEqual(len(submodules), 1) + self.assertEqual(submodules[0], SUBM_PATH) + +- def test_submodule_open(self): +- s = self.repo.lookup_submodule(SUBM_PATH) +- self.repo.init_submodules() +- self.repo.update_submodules() +- r = s.open() +- self.assertIsNotNone(r) +- self.assertEqual(str(r.head.target), SUBM_HEAD_SHA) +- + def test_name(self): + s = self.repo.lookup_submodule(SUBM_PATH) + self.assertEqual(SUBM_NAME, s.name) +@@ -73,25 +65,5 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase): + s = self.repo.lookup_submodule(SUBM_PATH) + self.assertEqual(SUBM_URL, s.url) + +- def test_init_and_update(self): +- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') +- self.assertFalse(os.path.exists(subrepo_file_path)) +- self.repo.init_submodules() +- self.repo.update_submodules() +- self.assertTrue(os.path.exists(subrepo_file_path)) +- +- def test_specified_update(self): +- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') +- self.assertFalse(os.path.exists(subrepo_file_path)) +- self.repo.init_submodules(submodules=['submodule']) +- self.repo.update_submodules(submodules=['submodule']) +- self.assertTrue(os.path.exists(subrepo_file_path)) +- +- def test_oneshot_update(self): +- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') +- self.assertFalse(os.path.exists(subrepo_file_path)) +- self.repo.update_submodules(init=True) +- self.assertTrue(os.path.exists(subrepo_file_path)) +- + if __name__ == '__main__': + unittest.main() +-- +2.12.2 + diff --git a/python-pygit2.spec b/python-pygit2.spec index bccf1fc..bf90208 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -14,13 +14,14 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.26.1 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # Source0-md5: 961b53b62c36c8ef9df3cc4e5884f039 Patch0: %{name}-docbuild.patch +Patch1: 0001-Remove-remote-calling-unit-tests.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.26.0 BuildRequires: rpm-pythonprov @@ -78,9 +79,7 @@ Dokumentacja API modułu pygit2. %prep %setup -q -n %{module}-%{version} %patch0 -p1 - -# these tests use network -%{__rm} test/test_{credentials,repository}.py +%patch1 -p1 %build %if %{with python2} From 69d716d7e29710d6f2fe772c0ee9f5d813d536a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Tue, 3 Jul 2018 14:02:47 +0200 Subject: [PATCH 33/57] - release 3 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index bf90208..723ce02 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -14,7 +14,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.26.1 -Release: 2 +Release: 3 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ From 09e64e70419cb6fbfa9bbb222edd7eef285bb47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 20 Sep 2018 14:54:46 +0200 Subject: [PATCH 34/57] - release 4 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 723ce02..da1c41a 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -14,7 +14,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.26.1 -Release: 3 +Release: 4 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ From 98d2ca300fa6ddc37196dfdad285e472d3b1a476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 20 Sep 2018 17:42:11 +0200 Subject: [PATCH 35/57] - up to 0.27.2 --- 0001-Remove-remote-calling-unit-tests.patch | 110 -------------------- python-pygit2.spec | 10 +- 2 files changed, 4 insertions(+), 116 deletions(-) delete mode 100644 0001-Remove-remote-calling-unit-tests.patch diff --git a/0001-Remove-remote-calling-unit-tests.patch b/0001-Remove-remote-calling-unit-tests.patch deleted file mode 100644 index 4b31d2c..0000000 --- a/0001-Remove-remote-calling-unit-tests.patch +++ /dev/null @@ -1,110 +0,0 @@ -From a36d3bebba08471caafe3e976a74afd040e90480 Mon Sep 17 00:00:00 2001 -From: Mathieu Bridon -Date: Wed, 21 Jan 2015 09:33:46 +0100 -Subject: [PATCH] Remove remote-calling unit tests - -These can only fail when building in Koji, as the builder can't access -the Internet. ---- - test/test_credentials.py | 21 --------------------- - test/test_repository.py | 7 ------- - test/test_submodule.py | 28 ---------------------------- - 3 files changed, 56 deletions(-) - -diff --git a/test/test_credentials.py b/test/test_credentials.py -index ff014c6..019f420 100644 ---- a/test/test_credentials.py -+++ b/test/test_credentials.py -@@ -81,26 +81,5 @@ class CredentialCallback(utils.RepoTestCase): - - self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) - -- def test_bad_cred_type(self): -- class MyCallbacks(pygit2.RemoteCallbacks): -- @staticmethod -- def credentials(url, username, allowed): -- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) -- return Keypair("git", "foo.pub", "foo", "sekkrit") -- -- url = "https://github.com/github/github" -- remote = self.repo.create_remote("github", url) -- self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks())) -- --class CallableCredentialTest(utils.RepoTestCase): -- -- def test_user_pass(self): -- credentials = UserPass("libgit2", "libgit2") -- callbacks = pygit2.RemoteCallbacks(credentials=credentials) -- -- url = "https://bitbucket.org/libgit2/testgitrepository.git" -- remote = self.repo.create_remote("bb", url) -- remote.fetch(callbacks=callbacks) -- - if __name__ == '__main__': - unittest.main() -diff --git a/test/test_repository.py b/test/test_repository.py -index 0969fc0..033a1de 100644 ---- a/test/test_repository.py -+++ b/test/test_repository.py -@@ -551,13 +551,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): - self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) - self.assertIsNotNone(repo.remotes["custom_remote"]) - -- def test_clone_with_credentials(self): -- repo = clone_repository( -- "https://bitbucket.org/libgit2/testgitrepository.git", -- self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) -- -- self.assertFalse(repo.is_empty) -- - def test_clone_with_checkout_branch(self): - # create a test case which isolates the remote - test_repo = clone_repository('./test/data/testrepo.git', -diff --git a/test/test_submodule.py b/test/test_submodule.py -index f123b8b..a42736a 100644 ---- a/test/test_submodule.py -+++ b/test/test_submodule.py -@@ -53,14 +53,6 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase): - self.assertEqual(len(submodules), 1) - self.assertEqual(submodules[0], SUBM_PATH) - -- def test_submodule_open(self): -- s = self.repo.lookup_submodule(SUBM_PATH) -- self.repo.init_submodules() -- self.repo.update_submodules() -- r = s.open() -- self.assertIsNotNone(r) -- self.assertEqual(str(r.head.target), SUBM_HEAD_SHA) -- - def test_name(self): - s = self.repo.lookup_submodule(SUBM_PATH) - self.assertEqual(SUBM_NAME, s.name) -@@ -73,25 +65,5 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase): - s = self.repo.lookup_submodule(SUBM_PATH) - self.assertEqual(SUBM_URL, s.url) - -- def test_init_and_update(self): -- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') -- self.assertFalse(os.path.exists(subrepo_file_path)) -- self.repo.init_submodules() -- self.repo.update_submodules() -- self.assertTrue(os.path.exists(subrepo_file_path)) -- -- def test_specified_update(self): -- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') -- self.assertFalse(os.path.exists(subrepo_file_path)) -- self.repo.init_submodules(submodules=['submodule']) -- self.repo.update_submodules(submodules=['submodule']) -- self.assertTrue(os.path.exists(subrepo_file_path)) -- -- def test_oneshot_update(self): -- subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py') -- self.assertFalse(os.path.exists(subrepo_file_path)) -- self.repo.update_submodules(init=True) -- self.assertTrue(os.path.exists(subrepo_file_path)) -- - if __name__ == '__main__': - unittest.main() --- -2.12.2 - diff --git a/python-pygit2.spec b/python-pygit2.spec index da1c41a..2e3edc9 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -13,17 +13,16 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.26.1 -Release: 4 +Version: 0.27.2 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 961b53b62c36c8ef9df3cc4e5884f039 +# Source0-md5: 4db3fcd4c104f7e5a3cafb868e2bd0d4 Patch0: %{name}-docbuild.patch -Patch1: 0001-Remove-remote-calling-unit-tests.patch URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.26.0 +BuildRequires: libgit2-devel >= 0.27.0 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} @@ -79,7 +78,6 @@ Dokumentacja API modułu pygit2. %prep %setup -q -n %{module}-%{version} %patch0 -p1 -%patch1 -p1 %build %if %{with python2} From 0ea5331b9c058f30b3e830b09ce1fce147e008c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 20 Sep 2018 17:57:32 +0200 Subject: [PATCH 36/57] BR python pycparser --- python-pygit2.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-pygit2.spec b/python-pygit2.spec index 2e3edc9..5946a79 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -28,12 +28,14 @@ BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} BuildRequires: python-cffi >= 1.8.1 BuildRequires: python-devel >= 1:2.7 +BuildRequires: python-pycparser BuildRequires: python-setuptools %endif %if %{with python3} BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 +BuildRequires: python3-pycparser BuildRequires: python3-setuptools %endif %{?with_doc:BuildRequires: sphinx-pdg} From d979eb4eac76d0edd76e97e693ff9ed53d3a01fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 20 Sep 2018 18:05:26 +0200 Subject: [PATCH 37/57] - rel 2; no pycparser (from upstream) --- pycparser.patch | 23 +++++++++++++++++++++++ python-pygit2.spec | 6 +++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 pycparser.patch diff --git a/pycparser.patch b/pycparser.patch new file mode 100644 index 0000000..6d10ef0 --- /dev/null +++ b/pycparser.patch @@ -0,0 +1,23 @@ +From 1eaba181577de206d3d43ec7886d0353fc0c9f2a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= +Date: Mon, 17 Sep 2018 20:19:41 +0200 +Subject: [PATCH] Do not require older pycparser<2.18 + +Fixes #819 +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index d1fc4e90..21d9276e 100644 +--- a/setup.py ++++ b/setup.py +@@ -195,7 +195,7 @@ def run(self): + long_description=long_description, + packages=['pygit2'], + package_data={'pygit2': ['decl.h']}, +- setup_requires=['cffi', 'pycparser<2.18'], ++ setup_requires=['cffi'], + install_requires=['cffi', 'six'], + zip_safe=False, + cmdclass=cmdclass, diff --git a/python-pygit2.spec b/python-pygit2.spec index 5946a79..d838752 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -14,13 +14,14 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.27.2 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.python.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # Source0-md5: 4db3fcd4c104f7e5a3cafb868e2bd0d4 Patch0: %{name}-docbuild.patch +Patch1: pycparser.patch URL: https://pypi.python.org/pypi/pygit2 BuildRequires: libgit2-devel >= 0.27.0 BuildRequires: rpm-pythonprov @@ -28,14 +29,12 @@ BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} BuildRequires: python-cffi >= 1.8.1 BuildRequires: python-devel >= 1:2.7 -BuildRequires: python-pycparser BuildRequires: python-setuptools %endif %if %{with python3} BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 -BuildRequires: python3-pycparser BuildRequires: python3-setuptools %endif %{?with_doc:BuildRequires: sphinx-pdg} @@ -80,6 +79,7 @@ Dokumentacja API modułu pygit2. %prep %setup -q -n %{module}-%{version} %patch0 -p1 +%patch1 -p1 %build %if %{with python2} From 008db684b45f0bdb5c90b1d878a8f602feb1bb09 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 19 Oct 2018 18:52:00 +0200 Subject: [PATCH 38/57] - build process update --- python-pygit2.spec | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index d838752..b2a9bed 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -1,11 +1,9 @@ -# TODO: -# building doc requires pygit2 installed in system # # Conditional build: -%bcond_without tests # do not perform "make test" %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %bcond_without doc # documentation +%bcond_without tests # unit tests %define module pygit2 %define egg_name pygit2 @@ -17,12 +15,12 @@ Version: 0.27.2 Release: 2 License: GPL v2 with linking exception Group: Libraries/Python -#Source0Download: https://pypi.python.org/simple/pygit2/ -Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +#Source0Download: https://pypi.org/simple/pygit2/ +Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz # Source0-md5: 4db3fcd4c104f7e5a3cafb868e2bd0d4 Patch0: %{name}-docbuild.patch Patch1: pycparser.patch -URL: https://pypi.python.org/pypi/pygit2 +URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 0.27.0 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 @@ -37,7 +35,7 @@ BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools %endif -%{?with_doc:BuildRequires: sphinx-pdg} +%{?with_doc:BuildRequires: sphinx-pdg-3} Requires: libgit2 >= 0.24.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -83,20 +81,17 @@ Dokumentacja API modułu pygit2. %build %if %{with python2} -%py_build -%{?with_tests:%py_build test} +%py_build %{?with_tests:test} %endif %if %{with python3} -%py3_build -%{?with_tests:%py3_build test} +%py3_build %{?with_tests:test} %endif %if %{with doc} -cd docs -PACKAGE_BUILD=../build-2 \ -%{__make} -j1 html -%{__rm} -r _build/html/_sources +PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ +%{__make} -C docs -j1 html \ + SPHINXBUILD=sphinx-build-3 %endif %install @@ -104,6 +99,7 @@ rm -rf $RPM_BUILD_ROOT %if%{with python2} %py_install + %py_postclean %endif @@ -142,5 +138,5 @@ rm -rf $RPM_BUILD_ROOT %if %{with doc} %files apidocs %defattr(644,root,root,755) -%doc docs/_build/html/* +%doc docs/_build/html/{_static,recipes,*.html,*.js} %endif From b06b30e622e60863b89ffbf82fba8822f855a3b7 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Thu, 25 Jul 2019 21:24:02 +0200 Subject: [PATCH 39/57] up to 0.28.2 - dropped obsolete pycparser patch - attempt to adjust tests to pytest but still fail -- toggled bcond --- pycparser.patch | 23 ----------------------- python-pygit2.spec | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 33 deletions(-) delete mode 100644 pycparser.patch diff --git a/pycparser.patch b/pycparser.patch deleted file mode 100644 index 6d10ef0..0000000 --- a/pycparser.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 1eaba181577de206d3d43ec7886d0353fc0c9f2a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= -Date: Mon, 17 Sep 2018 20:19:41 +0200 -Subject: [PATCH] Do not require older pycparser<2.18 - -Fixes #819 ---- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index d1fc4e90..21d9276e 100644 ---- a/setup.py -+++ b/setup.py -@@ -195,7 +195,7 @@ def run(self): - long_description=long_description, - packages=['pygit2'], - package_data={'pygit2': ['decl.h']}, -- setup_requires=['cffi', 'pycparser<2.18'], -+ setup_requires=['cffi'], - install_requires=['cffi', 'six'], - zip_safe=False, - cmdclass=cmdclass, diff --git a/python-pygit2.spec b/python-pygit2.spec index b2a9bed..a256981 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -3,7 +3,7 @@ %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %bcond_without doc # documentation -%bcond_without tests # unit tests +%bcond_with tests # unit tests %define module pygit2 %define egg_name pygit2 @@ -11,15 +11,14 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} -Version: 0.27.2 -Release: 2 +Version: 0.28.2 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 4db3fcd4c104f7e5a3cafb868e2bd0d4 +# Source0-md5: e5fad67c46e2ebf3391cb9650684923d Patch0: %{name}-docbuild.patch -Patch1: pycparser.patch URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 0.27.0 BuildRequires: rpm-pythonprov @@ -28,12 +27,18 @@ BuildRequires: rpmbuild(macros) >= 1.714 BuildRequires: python-cffi >= 1.8.1 BuildRequires: python-devel >= 1:2.7 BuildRequires: python-setuptools +%if %{with tests} +BuildRequires: python-pytest +%endif %endif %if %{with python3} BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools +%if %{with tests} +BuildRequires: python3-pytest +%endif %endif %{?with_doc:BuildRequires: sphinx-pdg-3} Requires: libgit2 >= 0.24.0 @@ -77,15 +82,18 @@ Dokumentacja API modułu pygit2. %prep %setup -q -n %{module}-%{version} %patch0 -p1 -%patch1 -p1 %build %if %{with python2} -%py_build %{?with_tests:test} +%py_build + +%{?with_tests:PYTHONPATH=$(echo $(pwd)/build-2/lib.*) %{__python} -m pytest test} %endif %if %{with python3} -%py3_build %{?with_tests:test} +%py3_build + +%{?with_tests:PYTHONPATH=$(echo $(pwd)/build-3/lib.*) %{__python3} -m pytest test} %endif %if %{with doc} @@ -116,7 +124,7 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING README.rst TODO.txt %dir %{py_sitedir}/pygit2 %{py_sitedir}/pygit2/*.py[co] -%{py_sitedir}/pygit2/decl.h +%{py_sitedir}/pygit2/decl %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so %attr(755,root,root) %{py_sitedir}/_pygit2.so %{py_sitedir}/pygit2-%{version}-py*.egg-info @@ -127,7 +135,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc COPYING README.rst TODO.txt %dir %{py3_sitedir}/pygit2 -%{py3_sitedir}/pygit2/decl.h +%{py3_sitedir}/pygit2/decl %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/__pycache__ %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so From 4990bb01b811cde7dcb54de6be8816399c4e32b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Mon, 28 Oct 2019 09:45:32 +0100 Subject: [PATCH 40/57] - rebuild with python 3.8 - release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index a256981..1d59593 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -12,7 +12,7 @@ Summary: Python 2.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 Name: python-%{module} Version: 0.28.2 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 73d8bb66300b7fd86eaacb44d03e8a8b9323ac96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sun, 17 May 2020 09:04:23 +0200 Subject: [PATCH 41/57] - up to 1.2.1 for libgit2 1.x - support for python 2 and apidocs have been removed upstream --- python-pygit2-docbuild.patch | 12 ----- python-pygit2.spec | 91 ++++-------------------------------- 2 files changed, 8 insertions(+), 95 deletions(-) delete mode 100644 python-pygit2-docbuild.patch diff --git a/python-pygit2-docbuild.patch b/python-pygit2-docbuild.patch deleted file mode 100644 index 90866e8..0000000 --- a/python-pygit2-docbuild.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- pygit2-0.21.3/docs/conf.py.orig 2014-09-18 16:25:58.336102616 +0200 -+++ pygit2-0.21.3/docs/conf.py 2014-09-18 16:30:38.056090370 +0200 -@@ -18,7 +18,8 @@ - # add these directories to sys.path here. If the directory is relative to the - # documentation root, use os.path.abspath to make it absolute, like shown here. - version_string = sys.platform.rstrip(digits) + "-" + os.uname()[4] + "-" + ".".join(platform.python_version_tuple()[0:2]) --sys.path.insert(0, os.path.abspath('../build/lib.' + version_string)) -+builddir = os.getenv('PACKAGE_BUILD', '../build') -+sys.path.insert(0, os.path.abspath(builddir + '/lib.' + version_string)) - - # -- General configuration ----------------------------------------------------- - diff --git a/python-pygit2.spec b/python-pygit2.spec index 1d59593..e4f5a4d 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -1,46 +1,29 @@ # # Conditional build: -%bcond_without python2 # CPython 2.x module -%bcond_without python3 # CPython 3.x module -%bcond_without doc # documentation %bcond_with tests # unit tests %define module pygit2 %define egg_name pygit2 %define pypi_name pygit2 -Summary: Python 2.x bindings for libgit2 library -Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 +Summary: Python bindings for libgit2 library +Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 0.28.2 -Release: 2 +Version: 1.2.1 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: e5fad67c46e2ebf3391cb9650684923d -Patch0: %{name}-docbuild.patch +# Source0-md5: 20aa2d7a80d28ee87f5a17f373444f6f URL: https://pypi.org/project/pygit2/ -BuildRequires: libgit2-devel >= 0.27.0 +BuildRequires: libgit2-devel >= 1.0 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 -%if %{with python2} -BuildRequires: python-cffi >= 1.8.1 -BuildRequires: python-devel >= 1:2.7 -BuildRequires: python-setuptools -%if %{with tests} -BuildRequires: python-pytest -%endif -%endif -%if %{with python3} BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools -%if %{with tests} BuildRequires: python3-pytest -%endif -%endif -%{?with_doc:BuildRequires: sphinx-pdg-3} Requires: libgit2 >= 0.24.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -64,87 +47,29 @@ pygit2 is a set of Python bindings to the libgit2 shared library. %description -n python3-%{module} -l pl.UTF-8 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. -%package apidocs -Summary: pygit2 module API documentation -Summary(pl.UTF-8): Dokumentacja API modułu pygit2 -Group: Documentation -Obsoletes: python-pygit2-apidoc < 0.24.0-2 -%if "%{_rpmversion}" >= "5" -BuildArch: noarch -%endif - -%description apidocs -API documentation for pygit2 module. - -%description apidocs -l pl.UTF-8 -Dokumentacja API modułu pygit2. - %prep %setup -q -n %{module}-%{version} -%patch0 -p1 %build -%if %{with python2} -%py_build - -%{?with_tests:PYTHONPATH=$(echo $(pwd)/build-2/lib.*) %{__python} -m pytest test} -%endif - -%if %{with python3} %py3_build %{?with_tests:PYTHONPATH=$(echo $(pwd)/build-3/lib.*) %{__python3} -m pytest test} -%endif - -%if %{with doc} -PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ -%{__make} -C docs -j1 html \ - SPHINXBUILD=sphinx-build-3 -%endif %install rm -rf $RPM_BUILD_ROOT -%if%{with python2} -%py_install - -%py_postclean -%endif - -%if %{with python3} %py3_install -%endif %clean rm -rf $RPM_BUILD_ROOT -%if %{with python2} -%files -%defattr(644,root,root,755) -%doc COPYING README.rst TODO.txt -%dir %{py_sitedir}/pygit2 -%{py_sitedir}/pygit2/*.py[co] -%{py_sitedir}/pygit2/decl -%attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so -%attr(755,root,root) %{py_sitedir}/_pygit2.so -%{py_sitedir}/pygit2-%{version}-py*.egg-info -%endif - -%if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) -%doc COPYING README.rst TODO.txt +%doc AUTHORS.rst CHANGELOG.rst README.rst SPONSORS.rst %dir %{py3_sitedir}/pygit2 %{py3_sitedir}/pygit2/decl %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/__pycache__ %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so -%attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/pygit2/_pygit2.cpython-*.so %{py3_sitedir}/pygit2-%{version}-py*.egg-info -%endif - -%if %{with doc} -%files apidocs -%defattr(644,root,root,755) -%doc docs/_build/html/{_static,recipes,*.html,*.js} -%endif From 365b70ef61c8acf95a4f68cfeba8852c131aca08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Tue, 2 Mar 2021 07:26:49 +0100 Subject: [PATCH 42/57] - release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index e4f5a4d..cb3d478 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.2.1 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From c84dc49b35aa17a983179707e228b5659cd80174 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Fri, 28 May 2021 01:02:18 +0200 Subject: [PATCH 43/57] require pytest only when building with tests --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index cb3d478..f8c2e68 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -23,7 +23,7 @@ BuildRequires: python3-cffi >= 1.8.1 BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools -BuildRequires: python3-pytest +%{?with_tests:BuildRequires: python3-pytest} Requires: libgit2 >= 0.24.0 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) From 150f68ce526d3d36d6895d6c8df612909382b23b Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Fri, 28 May 2021 01:03:25 +0200 Subject: [PATCH 44/57] up to 1.5.0 --- python-pygit2.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index f8c2e68..e82d11b 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,15 +8,15 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.2.1 -Release: 2 +Version: 1.5.0 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 20aa2d7a80d28ee87f5a17f373444f6f +# Source0-md5: 2b4590e3a0a08f03d5db6faf3d3ff66c URL: https://pypi.org/project/pygit2/ -BuildRequires: libgit2-devel >= 1.0 +BuildRequires: libgit2-devel >= 1.1 BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 BuildRequires: python3-cffi >= 1.8.1 @@ -24,7 +24,7 @@ BuildRequires: python3-devel >= 1:3.2 BuildRequires: python3-modules >= 1:3.2 BuildRequires: python3-setuptools %{?with_tests:BuildRequires: python3-pytest} -Requires: libgit2 >= 0.24.0 +Requires: libgit2 >= 1.1 Requires: python-cffi BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -38,7 +38,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 0.24.0 +Requires: libgit2 >= 1.1 Requires: python3-cffi %description -n python3-%{module} From 9ec37f0ab980859f23681e82c7fed9de64e277e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sun, 5 Sep 2021 01:15:56 +0200 Subject: [PATCH 45/57] - up to 1.6.1 --- python-pygit2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index e82d11b..ef9f417 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,13 +8,13 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.5.0 +Version: 1.6.1 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 2b4590e3a0a08f03d5db6faf3d3ff66c +# Source0-md5: dea86e8c5db413d547dc6509124ccbf9 URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.1 BuildRequires: rpm-pythonprov From 239911712c1618a1a5c1b8daa2d80c212fe7865f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sun, 5 Sep 2021 09:47:00 +0200 Subject: [PATCH 46/57] - relax libgit2 version check to >=1.1 --- libgit2-1.2.patch | 11 +++++++++++ python-pygit2.spec | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 libgit2-1.2.patch diff --git a/libgit2-1.2.patch b/libgit2-1.2.patch new file mode 100644 index 0000000..079007b --- /dev/null +++ b/libgit2-1.2.patch @@ -0,0 +1,11 @@ +--- pygit2-1.6.1/src/types.h~ 2021-06-19 11:40:24.000000000 +0200 ++++ pygit2-1.6.1/src/types.h 2021-09-05 09:45:39.881939711 +0200 +@@ -32,7 +32,7 @@ + #include + #include + +-#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 1) ++#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 1) + #error You need a compatible libgit2 version (1.1.x) + #endif + diff --git a/python-pygit2.spec b/python-pygit2.spec index ef9f417..ae35a1d 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -15,6 +15,7 @@ Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz # Source0-md5: dea86e8c5db413d547dc6509124ccbf9 +Patch0: libgit2-1.2.patch URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.1 BuildRequires: rpm-pythonprov @@ -49,6 +50,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %prep %setup -q -n %{module}-%{version} +%patch0 -p1 %build %py3_build From 342f6f1c3cb81d1d96a5559a1d54b0c81955719c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sat, 23 Oct 2021 10:41:18 +0200 Subject: [PATCH 47/57] Release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index ae35a1d..d6e3cbc 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.6.1 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From dafac1dbe391ca132001fa0eec2ec6848337e75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sat, 26 Mar 2022 01:05:37 +0100 Subject: [PATCH 48/57] rebuild with python 3.10 Release 3 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index d6e3cbc..367e8c2 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.6.1 -Release: 2 +Release: 3 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 824108ee7d56daf705730f649fd570451bee1788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Sun, 27 Mar 2022 22:50:22 +0200 Subject: [PATCH 49/57] Release 4 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 367e8c2..17e156e 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.6.1 -Release: 3 +Release: 4 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 7c6f7468ff50efffe5b8dc851b837b70f1571a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Wed, 30 Mar 2022 14:03:09 +0200 Subject: [PATCH 50/57] rebuild with tests and docs Release 5 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 17e156e..2d62c5f 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.6.1 -Release: 4 +Release: 5 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 3bf57d5c8fe5ba52c09eb955182573e5b86894da Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 27 Jun 2022 22:46:33 +0200 Subject: [PATCH 51/57] - updated to 1.9.2 for libgit2 1.4.x/python 3.7+ --- libgit2-1.2.patch | 11 ----------- python-pygit2.spec | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 27 deletions(-) delete mode 100644 libgit2-1.2.patch diff --git a/libgit2-1.2.patch b/libgit2-1.2.patch deleted file mode 100644 index 079007b..0000000 --- a/libgit2-1.2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- pygit2-1.6.1/src/types.h~ 2021-06-19 11:40:24.000000000 +0200 -+++ pygit2-1.6.1/src/types.h 2021-09-05 09:45:39.881939711 +0200 -@@ -32,7 +32,7 @@ - #include - #include - --#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 1) -+#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 1) - #error You need a compatible libgit2 version (1.1.x) - #endif - diff --git a/python-pygit2.spec b/python-pygit2.spec index 2d62c5f..0804f29 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,25 +8,22 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.6.1 -Release: 5 +Version: 1.9.2 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: dea86e8c5db413d547dc6509124ccbf9 -Patch0: libgit2-1.2.patch +# Source0-md5: 772a1b14dabc91e6a6dceb2cd0026d36 URL: https://pypi.org/project/pygit2/ -BuildRequires: libgit2-devel >= 1.1 -BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.714 -BuildRequires: python3-cffi >= 1.8.1 -BuildRequires: python3-devel >= 1:3.2 -BuildRequires: python3-modules >= 1:3.2 +BuildRequires: libgit2-devel >= 1.4 +BuildRequires: python3-cffi >= 1.9.1 +BuildRequires: python3-devel >= 1:3.7 +BuildRequires: python3-modules >= 1:3.7 BuildRequires: python3-setuptools %{?with_tests:BuildRequires: python3-pytest} -Requires: libgit2 >= 1.1 -Requires: python-cffi +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.714 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -39,8 +36,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. Summary: Python 3.x bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 Group: Libraries/Python -Requires: libgit2 >= 1.1 -Requires: python3-cffi +Requires: libgit2 >= 1.4 %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. @@ -50,12 +46,15 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %prep %setup -q -n %{module}-%{version} -%patch0 -p1 %build %py3_build -%{?with_tests:PYTHONPATH=$(echo $(pwd)/build-3/lib.*) %{__python3} -m pytest test} +%if %{with tests} +PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ +PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ +%{__python3} -m pytest test +%endif %install rm -rf $RPM_BUILD_ROOT @@ -71,6 +70,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{py3_sitedir}/pygit2 %{py3_sitedir}/pygit2/decl %{py3_sitedir}/pygit2/*.py +%{py3_sitedir}/pygit2/*.pyi %{py3_sitedir}/pygit2/__pycache__ %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so %attr(755,root,root) %{py3_sitedir}/pygit2/_pygit2.cpython-*.so From bec201338eebc7eac0515565be605f42c9a6a4dd Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sat, 26 Aug 2023 22:56:10 +0200 Subject: [PATCH 52/57] up to 1.12.2 --- python-pygit2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 0804f29..1b6fb4c 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,13 +8,13 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.9.2 +Version: 1.12.2 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 772a1b14dabc91e6a6dceb2cd0026d36 +# Source0-md5: 3f3847a7f78648352cd9623fec976324 URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.4 BuildRequires: python3-cffi >= 1.9.1 From f860f16de80a1ad5a7b1d332d3b3785f82801d47 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Tue, 21 Nov 2023 18:55:18 +0100 Subject: [PATCH 53/57] up to 1.13.3 --- python-pygit2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 1b6fb4c..3475d12 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,16 +8,16 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.12.2 +Version: 1.13.3 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 3f3847a7f78648352cd9623fec976324 +# Source0-md5: 9363b49de112bd6648b4b1ffe7ac0f02 URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.4 -BuildRequires: python3-cffi >= 1.9.1 +BuildRequires: python3-cffi >= 1.16.0 BuildRequires: python3-devel >= 1:3.7 BuildRequires: python3-modules >= 1:3.7 BuildRequires: python3-setuptools From 825f14af56f74235382332ae50125274b048cc86 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Thu, 12 Dec 2024 14:00:23 +0100 Subject: [PATCH 54/57] up to 1.16.0 --- gcc14.patch | 37 +++++++++++++++++++++++++++++++++++++ python-pygit2.spec | 15 +++++++++------ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 gcc14.patch diff --git a/gcc14.patch b/gcc14.patch new file mode 100644 index 0000000..5bcd933 --- /dev/null +++ b/gcc14.patch @@ -0,0 +1,37 @@ +From eba710e45bb40e18641c6531394bb46631e7f295 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= +Date: Tue, 5 Nov 2024 12:26:44 +0100 +Subject: [PATCH] fix: use correct type of the ninth parameter of + git_commit_create() + +It should be `const git_commit **`, not `git_commit **`. + +Breaks the build with GCC-14. +--- + src/repository.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/repository.c b/src/repository.c +index d1d42ecf..3b5d57a1 100644 +--- a/src/repository.c ++++ b/src/repository.c +@@ -1065,7 +1065,8 @@ Repository_create_commit(Repository *self, PyObject *args) + + err = git_commit_create(&oid, self->repo, update_ref, + py_author->signature, py_committer->signature, +- encoding, message, tree, parent_count, parents); ++ encoding, message, tree, parent_count, ++ (const git_commit **)parents); + if (err < 0) { + Error_set(err); + goto out; +@@ -1147,7 +1148,8 @@ Repository_create_commit_string(Repository *self, PyObject *args) + + err = git_commit_create_buffer(&buf, self->repo, + py_author->signature, py_committer->signature, +- encoding, message, tree, parent_count, parents); ++ encoding, message, tree, parent_count, ++ (const git_commit **)parents); + if (err < 0) { + Error_set(err); + goto out; diff --git a/python-pygit2.spec b/python-pygit2.spec index 3475d12..10ca650 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,18 +8,19 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.13.3 +Version: 1.16.0 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 9363b49de112bd6648b4b1ffe7ac0f02 +# Source0-md5: 6badd46c191ecf776d24da5ed175790c +Patch0: gcc14.patch URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.4 -BuildRequires: python3-cffi >= 1.16.0 -BuildRequires: python3-devel >= 1:3.7 -BuildRequires: python3-modules >= 1:3.7 +BuildRequires: python3-cffi >= 1.17.0 +BuildRequires: python3-devel >= 1:3.10 +BuildRequires: python3-modules >= 1:3.10 BuildRequires: python3-setuptools %{?with_tests:BuildRequires: python3-pytest} BuildRequires: rpm-pythonprov @@ -46,6 +47,7 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %prep %setup -q -n %{module}-%{version} +%patch -P 0 -p1 %build %py3_build @@ -66,9 +68,10 @@ rm -rf $RPM_BUILD_ROOT %files -n python3-%{module} %defattr(644,root,root,755) -%doc AUTHORS.rst CHANGELOG.rst README.rst SPONSORS.rst +%doc AUTHORS.md CHANGELOG.md README.md SPONSORS.md %dir %{py3_sitedir}/pygit2 %{py3_sitedir}/pygit2/decl +%{py3_sitedir}/pygit2/py.typed %{py3_sitedir}/pygit2/*.py %{py3_sitedir}/pygit2/*.pyi %{py3_sitedir}/pygit2/__pycache__ From 6eeb526683da23f558e6ec043a0cb1d1e24ba790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Mon, 10 Mar 2025 18:26:15 +0100 Subject: [PATCH 55/57] python 3.13 rebuild Release 2 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 10ca650..7f3826a 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.16.0 -Release: 1 +Release: 2 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 2786705882c7c5bd1c09b29b90d1476fed9ced54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C4=99korajski?= Date: Tue, 11 Mar 2025 23:31:34 +0100 Subject: [PATCH 56/57] doc/test rebuild for python 3.13 Release 3 (by relup.sh) --- python-pygit2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pygit2.spec b/python-pygit2.spec index 7f3826a..51a0aba 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -9,7 +9,7 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} Version: 1.16.0 -Release: 2 +Release: 3 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ From 1e12d396f89e19864926bf4ed504e71e45902ee1 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Mon, 22 Dec 2025 13:31:17 +0100 Subject: [PATCH 57/57] up to 1.19.0 --- gcc14.patch | 37 ------------------------------------- python-pygit2.spec | 14 ++++++-------- 2 files changed, 6 insertions(+), 45 deletions(-) delete mode 100644 gcc14.patch diff --git a/gcc14.patch b/gcc14.patch deleted file mode 100644 index 5bcd933..0000000 --- a/gcc14.patch +++ /dev/null @@ -1,37 +0,0 @@ -From eba710e45bb40e18641c6531394bb46631e7f295 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= -Date: Tue, 5 Nov 2024 12:26:44 +0100 -Subject: [PATCH] fix: use correct type of the ninth parameter of - git_commit_create() - -It should be `const git_commit **`, not `git_commit **`. - -Breaks the build with GCC-14. ---- - src/repository.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/repository.c b/src/repository.c -index d1d42ecf..3b5d57a1 100644 ---- a/src/repository.c -+++ b/src/repository.c -@@ -1065,7 +1065,8 @@ Repository_create_commit(Repository *self, PyObject *args) - - err = git_commit_create(&oid, self->repo, update_ref, - py_author->signature, py_committer->signature, -- encoding, message, tree, parent_count, parents); -+ encoding, message, tree, parent_count, -+ (const git_commit **)parents); - if (err < 0) { - Error_set(err); - goto out; -@@ -1147,7 +1148,8 @@ Repository_create_commit_string(Repository *self, PyObject *args) - - err = git_commit_create_buffer(&buf, self->repo, - py_author->signature, py_committer->signature, -- encoding, message, tree, parent_count, parents); -+ encoding, message, tree, parent_count, -+ (const git_commit **)parents); - if (err < 0) { - Error_set(err); - goto out; diff --git a/python-pygit2.spec b/python-pygit2.spec index 51a0aba..bc1f657 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -8,19 +8,18 @@ Summary: Python bindings for libgit2 library Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 1.16.0 -Release: 3 +Version: 1.19.0 +Release: 1 License: GPL v2 with linking exception Group: Libraries/Python #Source0Download: https://pypi.org/simple/pygit2/ Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz -# Source0-md5: 6badd46c191ecf776d24da5ed175790c -Patch0: gcc14.patch +# Source0-md5: 411d41189d99a69e6c7f0faa35e62442 URL: https://pypi.org/project/pygit2/ BuildRequires: libgit2-devel >= 1.4 -BuildRequires: python3-cffi >= 1.17.0 -BuildRequires: python3-devel >= 1:3.10 -BuildRequires: python3-modules >= 1:3.10 +BuildRequires: python3-cffi >= 2.0 +BuildRequires: python3-devel >= 1:3.11 +BuildRequires: python3-modules >= 1:3.11 BuildRequires: python3-setuptools %{?with_tests:BuildRequires: python3-pytest} BuildRequires: rpm-pythonprov @@ -47,7 +46,6 @@ pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %prep %setup -q -n %{module}-%{version} -%patch -P 0 -p1 %build %py3_build