FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge remote-tracking branch 'upstream' · gitpython-developers/GitPython@70db935 · GitHub

Repository navigation

Commit 70db935

Browse files
Henrique Moreira
committed
Merge remote-tracking branch 'upstream'
2 parents 75fe219 + 1e98250 commit 70db935

128 files changed

Lines changed: 9886 additions & 4484 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.flake8‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.github/workflows/alpine-test.yml‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: test-alpine
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
container:
13+
image: alpine:latest
14+
15+
defaults:
16+
run:
17+
shell: sudo -u runner sh -exo pipefail {0}
18+
19+
steps:
20+
- name: Prepare Alpine Linux
21+
run: |
22+
apk add sudo git git-daemon python3 py3-pip py3-virtualenv
23+
echo 'Defaults env_keep += "CI GITHUB_* RUNNER_*"' >/etc/sudoers.d/ci_env
24+
addgroup -g 127 docker
25+
adduser -D -u 1001 runner # TODO: Check if this still works on GHA as intended.
26+
adduser runner docker
27+
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.
28+
29+
- uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Set workspace ownership
34+
run: |
35+
chown -R runner:docker -- "$GITHUB_WORKSPACE"
36+
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.
37+
38+
- name: Prepare this repo for tests
39+
run: |
40+
./init-tests-after-clone.sh
41+
42+
- name: Set git user identity and command aliases for the tests
43+
run: |
44+
git config --global user.email "travis@ci.com"
45+
git config --global user.name "Travis Runner"
46+
# If we rewrite the user's config by accident, we will mess it up
47+
# and cause subsequent tests to fail
48+
cat test/fixtures/.gitconfig >> ~/.gitconfig
49+
50+
- name: Set up virtual environment
51+
run: |
52+
python -m venv .venv
53+
54+
- name: Update PyPA packages
55+
run: |
56+
. .venv/bin/activate
57+
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
58+
59+
- name: Install project and test dependencies
60+
run: |
61+
. .venv/bin/activate
62+
pip install '.[test]'
63+
64+
- name: Show version and platform information
65+
run: |
66+
. .venv/bin/activate
67+
uname -a
68+
command -v git python
69+
git version
70+
python --version
71+
python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")'
72+
73+
- name: Test with pytest
74+
run: |
75+
. .venv/bin/activate
76+
pytest --color=yes -p no:sugar --instafail -vv

‎.github/workflows/codeql.yml‎

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,72 @@ on:
1919

2020
jobs:
2121
analyze:
22-
name: Analyze
22+
name: Analyze (${{ matrix.language }})
2323
# Runner size impacts CodeQL analysis time. To learn more, please see:
2424
# - https://gh.io/recommended-hardware-resources-for-running-codeql
2525
# - https://gh.io/supported-runners-and-hardware-resources
26-
# - https://gh.io/using-larger-runners
27-
# Consider using larger runners for possible analysis time improvements.
26+
# - https://gh.io/using-larger-runners (GitHub.com only)
27+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
2828
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
29-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
3029
permissions:
31-
actions: read
32-
contents: read
3330
security-events: write
3431

3532
strategy:
3633
fail-fast: false
3734
matrix:
38-
language: [ 'python' ]
39-
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
40-
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
41-
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
42-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
43-
35+
include:
36+
- language: actions
37+
build-mode: none
38+
- language: python
39+
build-mode: none
40+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
41+
# Use `c-cpp` to analyze code written in C, C++ or both
42+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
43+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
44+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
45+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
46+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
47+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4448
steps:
4549
- name: Checkout repository
46-
uses: actions/checkout@v4
50+
uses: actions/checkout@v6
51+
52+
# Add any setup steps before running the `github/codeql-action/init` action.
53+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
54+
# or others). This is typically only required for manual builds.
55+
# - name: Setup runtime (example)
56+
# uses: actions/setup-example@v1
4757

4858
# Initializes the CodeQL tools for scanning.
4959
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v2
60+
uses: github/codeql-action/init@v4
5161
with:
5262
languages: ${{ matrix.language }}
53-
setup-python-dependencies: false
63+
build-mode: ${{ matrix.build-mode }}
5464
# If you wish to specify custom queries, you can do so here or in a config file.
5565
# By default, queries listed here will override any specified in a config file.
5666
# Prefix the list here with "+" to use these queries and those in the config file.
5767

5868
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5969
# queries: security-extended,security-and-quality
6070

61-
62-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
63-
# If this step fails, then you should remove it and run the build manually (see below)
64-
- name: Autobuild
65-
uses: github/codeql-action/autobuild@v2
66-
71+
# If the analyze step fails for one of the languages you are analyzing with
72+
# "We were unable to automatically build your code", modify the matrix above
73+
# to set the build mode to "manual" for that language. Then modify this step
74+
# to build your code.
6775
# ℹ️ Command-line programs to run using the OS shell.
6876
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
69-
70-
# If the Autobuild fails above, remove it and uncomment the following three lines.
71-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
72-
73-
# - run: |
74-
# echo "Run, Build Application using script"
75-
# ./location_of_script_within_repo/buildscript.sh
77+
- if: matrix.build-mode == 'manual'
78+
shell: bash
79+
run: |
80+
echo 'If you are using a "manual" build mode for one or more of the' \
81+
'languages you are analyzing, replace this with the commands to build' \
82+
'your code, for example:'
83+
echo ' make bootstrap'
84+
echo ' make release'
85+
exit 1
7686
7787
- name: Perform CodeQL Analysis
78-
uses: github/codeql-action/analyze@v2
88+
uses: github/codeql-action/analyze@v4
7989
with:
8090
category: "/language:${{matrix.language}}"

‎.github/workflows/cygwin-test.yml‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ name: test-cygwin
22

33
on: [push, pull_request, workflow_dispatch]
44

5-
jobs:
6-
build:
7-
runs-on: windows-latest
5+
permissions:
6+
contents: read
87

8+
jobs:
9+
test:
910
strategy:
11+
matrix:
12+
selection: [fast, perf]
13+
include:
14+
- selection: fast
15+
additional-pytest-args: --ignore=test/performance
16+
- selection: perf
17+
additional-pytest-args: test/performance
18+
1019
fail-fast: false
1120

21+
runs-on: windows-latest
22+
1223
env:
1324
CHERE_INVOKING: "1"
1425
CYGWIN_NOWINPATH: "1"
@@ -21,16 +32,16 @@ jobs:
2132
- name: Force LF line endings
2233
run: |
2334
git config --global core.autocrlf false # Affects the non-Cygwin git.
24-
shell: bash # Use Git Bash instead of Cygwin Bash for this step.
35+
shell: pwsh # Do this outside Cygwin, to affect actions/checkout.
2536

26-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v6
2738
with:
2839
fetch-depth: 0
2940

3041
- name: Install Cygwin
31-
uses: cygwin/cygwin-install-action@v4
42+
uses: cygwin/cygwin-install-action@v6
3243
with:
33-
packages: python39 python39-pip python39-virtualenv git
44+
packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel
3445
add-to-path: false # No need to change $PATH outside the Cygwin environment.
3546

3647
- name: Arrange for verbose output
@@ -41,6 +52,7 @@ jobs:
4152
- name: Special configuration for Cygwin git
4253
run: |
4354
git config --global --add safe.directory "$(pwd)"
55+
git config --global --add safe.directory "$(pwd)/.git"
4456
git config --global core.autocrlf false
4557
4658
- name: Prepare this repo for tests
@@ -55,14 +67,18 @@ jobs:
5567
# and cause subsequent tests to fail
5668
cat test/fixtures/.gitconfig >> ~/.gitconfig
5769
70+
- name: Set up virtual environment
71+
run: |
72+
python3.9 -m venv .venv
73+
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
74+
5875
- name: Update PyPA packages
5976
run: |
60-
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
61-
python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel
77+
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
6278
6379
- name: Install project and test dependencies
6480
run: |
65-
pip install ".[test]"
81+
pip install '.[test]'
6682
6783
- name: Show version and platform information
6884
run: |
@@ -72,6 +88,6 @@ jobs:
7288
python --version
7389
python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")'
7490
75-
- name: Test with pytest
91+
- name: Test with pytest (${{ matrix.additional-pytest-args }})
7692
run: |
77-
pytest --color=yes -p no:sugar --instafail -vv
93+
pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }}

‎.github/workflows/lint.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ name: Lint
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
lint:
710
runs-on: ubuntu-latest
811

912
steps:
10-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v6
1114

12-
- uses: actions/setup-python@v5
15+
- uses: actions/setup-python@v6
1316
with:
1417
python-version: "3.x"
1518

16-
- uses: pre-commit/action@v3.0.0
17-
with:
18-
extra_args: --all-files --hook-stage manual
19-
env:
20-
SKIP: black-format
19+
- uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL