Skip to content

Commit 003d70f

Browse files
committed
✨ update Twine in CI
1 parent 0033064 commit 003d70f

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
with:
211211
name: artifact
212212
- name: Install Twine
213-
run: pip install "twine==4.*"
213+
run: pip install "twine==5.*"
214214
- name: Run Twine
215215
run: |
216216
twine check --strict *.tar.gz *.whl

an_website/backdoor_client.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import ast
2121
import asyncio
22-
import contextlib
2322
import http.client
2423
import io
2524
import os
@@ -33,13 +32,14 @@
3332
import uuid
3433
from base64 import b64encode
3534
from collections.abc import Callable, Iterable, MutableMapping
35+
from contextlib import suppress
3636
from importlib import import_module
3737
from textwrap import dedent
3838
from types import EllipsisType
3939
from typing import Any, Required, TypeAlias, TypedDict, cast
4040
from urllib.parse import SplitResult, quote, quote_plus, urlsplit
4141

42-
with contextlib.suppress(ModuleNotFoundError):
42+
with suppress(ModuleNotFoundError):
4343
# pylint: disable=shadowed-import
4444
import dill as pickle # type: ignore[import-untyped, no-redef] # noqa: F811, B950 # nosec: B403
4545

@@ -58,19 +58,18 @@
5858
except ModuleNotFoundError:
5959
socks = None # pylint: disable=invalid-name
6060

61-
if "DISABLE_UVLOOP" not in os.environ:
62-
with contextlib.suppress(ModuleNotFoundError):
61+
if os.environ.get("DISABLE_UVLOOP") not in {"y", "yes", "t", "true", "on", "1"}:
62+
with suppress(ModuleNotFoundError):
6363
asyncio.set_event_loop_policy(import_module("uvloop").EventLoopPolicy())
6464

65-
66-
FLUFL = True
67-
6865
E = eval( # pylint: disable=eval-used # nosec: B307
6966
"eval(repr((_:=[],_.append(_))[0]))[0][0]"
7067
)
7168

7269
ErrorTuple: TypeAlias = tuple[int, str]
7370

71+
FLUFL = True
72+
7473

7574
class Response(TypedDict): # noqa: D101
7675
# pylint: disable=missing-class-docstring
@@ -180,7 +179,7 @@ async def request( # noqa: C901
180179
if "Host" not in header_names:
181180
host: None | str = None
182181
if idna: # type: ignore[truthy-bool]
183-
with contextlib.suppress(idna.core.InvalidCodepoint):
182+
with suppress(idna.core.InvalidCodepoint):
184183
host = idna.encode(url.hostname).decode("ASCII")
185184
host = f"{host}:{url.port}" if url.port else host
186185
if not host:
@@ -684,7 +683,7 @@ def _run_and_print( # type: ignore[no-any-unimported]
684683
ReaderConsole.execute = _run_and_print
685684

686685
# run the reader
687-
with contextlib.suppress(EOFError):
686+
with suppress(EOFError):
688687
_main(print_banner=False, clear_main=False)
689688

690689
# restore the original method

an_website/patches/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def apply() -> None:
7676

7777
def patch_asyncio() -> None:
7878
"""Make stuff faster."""
79-
if "DISABLE_UVLOOP" not in os.environ:
79+
if os.environ.get("DISABLE_UVLOOP") not in {
80+
"y", "yes", "t", "true", "on", "1" # fmt: skip
81+
}:
8082
with suppress(ModuleNotFoundError):
8183
asyncio.set_event_loop_policy(
8284
import_module("uvloop").EventLoopPolicy()

0 commit comments

Comments
 (0)