Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
fix: change version retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Oct 15, 2020
1 parent b186beb commit cdefe37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ zip_safe = True
install_requires =
depinfo
httpx
importlib_metadata; python_version <'3.8'
ordered-set
pydantic
python-dotenv
Expand Down
10 changes: 7 additions & 3 deletions src/structurizr/api/structurizr_client_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
from pathlib import Path
from socket import getfqdn

from pydantic import UUID4, BaseSettings, DirectoryPath, Field, HttpUrl

from .. import __version__
try:
from importlib.metadata import version
except ModuleNotFoundError:
from importlib_metadata import version

from pydantic import UUID4, BaseSettings, DirectoryPath, Field, HttpUrl


__all__ = ("StructurizrClientSettings",)
Expand All @@ -44,7 +48,7 @@
if hostname:
USER = f"{USER}@{hostname}"

AGENT = f"structurizr-python/{__version__}"
AGENT = f"structurizr-python/{version('structurizr-python')}"


class StructurizrClientSettings(BaseSettings):
Expand Down

0 comments on commit cdefe37

Please sign in to comment.