Skip to content

Fix CI #101

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

Merged
merged 5 commits into from
May 9, 2023
Merged
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
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
os: ["ubuntu-latest"]
experimental: [false]
include:
- python-version: "3.6"
experimental: false
os: ubuntu-20.04

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
name: test-${{ matrix.python-version }}
continue-on-error: ${{ matrix.experimental }}
steps:
Expand All @@ -54,11 +59,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Python 3.7 to run nox
if: matrix.python-version != '3.7'
- name: Set up Python 3.x to run nox
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.x

- name: Install Dependencies
run: python -m pip install --upgrade nox
Expand All @@ -67,10 +71,7 @@ jobs:
run: "nox -rs test-${PYTHON_VERSION%-dev}"
env:
PYTHON_VERSION: ${{ matrix.python-version }}
# TEMPORARY for 3.11
# https://github.com/aio-libs/aiohttp/issues/6600
# Required for development versions of Python
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
1 change: 0 additions & 1 deletion elastic_transport/_async_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ async def perform_request( # type: ignore[override,return]
errors: List[Exception] = []

for attempt in range(max_retries + 1):

# If we sniff before requests are made we want to do so before
# 'node_pool.get()' is called so our sniffed nodes show up in the pool.
if self._sniff_before_requests:
Expand Down
2 changes: 0 additions & 2 deletions elastic_transport/_node/_http_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def init_poolmanager(
block: bool = False,
**pool_kwargs: Any,
) -> None:

if self._node_config.scheme == "https":
ssl_context = ssl_context_from_node_config(self._node_config)
pool_kwargs.setdefault("ssl_context", ssl_context)
Expand All @@ -71,7 +70,6 @@ def init_poolmanager(
# about the fingerprint of the certificates, not whether they form
# a verified chain to a trust anchor.
if self._node_config.ssl_assert_fingerprint:

# Manually disable these in the right order on the SSLContext
# so urllib3 won't think we want conflicting things.
ssl_context.check_hostname = False
Expand Down
2 changes: 0 additions & 2 deletions elastic_transport/_node/_http_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def __init__(self, config: NodeConfig):
# about the fingerprint of the certificates, not whether they form
# a verified chain to a trust anchor.
elif config.ssl_assert_fingerprint:

# Manually disable these in the right order on the SSLContext
# so urllib3 won't think we want conflicting things.
ssl_context.check_hostname = False
Expand Down Expand Up @@ -137,7 +136,6 @@ def perform_request(
headers: Optional[HttpHeaders] = None,
request_timeout: Union[DefaultType, Optional[float]] = DEFAULT,
) -> NodeApiResponse:

if self.path_prefix:
target = f"{self.path_prefix}{target}"

Expand Down
1 change: 0 additions & 1 deletion elastic_transport/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ def perform_request( # type: ignore[return]
errors: List[Exception] = []

for attempt in range(max_retries + 1):

# If we sniff before requests are made we want to do so before
# 'node_pool.get()' is called so our sniffed nodes show up in the pool.
if self._sniff_before_requests:
Expand Down
2 changes: 1 addition & 1 deletion elastic_transport/client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def url_to_node_config(

# Only fill in a default port for HTTP and HTTPS
# when we know the scheme is one of those two.
parsed_port: Optional[int] = parsed_url.port # type: ignore[assignment]
parsed_port: Optional[int] = parsed_url.port
if (
parsed_url.port is None
and parsed_url.scheme is not None
Expand Down
12 changes: 9 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

@nox.session()
def format(session):
session.install("black", "isort", "pyupgrade")
session.install("black~=23.0", "isort", "pyupgrade")
session.run("black", "--target-version=py36", *SOURCE_FILES)
session.run("isort", *SOURCE_FILES)
session.run("python", "utils/license-headers.py", "fix", *SOURCE_FILES)
Expand All @@ -40,7 +40,13 @@ def format(session):
@nox.session
def lint(session):
session.install(
"flake8", "black", "isort", "mypy", "types-requests", "types-certifi"
"flake8",
"black~=23.0",
"isort",
"mypy==1.0.1",
"types-urllib3",
"types-requests",
"types-certifi",
)
session.install(".[develop]")
session.run("black", "--check", "--target-version=py36", *SOURCE_FILES)
Expand All @@ -50,7 +56,7 @@ def lint(session):
session.run("mypy", "--strict", "--show-error-codes", "elastic_transport/")


@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(".[develop]")
session.run(
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"Programming Language :: Python :: 3.8",
"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",
],
Expand Down