Skip to content

Commit

Permalink
fix: determine version for user-agent only once
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jul 1, 2024
1 parent 41b60a9 commit 09f1ed0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions here_transit/here_transit.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
API_VERSION = "/v8"
ROUTES_PATH = "routes"

LIB_VERSION = metadata.version(__package__)


class HERETransitApi:
"""Main class for handling connections with the HERE Transit API v8."""
Expand Down Expand Up @@ -60,8 +62,7 @@ def __init__(
self.user_agent = user_agent

if user_agent is None:
version = metadata.version(__package__)
self.user_agent = f"here_transit/{version}"
self.user_agent = f"here_transit/{LIB_VERSION}"

async def request(
self,
Expand Down

0 comments on commit 09f1ed0

Please sign in to comment.