Skip to content

Commit

Permalink
📝 add some spec metadata to versions
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 9, 2024
1 parent 756d2c1 commit 13f37ac
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ozi/spec/_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
def current_version() -> str:
"""Returns the currently installed version of OZI."""
try:
return version('OZI')
version_ = version('OZI')
except PackageNotFoundError: # pragma: no cover
from setuptools_scm import get_version # type: ignore

return str(get_version(root='..', relative_to=__file__))

version_ = str(get_version(root='..', relative_to=__file__))
return version_

@dataclass(slots=True, frozen=True, eq=True)
class Spec(Default):
"""OZI Specification metadata."""

version: str = '0.4'
version: str = field(
default='0.4',
metadata={'help': 'OZI specification standard version.'},
)
python: PythonProject = ClassicProject()


Expand All @@ -46,7 +47,10 @@ class Experimental(Default):
class OZI(Default):
"""OZI distribution metadata."""

version: str = field(default_factory=current_version)
version: str = field(
default_factory=current_version,
metadata={'help': 'Currently installed version of the OZI package.'},
)
python_support: PythonSupport = PythonSupport()
experimental: Experimental = Experimental()

Expand Down

0 comments on commit 13f37ac

Please sign in to comment.