Skip to content

Commit

Permalink
Removing version.py in favor of git versioning (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnasbr authored Jul 26, 2024
1 parent c378ce0 commit 13b2add
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -49,8 +49,7 @@ zip-safe = false
include-package-data = true
packages = { find = {} }

[tool.setuptools.dynamic]
version = { attr = "traveltimepy.version.__version__" }
[tool.setuptools_scm]

[tool.flake8]
per-file-ignores = ["**/__init__.py:F401"]
Expand Down
9 changes: 8 additions & 1 deletion traveltimepy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"""Python sdk for working with traveltime api"""

from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
pass

from traveltimepy.dto.transportation import (
PublicTransport,
Driving,
Expand Down Expand Up @@ -27,7 +35,6 @@
from traveltimepy.sdk import TravelTimeSdk
from traveltimepy.dto.requests.time_filter_fast import Transportation
from traveltimepy.dto.requests.postcodes_zones import ZonesProperty
from traveltimepy.version import __version__

__all__ = [
"__version__",
Expand Down
2 changes: 1 addition & 1 deletion traveltimepy/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from traveltimepy.dto.requests.time_filter_fast import Transportation
from traveltimepy.errors import ApiError

from traveltimepy.version import __version__
from traveltimepy import __version__
from traveltimepy.accept_type import AcceptType
from traveltimepy.itertools import join_opt
from traveltimepy.dto.requests.supported_locations import SupportedLocationsRequest
Expand Down
1 change: 0 additions & 1 deletion traveltimepy/version.py

This file was deleted.

0 comments on commit 13b2add

Please sign in to comment.