Skip to content

Commit

Permalink
Upgrade to libgit2 v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Jul 17, 2023
1 parent 5555555 commit 1473e8e
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt install tinyproxy
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.6.4 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.0 /bin/sh build.sh test
- name: macOS
if: runner.os == 'macOS'
run: |
export OPENSSL_PREFIX=`brew --prefix [email protected]`
export LIBSSH2_PREFIX=`brew --prefix libssh2`
export LIBGIT2_VERSION=1.6.4
export LIBGIT2_VERSION=1.7.0
/bin/sh build.sh test
aarch64:
Expand All @@ -59,7 +59,7 @@ jobs:
apt-get update -q -y
apt-get install -q -y cmake libssl-dev python3-dev python3-venv wget
run: |
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.6.4 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.0 /bin/sh build.sh test
s390x:
runs-on: ubuntu-20.04
Expand All @@ -77,5 +77,5 @@ jobs:
apt-get update -q -y
apt-get install -q -y cmake libssl-dev python3-dev python3-venv wget
run: |
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.6.4 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.0 /bin/sh build.sh test
continue-on-error: true # Tests are expected to fail, see issue #812
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL: sh build.sh
CIBW_ENVIRONMENT: LIBGIT2_VERSION=1.6.4 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 LIBGIT2=/project/ci
CIBW_ENVIRONMENT_MACOS: LIBGIT2_VERSION=1.6.4 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 DYLD_LIBRARY_PATH=/usr/local/lib
CIBW_ENVIRONMENT: LIBGIT2_VERSION=1.7.0 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 LIBGIT2=/project/ci
CIBW_ENVIRONMENT_MACOS: LIBGIT2_VERSION=1.7.0 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 DYLD_LIBRARY_PATH=/usr/local/lib
CIBW_SKIP: "*-musllinux* *pypy*"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
1.13.0 (UNRELEASED)
-------------------------

- Upgrade to libgit2 v1.7.0

- docs: update links to pypy, pygit2.org
`#1228 <https://github.com/libgit2/pygit2/pull/1228>`_


1.12.2 (2023-06-25)
-------------------------

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: build html

build:
OPENSSL_VERSION=3.0.9 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.6.4 sh build.sh
OPENSSL_VERSION=3.0.9 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.0 sh build.sh

html: build
make -C docs html
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build_script:
# Clone, build and install libgit2
- cmd: |
set LIBGIT2=%APPVEYOR_BUILD_FOLDER%\venv
git clone --depth=1 -b v1.6.4 https://github.com/libgit2/libgit2.git libgit2
git clone --depth=1 -b v1.7.0 https://github.com/libgit2/libgit2.git libgit2
cd libgit2
cmake . -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%LIBGIT2%" -G "%GENERATOR%"
cmake --build . --target install
Expand Down
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
#
# sh build.sh
#
# Build libgit2 1.6.4 (will use libssh2 if available), then build pygit2
# Build libgit2 1.7.0 (will use libssh2 if available), then build pygit2
# inplace:
#
# LIBGIT2_VERSION=1.6.4 sh build.sh
# LIBGIT2_VERSION=1.7.0 sh build.sh
#
# Build libssh2 1.11.0 and libgit2 1.6.4, then build pygit2 inplace:
# Build libssh2 1.11.0 and libgit2 1.7.0, then build pygit2 inplace:
#
# LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.6.4 sh build.sh
# LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.0 sh build.sh
#
# Tell where libssh2 is installed, build libgit2 1.6.4, then build pygit2
# Tell where libssh2 is installed, build libgit2 1.7.0, then build pygit2
# inplace:
#
# LIBSSH2_PREFIX=/usr/local LIBGIT2_VERSION=1.6.4 sh build.sh
# LIBSSH2_PREFIX=/usr/local LIBGIT2_VERSION=1.7.0 sh build.sh
#
# Build inplace and run the tests:
#
Expand Down
18 changes: 10 additions & 8 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Python requirements (these are specified in ``setup.py``):

- cffi 1.9.1+

Libgit2 **v1.6.4+**; binary wheels already include libgit2, so you only need to
Libgit2 **v1.7.0+**; binary wheels already include libgit2, so you only need to
worry about this if you install the source package.

Optional libgit2 dependecies to support ssh and https:
Expand Down Expand Up @@ -86,6 +86,8 @@ of Python and the required libgit2 version.
+-----------+----------------+------------+
| pygit2 | Python | libgit2 |
+-----------+----------------+------------+
| 1.13 | 3.8 - 3.11 | 1.7 |
+-----------+----------------+------------+
| 1.12 | 3.8 - 3.11 | 1.6 |
+-----------+----------------+------------+
| 1.11 | 3.8 - 3.11 | 1.5 |
Expand Down Expand Up @@ -137,9 +139,9 @@ directory, do:

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.6.4.tar.gz -O libgit2-1.6.4.tar.gz
$ tar xzf libgit2-1.6.4.tar.gz
$ cd libgit2-1.6.4/
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.0.tar.gz -O libgit2-1.7.0.tar.gz
$ tar xzf libgit2-1.7.0.tar.gz
$ cd libgit2-1.7.0/
$ cmake .
$ make
$ sudo make install
Expand Down Expand Up @@ -221,9 +223,9 @@ Install libgit2 (see we define the installation prefix):

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.6.4.tar.gz -O libgit2-1.6.4.tar.gz
$ tar xzf libgit2-1.6.4.tar.gz
$ cd libgit2-1.6.4/
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.0.tar.gz -O libgit2-1.7.0.tar.gz
$ tar xzf libgit2-1.7.0.tar.gz
$ cd libgit2-1.7.0/
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2
$ cmake --build . --target install
Expand Down Expand Up @@ -280,7 +282,7 @@ variable. The following recipe shows you how to do it from a bash shell:
.. code-block:: sh
$ export LIBGIT2=C:/Dev/libgit2
$ git clone --depth=1 -b v1.6.4 https://github.com/libgit2/libgit2.git
$ git clone --depth=1 -b v1.7.0 https://github.com/libgit2/libgit2.git
$ cd libgit2
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2 -G "Visual Studio 14 Win64"
$ cmake --build . --config release --target install
Expand Down
1 change: 1 addition & 0 deletions pygit2/decl/diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef struct {
void *payload;
uint32_t context_lines;
uint32_t interhunk_lines;
git_oid_t oid_type;
uint16_t id_abbrev;
git_off_t max_size;
const char *old_prefix;
Expand Down
4 changes: 4 additions & 0 deletions pygit2/decl/oid.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
typedef enum {
GIT_OID_SHA1 = 1, /**< SHA1 */
} git_oid_t;

typedef struct git_oid {
unsigned char id[20];
} git_oid;
Expand Down
1 change: 1 addition & 0 deletions pygit2/decl/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef struct {
int update_fetchhead;
git_remote_autotag_option_t download_tags;
git_proxy_options proxy_opts;
int depth;
git_remote_redirect_t follow_redirects;
git_strarray custom_headers;
} git_fetch_options;
Expand Down
4 changes: 2 additions & 2 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <Python.h>
#include <git2.h>

#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 6)
#error You need a compatible libgit2 version (1.6.x)
#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 7)
#error You need a compatible libgit2 version (1.7.x)
#endif

/*
Expand Down

0 comments on commit 1473e8e

Please sign in to comment.