Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix version #317

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish_alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- dev
paths-ignore:
- 'mycroft/version.py'
- 'ovos_core/version.py'
- 'test/**'
- 'examples/**'
- '.github/**'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- dev
paths-ignore:
- 'mycroft/version.py'
- 'ovos_core/version.py'
- 'examples/**'
- '.github/**'
- '.gitignore'
Expand All @@ -17,7 +17,7 @@ on:
branches:
- master
paths-ignore:
- 'mycroft/version.py'
- 'ovos_core/version.py'
- 'requirements/**'
- 'examples/**'
- '.github/**'
Expand Down
52 changes: 2 additions & 50 deletions mycroft/version.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,11 @@
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from ovos_core.version import OVOS_VERSION_STR, OVOS_VERSION_BUILD, OVOS_VERSION_TUPLE, \
OVOS_VERSION_ALPHA, VersionManager, check_version

# The following lines are replaced during the release process.
# START_VERSION_BLOCK
CORE_VERSION_MAJOR = 21
CORE_VERSION_MINOR = 2
CORE_VERSION_BUILD = 1

OVOS_VERSION_MAJOR = 0
OVOS_VERSION_MINOR = 0
OVOS_VERSION_BUILD = 8
OVOS_VERSION_ALPHA = 13


# END_VERSION_BLOCK


CORE_VERSION_TUPLE = (CORE_VERSION_MAJOR,
CORE_VERSION_MINOR,
CORE_VERSION_BUILD)
CORE_VERSION_STR = '.'.join(map(str, CORE_VERSION_TUPLE))

OVOS_VERSION_TUPLE = (OVOS_VERSION_MAJOR,
OVOS_VERSION_MINOR,
OVOS_VERSION_BUILD)
OVOS_VERSION_STR = '.'.join(map(str, OVOS_VERSION_TUPLE))


class VersionManager:
@staticmethod
def get():
return {"coreVersion": CORE_VERSION_STR,
"OpenVoiceOSVersion": OVOS_VERSION_STR,
"enclosureVersion": None}


def check_version(version_string):
"""
Check if current version is equal or higher than the
version string provided to the function

Args:
version_string (string): version string ('Major.Minor.Build')
"""
version_tuple = tuple(map(int, version_string.split('.')))
return CORE_VERSION_TUPLE >= version_tuple
17 changes: 3 additions & 14 deletions ovos_core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,14 @@

# The following lines are replaced during the release process.
# START_VERSION_BLOCK
CORE_VERSION_MAJOR = 21
CORE_VERSION_MINOR = 2
CORE_VERSION_BUILD = 1

OVOS_VERSION_MAJOR = 0
OVOS_VERSION_MINOR = 0
OVOS_VERSION_BUILD = 8
OVOS_VERSION_ALPHA = 10
OVOS_VERSION_ALPHA = 13

# END_VERSION_BLOCK


CORE_VERSION_TUPLE = (CORE_VERSION_MAJOR,
CORE_VERSION_MINOR,
CORE_VERSION_BUILD)
CORE_VERSION_STR = '.'.join(map(str, CORE_VERSION_TUPLE))

OVOS_VERSION_TUPLE = (OVOS_VERSION_MAJOR,
OVOS_VERSION_MINOR,
OVOS_VERSION_BUILD)
Expand All @@ -41,9 +32,7 @@
class VersionManager:
@staticmethod
def get():
return {"coreVersion": CORE_VERSION_STR,
"OpenVoiceOSVersion": OVOS_VERSION_STR,
"enclosureVersion": None}
return {"OpenVoiceOSVersion": OVOS_VERSION_STR}


def check_version(version_string):
Expand All @@ -55,4 +44,4 @@ def check_version(version_string):
version_string (string): version string ('Major.Minor.Build')
"""
version_tuple = tuple(map(int, version_string.split('.')))
return CORE_VERSION_TUPLE >= version_tuple
return OVOS_VERSION_TUPLE >= version_tuple