From 30e6d72242e376baa598b2e8f1d9b80d800a974c Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 1 Mar 2024 07:40:09 -0600 Subject: [PATCH] GH-40268: [Archery] Bump the version of pygit2, adapt to API changes (#40269) ### Rationale for this change `archery crossbow submit ...` fails with newer versions of pygit2 ### What changes are included in this PR? Adapt away from deprecated [sic] APIs in pygit2 to ones that work with current versions, bump the pin ### Are these changes tested? Manually, yes, I can use `archery crossbow submit ...` again. CI will run using archery in a bunch of places on this PR too. ### Are there any user-facing changes? No * GitHub Issue: #40268 Authored-by: Jonathan Keane Signed-off-by: Jonathan Keane --- .github/workflows/archery.yml | 2 +- .github/workflows/comment_bot.yml | 2 +- .github/workflows/dev.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/docs_light.yml | 2 +- .github/workflows/java_nightly.yml | 2 +- .github/workflows/pr_bot.yml | 2 +- .github/workflows/r_nightly.yml | 6 +++--- dev/archery/archery/crossbow/core.py | 2 +- dev/archery/archery/docker/cli.py | 2 +- dev/archery/setup.py | 6 +++++- dev/tasks/java-jars/github.yml | 2 +- dev/tasks/macros.jinja | 4 ++-- 13 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/archery.yml b/.github/workflows/archery.yml index d5f419f8a7dd8..dbd24796db52b 100644 --- a/.github/workflows/archery.yml +++ b/.github/workflows/archery.yml @@ -59,7 +59,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' - name: Install pygit2 binary wheel run: pip install pygit2 --only-binary pygit2 - name: Install Archery, Crossbow- and Test Dependencies diff --git a/.github/workflows/comment_bot.yml b/.github/workflows/comment_bot.yml index dbcbbff54953c..038a468a81276 100644 --- a/.github/workflows/comment_bot.yml +++ b/.github/workflows/comment_bot.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.8 + python-version: 3.12 - name: Install Archery and Crossbow dependencies run: pip install -e arrow/dev/archery[bot] - name: Handle GitHub comment event diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4892767324335..77efda58cb3d2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -43,7 +43,7 @@ jobs: - name: Setup Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.8 + python-version: 3.12 - name: Setup Archery run: pip install -e dev/archery[docker] - name: Execute Docker Build @@ -90,7 +90,7 @@ jobs: - name: Install Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: '3.8' + python-version: '3.12' - name: Install Ruby uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e394347e95261..82b43ee2363b5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.8 + python-version: 3.12 - name: Setup Archery run: pip install -e dev/archery[docker] - name: Execute Docker Build diff --git a/.github/workflows/docs_light.yml b/.github/workflows/docs_light.yml index 5303531f34350..306fc5135073d 100644 --- a/.github/workflows/docs_light.yml +++ b/.github/workflows/docs_light.yml @@ -59,7 +59,7 @@ jobs: - name: Setup Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.8 + python-version: 3.12 - name: Setup Archery run: pip install -e dev/archery[docker] - name: Execute Docker Build diff --git a/.github/workflows/java_nightly.yml b/.github/workflows/java_nightly.yml index c19576d2f659e..c535dc4a07de3 100644 --- a/.github/workflows/java_nightly.yml +++ b/.github/workflows/java_nightly.yml @@ -61,7 +61,7 @@ jobs: uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: cache: 'pip' - python-version: 3.8 + python-version: 3.12 - name: Install Archery shell: bash run: pip install -e arrow/dev/archery[all] diff --git a/.github/workflows/pr_bot.yml b/.github/workflows/pr_bot.yml index 31ab32800705c..6af7dbe7680f5 100644 --- a/.github/workflows/pr_bot.yml +++ b/.github/workflows/pr_bot.yml @@ -84,7 +84,7 @@ jobs: - name: Set up Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.8 + python-version: 3.12 - name: Install Archery and Crossbow dependencies run: pip install -e arrow/dev/archery[bot] - name: Handle PR workflow event diff --git a/.github/workflows/r_nightly.yml b/.github/workflows/r_nightly.yml index a57a8cddea3c0..6629b5c8a5673 100644 --- a/.github/workflows/r_nightly.yml +++ b/.github/workflows/r_nightly.yml @@ -60,10 +60,10 @@ jobs: repository: ursacomputing/crossbow ref: main - name: Set up Python - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: cache: 'pip' - python-version: 3.8 + python-version: 3.12 - name: Install Archery shell: bash run: pip install -e arrow/dev/archery[all] @@ -86,7 +86,7 @@ jobs: exit 1 fi - name: Cache Repo - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: repo key: r-nightly-${{ github.run_id }} diff --git a/dev/archery/archery/crossbow/core.py b/dev/archery/archery/crossbow/core.py index 57e91e206748d..c85f1f754b997 100644 --- a/dev/archery/archery/crossbow/core.py +++ b/dev/archery/archery/crossbow/core.py @@ -199,7 +199,7 @@ def credentials(self, url, username_from_url, allowed_types): raise CrossbowError(msg) if (allowed_types & - pygit2.credentials.GIT_CREDENTIAL_USERPASS_PLAINTEXT): + pygit2.credentials.CredentialType.USERPASS_PLAINTEXT): return pygit2.UserPass('x-oauth-basic', self.token) else: return None diff --git a/dev/archery/archery/docker/cli.py b/dev/archery/archery/docker/cli.py index 162f73ec0ffe0..20d9a16138bac 100644 --- a/dev/archery/archery/docker/cli.py +++ b/dev/archery/archery/docker/cli.py @@ -215,7 +215,7 @@ def docker_run(obj, image, command, *, env, user, force_pull, force_build, archery docker run --no-cache conda-python # pass a docker-compose parameter, like the python version - PYTHON=3.8 archery docker run conda-python + PYTHON=3.12 archery docker run conda-python # disable the cache only for the leaf image PANDAS=upstream_devel archery docker run --no-leaf-cache \ diff --git a/dev/archery/setup.py b/dev/archery/setup.py index 2ecc72e04e8aa..23a1600910d04 100755 --- a/dev/archery/setup.py +++ b/dev/archery/setup.py @@ -21,6 +21,10 @@ import sys from setuptools import setup, find_packages +# pygit2>=1.14.0 requires python 3.9, so crossbow and all +# both technically require python 3.9 — however we still need to +# support 3.8 when using docker. When 3.8 is EOLed and we bump +# to Python 3.9 this will resolve itself. if sys.version_info < (3, 8): sys.exit('Python < 3.8 is not supported') @@ -29,7 +33,7 @@ extras = { 'benchmark': ['pandas'], - 'crossbow': ['github3.py', jinja_req, 'pygit2>=1.6.0', 'requests', + 'crossbow': ['github3.py', jinja_req, 'pygit2>=1.14.0', 'requests', 'ruamel.yaml', 'setuptools_scm<8.0.0'], 'crossbow-upload': ['github3.py', jinja_req, 'ruamel.yaml', 'setuptools_scm'], diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml index 086d1fdbe811f..8fe5878254dde 100644 --- a/dev/tasks/java-jars/github.yml +++ b/dev/tasks/java-jars/github.yml @@ -90,7 +90,7 @@ jobs: uses: actions/setup-python@v4 with: cache: 'pip' - python-version: 3.8 + python-version: 3.12 - name: Install Archery shell: bash run: pip install -e arrow/dev/archery[all] diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index 8ba95af46af56..a190eea459c56 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -59,7 +59,7 @@ on: uses: actions/setup-python@v4 with: cache: 'pip' - python-version: 3.8 + python-version: 3.12 - name: Set up Python by apt if: runner.os == 'Linux' && runner.arch != 'X64' run: | @@ -85,7 +85,7 @@ on: if: runner.arch == 'X64' uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.12 - name: Set up Python by apt if: runner.os == 'Linux' && runner.arch != 'X64' run: |