Skip to content

Commit

Permalink
Normalize import locations
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Nov 19, 2023
1 parent c9aa740 commit 57463f4
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions poetry_dynamic_versioning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@
from pathlib import Path
from typing import Mapping, MutableMapping, Optional, Sequence, Tuple, Union

import jinja2
import tomlkit
from dunamai import (
bump_version,
check_version,
Concern,
Pattern,
serialize_pep440,
serialize_pvp,
serialize_semver,
Style,
Vcs,
Version,
)

_BYPASS_ENV = "POETRY_DYNAMIC_VERSIONING_BYPASS"
_OVERRIDE_ENV = "POETRY_DYNAMIC_VERSIONING_OVERRIDE"
Expand Down Expand Up @@ -258,9 +271,9 @@ def _get_override_version(name: Optional[str], env: Optional[Mapping] = None) ->
return None


def _get_version_from_dunamai(vcs, pattern, config, *, strict: Optional[bool] = None):
from dunamai import Version

def _get_version_from_dunamai(
vcs: Vcs, pattern: Union[str, Pattern], config: Mapping, *, strict: Optional[bool] = None
):
return Version.from_vcs(
vcs,
pattern,
Expand All @@ -277,19 +290,6 @@ def _get_version(config: Mapping, name: Optional[str] = None) -> str:
if override is not None:
return override

import jinja2
from dunamai import (
bump_version,
check_version,
Concern,
Pattern,
serialize_pep440,
serialize_pvp,
serialize_semver,
Style,
Vcs,
)

vcs = Vcs(config["vcs"])
style = config["style"]
if style is not None:
Expand Down

0 comments on commit 57463f4

Please sign in to comment.