refactor formatting config to exclude git version info
This commit is contained in:
parent
85a32a19cc
commit
66b597d90c
1 changed files with 20 additions and 11 deletions
|
@ -5,6 +5,26 @@ from .formatterif import Config
|
|||
from .git_version_info import GitVersionInfo
|
||||
|
||||
|
||||
class VersionInfo:
|
||||
def __init__(self):
|
||||
self._repo_version: Optional[GitVersionInfo] = None
|
||||
self._pytex_version: Optional[GitVersionInfo] = None
|
||||
|
||||
@property
|
||||
def pytex_version(self) -> Optional[GitVersionInfo]:
|
||||
if self._pytex_version is None:
|
||||
return None
|
||||
else:
|
||||
return self._pytex_version
|
||||
|
||||
@property
|
||||
def repo_version(self) -> Optional[GitVersionInfo]:
|
||||
if self._repo_version is None:
|
||||
return None
|
||||
else:
|
||||
return self._repo_version
|
||||
|
||||
|
||||
class FormattingConfig(Config):
|
||||
def __init__(self):
|
||||
self._naming_scheme: Optional[Union[NamingScheme, str]] = None
|
||||
|
@ -22,9 +42,7 @@ class FormattingConfig(Config):
|
|||
self._author: Optional[str] = None
|
||||
self._licenses = Optional[List[GenericText]]
|
||||
self._version: Optional[str] = None
|
||||
self._pytex_version: Optional[GitVersionInfo] = None
|
||||
self._pytex_info_text: Optional[GenericText] = None
|
||||
self._repo_version: Optional[GitVersionInfo] = None
|
||||
self._repo_info_text: Optional[GenericText] = None
|
||||
|
||||
self._include_drv: Optional[bool] = None
|
||||
|
@ -134,9 +152,6 @@ class FormattingConfig(Config):
|
|||
else:
|
||||
return self._version
|
||||
|
||||
@property
|
||||
def pytex_version(self) -> Optional[GitVersionInfo]:
|
||||
return self._pytex_version
|
||||
|
||||
@property
|
||||
def pytex_info_text(self) -> GenericText:
|
||||
|
@ -145,12 +160,6 @@ class FormattingConfig(Config):
|
|||
else:
|
||||
return self._pytex_info_text
|
||||
|
||||
@property
|
||||
def repo_version(self) -> Optional[GitVersionInfo]:
|
||||
if self._repo_version is None:
|
||||
return None
|
||||
else:
|
||||
return self._repo_version
|
||||
|
||||
@property
|
||||
def repo_info_text(self) -> GenericText:
|
||||
|
|
Loading…
Reference in a new issue