Skip to content
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
7 changes: 5 additions & 2 deletions leakix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from leakix.client import __VERSION__ as __VERSION__
from importlib.metadata import version

from leakix.client import Client as Client
from leakix.client import HostResult as HostResult
from leakix.client import Scope as Scope
Expand Down Expand Up @@ -68,8 +69,10 @@
SuccessResponse as SuccessResponse,
)

__version__ = version("leakix")

__all__ = [
"__VERSION__",
"__version__",
"Client",
"HostResult",
"Scope",
Expand Down
5 changes: 2 additions & 3 deletions leakix/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from enum import Enum
from importlib.metadata import version

import requests
from l9format import l9format
Expand All @@ -10,8 +11,6 @@
from leakix.query import EmptyQuery, Query
from leakix.response import ErrorResponse, RateLimitResponse, SuccessResponse

__VERSION__ = "0.1.9"


class Scope(Enum):
SERVICE = "service"
Expand All @@ -38,7 +37,7 @@ def __init__(
self.base_url = base_url if base_url else DEFAULT_URL
self.headers = {
"Accept": "application/json",
"User-agent": f"leakix-client-python/{__VERSION__}",
"User-agent": f"leakix-client-python/{version('leakix')}",
}
if api_key:
self.headers["api-key"] = api_key
Expand Down