Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ jobs:
fail-fast: false
matrix:
# keep in sync with tox.ini [gh-actions] section
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
os: ["ubuntu-latest"]
os-label: ["Ubuntu"]
include:
- {python-version: "3.9", os: "windows-latest", os-label: "Windows"}
- {python-version: "3.9", os: "macos-latest", os-label: "macOS"}
- {python-version: "3.10", os: "windows-latest", os-label: "Windows"}
- {python-version: "3.10", os: "macos-latest", os-label: "macOS"}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]
args: ["--py310-plus"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
Expand Down
3 changes: 2 additions & 1 deletion github/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
import base64
import time
from abc import ABC
from collections.abc import Callable
from datetime import datetime, timedelta, timezone
from typing import TYPE_CHECKING, Callable, Union
from typing import TYPE_CHECKING, Union

import jwt
from requests import utils
Expand Down
5 changes: 3 additions & 2 deletions github/GithubObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@
import re
import typing
from abc import ABC
from collections.abc import Callable
from datetime import datetime, timezone
from decimal import Decimal
from operator import itemgetter
from typing import TYPE_CHECKING, Any, Callable, Union, overload
from typing import TYPE_CHECKING, Any, TypeGuard, Union, overload

from typing_extensions import ParamSpec, Protocol, Self, TypeGuard, TypeVar
from typing_extensions import ParamSpec, Protocol, Self, TypeVar

from . import Consts
from .GithubException import BadAttributeException, IncompletableObject
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Software Development",
]
description = "Use the full Github API v3"
keywords = ["github"]
name = "PyGithub"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"

dynamic = ["version"]

Expand Down
5 changes: 2 additions & 3 deletions scripts/prepare-for-update-assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import argparse
import difflib
import sys
from typing import Union

import libcst as cst
from libcst import SimpleWhitespace
Expand Down Expand Up @@ -52,7 +51,7 @@ def leave_Call(self, original_node: cst.Call, updated_node: cst.Call) -> cst.Bas

def leave_Arg(
self, original_node: cst.Arg, updated_node: cst.Arg
) -> Union[cst.Arg, cst.FlattenSentinel[cst.Arg], cst.RemovalSentinel]:
) -> cst.Arg | cst.FlattenSentinel[cst.Arg] | cst.RemovalSentinel:
if self.in_function:
return updated_node.with_changes(
whitespace_after_star=SimpleWhitespace(""), whitespace_after_arg=SimpleWhitespace("")
Expand Down Expand Up @@ -97,7 +96,7 @@ def leave_RightSquareBracket(
return updated_node.with_changes(whitespace_before=SimpleWhitespace(""))
return updated_node

def leave_Comma(self, original_node: cst.Comma, updated_node: cst.Comma) -> Union[cst.Comma, cst.MaybeSentinel]:
def leave_Comma(self, original_node: cst.Comma, updated_node: cst.Comma) -> cst.Comma | cst.MaybeSentinel:
if self.in_function:
return updated_node.with_changes(
whitespace_before=SimpleWhitespace(""), whitespace_after=SimpleWhitespace(" ")
Expand Down
4 changes: 2 additions & 2 deletions tests/Framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
import traceback
import unittest
import warnings
from collections.abc import Generator
from collections.abc import Callable, Generator
from dataclasses import dataclass
from io import BytesIO
from typing import Any, Callable
from typing import Any

import responses
from requests.structures import CaseInsensitiveDict
Expand Down
2 changes: 1 addition & 1 deletion tests/GithubRetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def response():

@contextlib.contextmanager
def mock_retry_now(self, now):
if sys.version_info[0] > 3 or sys.version_info[0] == 3 and sys.version_info[1] >= 11:
if sys.version_info >= (3, 11):
attr = "github.GithubRetry.GithubRetry._GithubRetry__datetime"
else:
attr = "github.GithubRetry._GithubRetry__datetime"
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[tox]
envlist =
lint,
py{39,310,311,312,313,314},
py{310-315},
docs

[gh-actions]
# this make sure each ci job only run tests once.
# keey it sync with workflows/ci.yaml matrix
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
3.14: py314
3.15: py315

[testenv]
deps = -rrequirements/test.txt
Expand Down
Loading