Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI, including Python 3.12 support #2353

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ steps:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
connection:
- "urllib3"
- "requests"
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ jobs:
with:
python-version: "3.11"
- name: Install dependencies
run: |
python3 -m pip install nox
run: python3 -m pip install nox
- name: Lint the code
run: nox -s lint

test-linux:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
nox-session: [""]
runs-on: ["ubuntu-latest"]

Expand All @@ -38,18 +37,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install nox
run: python -m pip install nox
- name: Run Tests
shell: bash
run: .ci/run-nox.sh
env:
PYTHON_VERSION: ${{ matrix.python-version }}
NOX_SESSION: ${{ matrix.nox-session }}
# TEMPORARY for 3.11
# https://github.com/aio-libs/aiohttp/issues/6600
AIOHTTP_NO_EXTENSIONS: 1
# https://github.com/aio-libs/frozenlist/issues/285
FROZENLIST_NO_EXTENSIONS: 1
# https://github.com/aio-libs/yarl/issues/680
YARL_NO_EXTENSIONS: 1
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
# To work around https://github.com/aio-libs/aiohttp/issues/7675, we need
# to set AIOHTTP_NO_EXTENSIONS to 1 but it has to be done in
# https://readthedocs.org/dashboard/elasticsearch-py/environmentvariables/
# because of https://github.com/readthedocs/readthedocs.org/issues/6311
python: "3.12"

python:
install:
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ protobuf<4; python_version<="3.7"
# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5)
sphinx>2
sphinx-rtd-theme>0.5
sphinx-autodoc-typehints
sphinx-autodoc-typehints
10 changes: 6 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
"test_elasticsearch/",
"utils/",
)
# Allow building aiohttp when no wheels are available (eg. for recent Python versions)
INSTALL_ENV = {"AIOHTTP_NO_EXTENSIONS": "1"}


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"])
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
def test(session):
session.install(".")
session.install("-r", "dev-requirements.txt")
session.install(".[async,requests]", env=INSTALL_ENV, silent=False)
session.install("-r", "dev-requirements.txt", silent=False)

python_version = tuple(int(x) for x in session.python.split("."))
junit_xml = os.path.join(SOURCE_DIR, "junit", "elasticsearch-py-junit.xml")
Expand Down Expand Up @@ -77,7 +79,7 @@ def lint(session):
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)

# Workaround to make '-r' to still work despite uninstalling aiohttp below.
session.install(".[async,requests]")
session.install(".[async,requests]", env=INSTALL_ENV)

# Run mypy on the package and then the type examples separately for
# the two different mypy use-cases, ourselves and our users.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
python_requires=">=3.6, <4",
python_requires=">=3.6",
install_requires=install_requires,
extras_require={
"requests": ["requests>=2.4.0, <3.0.0"],
Expand Down