-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
39 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
__email__ = "[email protected]" | ||
__copyright__ = "2020-2023, Patrick Lehmann" | ||
__license__ = "Apache License, Version 2.0" | ||
__version__ = "0.10.0" | ||
__version__ = "0.11.0" | ||
__keywords__ = ["Python3", "Template", "Versioning", "Git"] | ||
|
||
from dataclasses import dataclass, make_dataclass, field | ||
|
@@ -44,7 +44,7 @@ | |
from typing import Union, Any, Dict | ||
|
||
from pyTooling.Decorators import export | ||
from pyTooling.Versioning import SemVersion | ||
from pyTooling.Versioning import SemanticVersion | ||
from pyTooling.TerminalUI import ILineTerminal | ||
|
||
from pyVersioning.Utils import SelfDescriptive, GitHelper, GitShowCommand | ||
|
@@ -61,11 +61,11 @@ class Tool(SelfDescriptive): | |
"""This data structure class describes the tool name and version of pyVersioning.""" | ||
|
||
_name: str | ||
_version: SemVersion | ||
_version: SemanticVersion | ||
|
||
_public = ["name", "version"] | ||
|
||
def __init__(self, name: str, version: SemVersion): | ||
def __init__(self, name: str, version: SemanticVersion): | ||
self._name = name | ||
self._version = version | ||
|
||
|
@@ -74,7 +74,7 @@ def name(self) -> str: | |
return self._name | ||
|
||
@property | ||
def version(self) -> SemVersion: | ||
def version(self) -> SemanticVersion: | ||
return self._version | ||
|
||
def __str__(self) -> str: | ||
|
@@ -162,22 +162,22 @@ def __post_init__(self) -> None: | |
class Project(SelfDescriptive): | ||
_name: str | ||
_variant: str | ||
_version: SemVersion | ||
_version: SemanticVersion | ||
|
||
_public = ["name", "variant", "version"] | ||
|
||
def __init__(self, name: str, version: Union[str, SemVersion] = None, variant: str = None) -> None: | ||
def __init__(self, name: str, version: Union[str, SemanticVersion] = None, variant: str = None) -> None: | ||
"""Assign fields and convert version string to a `Version` object.""" | ||
|
||
self._name = name if name is not None else "" | ||
self._variant = variant if variant is not None else "" | ||
|
||
if isinstance(version, SemVersion): | ||
if isinstance(version, SemanticVersion): | ||
self._version = version | ||
elif isinstance(version, str): | ||
self._version = SemVersion(version) | ||
self._version = SemanticVersion(version) | ||
elif version is None: | ||
self._version = SemVersion(0, 0, 0) | ||
self._version = SemanticVersion(0, 0, 0) | ||
|
||
@property | ||
def name(self) -> str: | ||
|
@@ -188,7 +188,7 @@ def variant(self) -> str: | |
return self._variant | ||
|
||
@property | ||
def version(self) -> SemVersion: | ||
def version(self) -> SemanticVersion: | ||
return self._version | ||
|
||
def __str__(self) -> str: | ||
|
@@ -198,32 +198,32 @@ def __str__(self) -> str: | |
@export | ||
class Compiler(SelfDescriptive): | ||
_name: str | ||
_version: SemVersion | ||
_version: SemanticVersion | ||
_configuration: str | ||
_options: str | ||
|
||
_public = ["name", "version", "configuration", "options"] | ||
|
||
def __init__(self, name: str, version: Union[str, SemVersion] = "", configuration: str = "", options: str = "") -> None: | ||
def __init__(self, name: str, version: Union[str, SemanticVersion] = "", configuration: str = "", options: str = "") -> None: | ||
"""Assign fields and convert version string to a `Version` object.""" | ||
|
||
self._name = name if name is not None else "" | ||
self._configuration = configuration if configuration is not None else "" | ||
self._options = options if options is not None else "" | ||
|
||
if isinstance(version, SemVersion): | ||
if isinstance(version, SemanticVersion): | ||
self._version = version | ||
elif isinstance(version, str): | ||
self._version = SemVersion(version) | ||
self._version = SemanticVersion(version) | ||
elif version is None: | ||
self._version = SemVersion(0, 0, 0) | ||
self._version = SemanticVersion(0, 0, 0) | ||
|
||
@property | ||
def name(self) -> str: | ||
return self._name | ||
|
||
@property | ||
def version(self) -> SemVersion: | ||
def version(self) -> SemanticVersion: | ||
return self._version | ||
|
||
@property | ||
|
@@ -316,7 +316,7 @@ def collectData(self) -> None: | |
else: | ||
self.service = WorkStation() | ||
|
||
self.variables["tool"] = Tool("pyVersioning", SemVersion(__version__)) | ||
self.variables["tool"] = Tool("pyVersioning", SemanticVersion(__version__)) | ||
self.variables["git"] = self.getGitInformation() | ||
self.variables["env"] = self.getEnvironment() | ||
self.variables["platform"] = self.service.getPlatform() | ||
|
@@ -327,11 +327,11 @@ def calculateData(self) -> None: | |
if self.variables["git"].tag != "": | ||
pass | ||
|
||
def getVersion(self, config: Configuration.Project) -> SemVersion: | ||
def getVersion(self, config: Configuration.Project) -> SemanticVersion: | ||
if config.version is not None: | ||
return config.version | ||
else: | ||
return SemVersion("0.0.0") | ||
return SemanticVersion("0.0.0") | ||
|
||
def getGitInformation(self) -> Git: | ||
return Git( | ||
|
@@ -511,7 +511,7 @@ def getBuild(self, config: Configuration.Build) -> Build: | |
def getCompiler(self, config: Configuration.Build.Compiler) -> Compiler: | ||
return Compiler( | ||
name=config.name, | ||
version=SemVersion(config.version), | ||
version=SemanticVersion(config.version), | ||
configuration=config.configuration, | ||
options=config.options | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
ruamel.yaml>=0.17.18 | ||
ruamel.yaml >= 0.17.18 | ||
|
||
pyTooling>=2.12.1 | ||
pyTooling.TerminalUI>=1.5.9 | ||
pyAttributes>=2.5.1 | ||
pyTooling >= 5.0.0, < 6.0 | ||
pyAttributes >= 2.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ pytest>=7.2.1 | |
pytest-cov>=4.0.0 | ||
|
||
# Static Type Checking | ||
mypy>=1.0.0 | ||
mypy>=1.2.0 | ||
lxml>=4.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters