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

Make all type annotations lazy #386

Merged
merged 1 commit into from
Nov 20, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions nats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import List, Union

from .aio.client import Client as NATS
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import base64
import ipaddress
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import nats.errors


Expand Down
2 changes: 2 additions & 0 deletions nats/aio/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

import datetime
import json
from dataclasses import dataclass
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
from typing import (
TYPE_CHECKING,
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/transport.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import abc
import asyncio
import ssl
Expand Down
2 changes: 2 additions & 0 deletions nats/js/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from . import api
from .client import JetStreamContext
from .manager import JetStreamManager
Expand Down
2 changes: 2 additions & 0 deletions nats/js/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from dataclasses import dataclass, fields, replace
from enum import Enum
from typing import Any, Dict, List, Optional, Type, TypeVar
Expand Down
2 changes: 2 additions & 0 deletions nats/js/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import json
import time
Expand Down
2 changes: 2 additions & 0 deletions nats/js/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, NoReturn, Optional

Expand Down
2 changes: 2 additions & 0 deletions nats/js/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import datetime
from dataclasses import dataclass
Expand Down
2 changes: 2 additions & 0 deletions nats/js/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import base64
import json
from email.parser import BytesParser
Expand Down
2 changes: 2 additions & 0 deletions nats/nuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from random import Random
from secrets import randbelow, token_bytes
from sys import maxsize as MaxInt
Expand Down
2 changes: 2 additions & 0 deletions nats/protocol/command.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Callable

PUB_OP = 'PUB'
Expand Down
2 changes: 2 additions & 0 deletions nats/protocol/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
NATS network protocol parser.
"""

from __future__ import annotations

import json
import re
from typing import Any, Dict
Expand Down