diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ff1c6069..c8cf2e5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 182fbc4e..3d1b19a4 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/Makefile b/Makefile index 3c6c0287..d4c05c84 100644 --- a/Makefile +++ b/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 diff --git a/appveyor.yml b/appveyor.yml index d9c9f73d..70e5afda 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/build.sh b/build.sh index 7c91b38b..a46ccd88 100644 --- a/build.sh +++ b/build.sh @@ -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: # diff --git a/docs/install.rst b/docs/install.rst index d42967a7..bc57b3ea 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -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: @@ -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 | @@ -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 @@ -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 @@ -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 diff --git a/pygit2/decl/config.h b/pygit2/decl/config.h index 51baefc8..5cba6f7f 100644 --- a/pygit2/decl/config.h +++ b/pygit2/decl/config.h @@ -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 *); diff --git a/pygit2/decl/remote.h b/pygit2/decl/remote.h index 0dfde71a..6a4ee90b 100644 --- a/pygit2/decl/remote.h +++ b/pygit2/decl/remote.h @@ -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( @@ -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; diff --git a/pygit2/enums.py b/pygit2/enums.py index 6170417f..2f64a6a7 100644 --- a/pygit2/enums.py +++ b/pygit2/enums.py @@ -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.' @@ -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' diff --git a/pyproject.toml b/pyproject.toml index 170e2d3c..9c07128e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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] diff --git a/src/pygit2.c b/src/pygit2.c index 3aa95e63..b69e424f 100644 --- a/src/pygit2.c +++ b/src/pygit2.c @@ -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); diff --git a/src/types.h b/src/types.h index 2fd16bdb..c70c7eb7 100644 --- a/src/types.h +++ b/src/types.h @@ -33,8 +33,8 @@ #include #include -#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 /*