Skip to content

Commit

Permalink
GH-40268: [Archery] Bump the version of pygit2, adapt to API changes (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Signed-off-by: Jonathan Keane <[email protected]>
  • Loading branch information
jonkeane authored Mar 1, 2024
1 parent 7c4f4c2 commit 30e6d72
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/archery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/comment_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/r_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand 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 }}
Expand Down
2 changes: 1 addition & 1 deletion dev/archery/archery/crossbow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev/archery/archery/docker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 5 additions & 1 deletion dev/archery/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/java-jars/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions dev/tasks/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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: |
Expand Down

0 comments on commit 30e6d72

Please sign in to comment.