Skip to content

Commit

Permalink
Upgrade to libgit2 v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Mar 21, 2024
1 parent bbddee6 commit 6d539d7
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Expand Up @@ -34,13 +34,13 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt install tinyproxy
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 /bin/sh build.sh test
- name: macOS
if: runner.os == 'macOS'
run: |
export OPENSSL_PREFIX=`brew --prefix openssl@1.1`
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 /bin/sh build.sh test
aarch64:
runs-on: ubuntu-22.04
Expand All @@ -57,7 +57,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.7.2 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 /bin/sh build.sh test
s390x:
runs-on: ubuntu-22.04
Expand All @@ -75,5 +75,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.7.2 /bin/sh build.sh test
LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 /bin/sh build.sh test
continue-on-error: true # Tests are expected to fail, see issue #812
17 changes: 17 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,20 @@
# 1.15.0 (UNRELEASED)

- Upgrade to libgit2 v1.8.0

- Remove setuptools runtime dependency
[#1281](https://github.com/libgit2/pygit2/pull/1281)

- Coding style with ruff
[#1280](https://github.com/libgit2/pygit2/pull/1280)

- Add wheels for ppc64le
[#1279](https://github.com/libgit2/pygit2/pull/1279)

- Fix tests on EPEL8 builds for s390x
[#1283](https://github.com/libgit2/pygit2/pull/1283)


# 1.14.1 (2024-02-10)

- Update wheels to libgit2 v1.7.2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
.PHONY: build html

build:
OPENSSL_VERSION=3.1.5 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 sh build.sh
OPENSSL_VERSION=3.1.5 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 sh build.sh

html: build
make -C docs html
2 changes: 1 addition & 1 deletion appveyor.yml
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.7.2 https://github.com/libgit2/libgit2.git libgit2
git clone --depth=1 -b v1.8.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
8 changes: 4 additions & 4 deletions build.sh
Expand Up @@ -22,14 +22,14 @@
#
# sh build.sh
#
# Build libgit2 1.7.2 (will use libssh2 if available), then build pygit2
# Build libgit2 1.8.0 (will use libssh2 if available), then build pygit2
# inplace:
#
# LIBGIT2_VERSION=1.7.2 sh build.sh
# LIBGIT2_VERSION=1.8.0 sh build.sh
#
# Build libssh2 1.11.0 and libgit2 1.7.2, then build pygit2 inplace:
# Build libssh2 1.11.0 and libgit2 1.8.0, then build pygit2 inplace:
#
# LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 sh build.sh
# LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.0 sh build.sh
#
# Build inplace and run the tests:
#
Expand Down
18 changes: 10 additions & 8 deletions docs/install.rst
Expand Up @@ -57,7 +57,7 @@ Python requirements (these are specified in ``setup.py``):

- cffi 1.16.0 or later

Libgit2 **v1.7.2+**; binary wheels already include libgit2, so you only need to
Libgit2 **v1.8.x**; 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.15 | 3.9 - 3.12 | 1.8 |
+-----------+----------------+------------+
| 1.14 | 3.9 - 3.12 | 1.7 |
+-----------+----------------+------------+
| 1.13 | 3.8 - 3.12 | 1.7 |
Expand Down Expand Up @@ -141,9 +143,9 @@ directory, do:

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.2.tar.gz -O libgit2-1.7.2.tar.gz
$ tar xzf libgit2-1.7.2.tar.gz
$ cd libgit2-1.7.2/
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.8.0.tar.gz -O libgit2-1.8.0.tar.gz
$ tar xzf libgit2-1.8.0.tar.gz
$ cd libgit2-1.8.0/
$ cmake .
$ make
$ sudo make install
Expand Down Expand Up @@ -225,9 +227,9 @@ Install libgit2 (see we define the installation prefix):

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.2.tar.gz -O libgit2-1.7.2.tar.gz
$ tar xzf libgit2-1.7.2.tar.gz
$ cd libgit2-1.7.2/
$ wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.8.0.tar.gz -O libgit2-1.8.0.tar.gz
$ tar xzf libgit2-1.8.0.tar.gz
$ cd libgit2-1.8.0/
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2
$ cmake --build . --target install
Expand Down Expand Up @@ -284,7 +286,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.7.2 https://github.com/libgit2/libgit2.git
$ git clone --depth=1 -b v1.8.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
8 changes: 5 additions & 3 deletions pygit2/decl/config.h
Expand Up @@ -6,17 +6,19 @@ typedef enum {
GIT_CONFIG_LEVEL_XDG = 3,
GIT_CONFIG_LEVEL_GLOBAL = 4,
GIT_CONFIG_LEVEL_LOCAL = 5,
GIT_CONFIG_LEVEL_APP = 6,
GIT_CONFIG_HIGHEST_LEVEL = -1,
GIT_CONFIG_LEVEL_WORKTREE = 6,
GIT_CONFIG_LEVEL_APP = 7,
GIT_CONFIG_HIGHEST_LEVEL = -1
} git_config_level_t;

typedef struct git_config_entry {
const char *name;
const char *value;
const char *backend_type;
const char *origin_path;
unsigned int include_depth;
git_config_level_t level;
void (*free)(struct git_config_entry *entry);
void *payload;
} git_config_entry;

void git_config_entry_free(git_config_entry *);
Expand Down
4 changes: 3 additions & 1 deletion pygit2/decl/remote.h
Expand Up @@ -57,6 +57,7 @@ typedef struct {
git_proxy_options proxy_opts;
git_remote_redirect_t follow_redirects;
git_strarray custom_headers;
git_strarray remote_push_options;
} git_push_options;

int git_push_options_init(
Expand All @@ -80,7 +81,8 @@ typedef struct {
int version;
git_remote_callbacks callbacks;
git_fetch_prune_t prune;
int update_fetchhead;
unsigned int update_fetchhead : 1,
report_unchanged : 1;
git_remote_autotag_option_t download_tags;
git_proxy_options proxy_opts;
int depth;
Expand Down
11 changes: 7 additions & 4 deletions pygit2/enums.py
Expand Up @@ -65,16 +65,16 @@ class BlameFlag(IntFlag):
'Normal blame, the default'

TRACK_COPIES_SAME_FILE = _pygit2.GIT_BLAME_TRACK_COPIES_SAME_FILE
'Not yet implemented and reserved for future use (as of libgit2 1.7.1).'
'Not yet implemented and reserved for future use (as of libgit2 1.8.0).'

TRACK_COPIES_SAME_COMMIT_MOVES = _pygit2.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES
'Not yet implemented and reserved for future use (as of libgit2 1.7.1).'
'Not yet implemented and reserved for future use (as of libgit2 1.8.0).'

TRACK_COPIES_SAME_COMMIT_COPIES = _pygit2.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES
'Not yet implemented and reserved for future use (as of libgit2 1.7.1).'
'Not yet implemented and reserved for future use (as of libgit2 1.8.0).'

TRACK_COPIES_ANY_COMMIT_COPIES = _pygit2.GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES
'Not yet implemented and reserved for future use (as of libgit2 1.7.1).'
'Not yet implemented and reserved for future use (as of libgit2 1.8.0).'

FIRST_PARENT = _pygit2.GIT_BLAME_FIRST_PARENT
'Restrict the search of commits to those reachable following only the first parents.'
Expand Down Expand Up @@ -251,6 +251,9 @@ class ConfigLevel(IntEnum):
LOCAL = _pygit2.GIT_CONFIG_LEVEL_LOCAL
'Repository specific configuration file; $WORK_DIR/.git/config on non-bare repos'

WORKTREE = _pygit2.GIT_CONFIG_LEVEL_WORKTREE
'Worktree specific configuration file; $GIT_DIR/config.worktree'

APP = _pygit2.GIT_CONFIG_LEVEL_APP
'Application specific configuration file; freely defined by applications'

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -7,7 +7,7 @@ skip = "pp3* *musllinux_aarch64 *musllinux_ppc64le"
archs = ["auto"]
build-frontend = "default"
dependency-versions = "pinned"
environment = {LIBGIT2_VERSION="1.7.2", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.5", LIBGIT2="/project/ci"}
environment = {LIBGIT2_VERSION="1.8.0", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.5", LIBGIT2="/project/ci"}

before-all = "sh build.sh"

Expand All @@ -21,7 +21,7 @@ repair-wheel-command = "LD_LIBRARY_PATH=/project/ci/lib auditwheel repair -w {de

[tool.cibuildwheel.macos]
archs = ["universal2"]
environment = {LIBGIT2_VERSION="1.7.2", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.5", LIBGIT2="/Users/runner/work/pygit2/pygit2/ci"}
environment = {LIBGIT2_VERSION="1.8.0", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.5", LIBGIT2="/Users/runner/work/pygit2/pygit2/ci"}
repair-wheel-command = "DYLD_LIBRARY_PATH=/Users/runner/work/pygit2/pygit2/ci/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}"

[tool.ruff]
Expand Down
1 change: 1 addition & 0 deletions src/pygit2.c
Expand Up @@ -792,6 +792,7 @@ PyInit__pygit2(void)
ADD_CONSTANT_INT(m, GIT_CONFIG_LEVEL_XDG);
ADD_CONSTANT_INT(m, GIT_CONFIG_LEVEL_GLOBAL);
ADD_CONSTANT_INT(m, GIT_CONFIG_LEVEL_LOCAL);
ADD_CONSTANT_INT(m, GIT_CONFIG_LEVEL_WORKTREE);
ADD_CONSTANT_INT(m, GIT_CONFIG_LEVEL_APP);
ADD_CONSTANT_INT(m, GIT_CONFIG_HIGHEST_LEVEL);

Expand Down
4 changes: 2 additions & 2 deletions src/types.h
Expand Up @@ -33,8 +33,8 @@
#include <git2.h>
#include <git2/sys/filter.h>

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

/*
Expand Down

0 comments on commit 6d539d7

Please sign in to comment.