Skip to content

Commit

Permalink
Store version as constant to avoid blocking IO (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
slovdahl authored Jun 18, 2024
1 parent dce388f commit 0f76e2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spothinta_api/spothinta.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
if TYPE_CHECKING:
from typing_extensions import Self

VERSION = metadata.version(__package__)


@dataclass
class SpotHinta:
Expand Down Expand Up @@ -65,8 +67,6 @@ async def _request(
the API.
"""
version = metadata.version(__package__)

url = URL.build(
scheme="https",
host=API_HOST,
Expand All @@ -75,7 +75,7 @@ async def _request(

headers = {
"Accept": "application/json",
"User-Agent": f"PythonSpotHinta/{version}",
"User-Agent": f"PythonSpotHinta/{VERSION}",
}

if self.session is None:
Expand Down

0 comments on commit 0f76e2e

Please sign in to comment.