-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #2367
Fix CI #2367
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,45 +12,24 @@ jobs: | |
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install nox | ||
- name: Lint the code | ||
run: nox -s lint | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install nox | ||
- name: Build the docs | ||
run: nox -s docs | ||
|
||
test-linux: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
experimental: [false] | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python 3.11 is stable now. I don't believe having a failing check is helpful in any way, so I'm also removing the |
||
nox-session: [""] | ||
runs-on: ["ubuntu-latest"] | ||
include: | ||
- python-version: 3.11-dev | ||
experimental: true | ||
nox-session: test-3.11 | ||
runs-on: "ubuntu-latest" | ||
|
||
runs-on: ${{ matrix.runs-on }} | ||
name: test-${{ matrix.python-version }} | ||
continue-on-error: ${{ matrix.experimental }} | ||
continue-on-error: false | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ version: 2 | |
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3" | ||
python: "3.11" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python 3.12 breaks Read the Docs. I'll fix this in a follow-up PR. |
||
|
||
python: | ||
install: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,14 @@ twine | |
build | ||
nox | ||
|
||
# No wheels for Python 3.10 yet! | ||
numpy; python_version<"3.10" | ||
pandas; python_version<"3.10" | ||
numpy | ||
pandas | ||
Comment on lines
-18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those projects have recent wheels, including Python 3.12 wheels. |
||
|
||
# Testing the 'search_mvt' API response | ||
mapbox-vector-tile; python_version<"3.10" | ||
mapbox-vector-tile | ||
# Python 3.7 gets an old version of mapbox-vector-tile, requiring an | ||
# old version of protobuf | ||
protobuf<4; python_version<="3.7" | ||
|
||
# Docs | ||
# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ ignore = E203, E266, E501, W503 | |
|
||
[tool:pytest] | ||
junit_family=legacy | ||
addopts = -vvv -p no:logging --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
addopts = -vvv --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc | ||
|
||
[tool:isort] | ||
profile=black | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
# under the License. | ||
|
||
import asyncio | ||
import logging | ||
from datetime import datetime, timedelta, timezone | ||
from unittest.mock import MagicMock, call, patch | ||
|
||
|
@@ -619,8 +620,10 @@ async def test_no_scroll_id_fast_route(self, async_client, scan_teardown): | |
scroll_mock.assert_not_called() | ||
clear_mock.assert_not_called() | ||
|
||
@patch("elasticsearch._async.helpers.logger") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
async def test_logger(self, logger_mock, async_client, scan_teardown): | ||
async def test_logger( | ||
self, caplog: pytest.LogCaptureFixture, async_client, scan_teardown | ||
): | ||
caplog.set_level(logging.WARNING, logger="elasticsearch.helpers") | ||
bulk = [] | ||
for x in range(4): | ||
bulk.append({"index": {"_index": "test_index"}}) | ||
|
@@ -640,12 +643,16 @@ async def test_logger(self, logger_mock, async_client, scan_teardown): | |
clear_scroll=False, | ||
) | ||
] | ||
logger_mock.warning.assert_called() | ||
|
||
assert caplog.messages == [ | ||
"Scroll request has only succeeded on 4 (+0 skipped) shards out of 5." | ||
] | ||
|
||
caplog.clear() | ||
with patch.object( | ||
async_client, "options", return_value=async_client | ||
), patch.object(async_client, "scroll", MockScroll()): | ||
try: | ||
with pytest.raises(ScanError): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a drive-by change: in addition to not failing when |
||
_ = [ | ||
x | ||
async for x in helpers.async_scan( | ||
|
@@ -656,14 +663,10 @@ async def test_logger(self, logger_mock, async_client, scan_teardown): | |
clear_scroll=False, | ||
) | ||
] | ||
except ScanError: | ||
pass | ||
logger_mock.warning.assert_called_with( | ||
"Scroll request has only succeeded on %d (+%d skipped) shards out of %d.", | ||
4, | ||
0, | ||
5, | ||
) | ||
|
||
assert caplog.messages == [ | ||
"Scroll request has only succeeded on 4 (+0 skipped) shards out of 5." | ||
] | ||
|
||
async def test_clear_scroll(self, async_client, scan_teardown): | ||
bulk = [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub defaults to 3.x to 3.12, which breaks this check, and since the Read the Docs check has been working well, I'm just removing this one.