Skip to content

Commit

Permalink
Merge pull request #161 Exegol 4.2.3
Browse files Browse the repository at this point in the history
 Exegol 4.2.3
  • Loading branch information
Dramelac authored May 24, 2023
2 parents 76d57ab + d5b884d commit 62fab24
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion exegol/config/ConstantConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class ConstantConfig:
"""Constant parameters information"""
# Exegol Version
version: str = "4.2.2"
version: str = "4.2.3"

# Exegol documentation link
documentation: str = "https://exegol.rtfd.io/"
Expand Down
15 changes: 8 additions & 7 deletions exegol/config/EnvInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import shutil
import subprocess
from enum import Enum
from typing import Optional, Any, List

from exegol.config.ConstantConfig import ConstantConfig
Expand All @@ -13,13 +14,13 @@ class EnvInfo:
"""Class to identify the environment in which exegol runs to adapt
the configurations, processes and messages for the user"""

class HostOs:
class HostOs(Enum):
"""Dictionary class for static OS Name"""
WINDOWS = "Windows"
LINUX = "Linux"
MAC = "Mac"

class DockerEngine:
class DockerEngine(Enum):
"""Dictionary class for static Docker engine name"""
WLS2 = "WSL2"
HYPERV = "Hyper-V"
Expand All @@ -36,8 +37,8 @@ class DockerEngine:
__is_docker_desktop: bool = False
__windows_release: Optional[str] = None
# Host OS
__docker_host_os: Optional[str] = None
__docker_engine: Optional[str] = None
__docker_host_os: Optional[HostOs] = None
__docker_engine: Optional[DockerEngine] = None
# Docker desktop cache config
__docker_desktop_resource_config = None
# Architecture
Expand Down Expand Up @@ -99,7 +100,7 @@ def initData(cls, docker_info):
cls.__docker_host_os = cls.HostOs.LINUX

@classmethod
def getHostOs(cls) -> str:
def getHostOs(cls) -> HostOs:
"""Return Host OS
Can be 'Windows', 'Mac' or 'Linux'"""
# initData must be called from DockerUtils on client initialisation
Expand Down Expand Up @@ -154,9 +155,9 @@ def isOrbstack(cls) -> bool:
return cls.__docker_engine == cls.DockerEngine.ORBSTACK

@classmethod
def getDockerEngine(cls) -> str:
def getDockerEngine(cls) -> DockerEngine:
"""Return Docker engine type.
Can be 'kernel', 'mac', 'wsl2' or 'hyper-v'"""
Can be any of EnvInfo.DockerEngine"""
# initData must be called from DockerUtils on client initialisation
assert cls.__docker_engine is not None
return cls.__docker_engine
Expand Down
4 changes: 2 additions & 2 deletions exegol/manager/ExegolManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ def print_version(cls):
if EnvInfo.isWindowsHost():
logger.debug(f"Windows release: {EnvInfo.getWindowsRelease()}")
logger.debug(f"Python environment: {EnvInfo.current_platform}")
logger.debug(f"Docker engine: {EnvInfo.getDockerEngine().upper()}")
logger.debug(f"Docker engine: {str(EnvInfo.getDockerEngine()).upper()}")
logger.debug(f"Docker desktop: {boolFormatter(EnvInfo.isDockerDesktop())}")
logger.debug(f"Shell type: {EnvInfo.getShellType()}")
if not UpdateManager.isUpdateTag() and UserConfig().auto_check_updates:
UpdateManager.checkForWrapperUpdate()
if UpdateManager.isUpdateTag():
logger.empty_line()
if Confirm("An [green]Exegol[/green] update is [orange3]available[/orange3], do you want to update ?", default=True):
if Confirm(f"An [green]Exegol[/green] update is [orange3]available[/orange3] ({UpdateManager.display_current_version()} -> {UpdateManager.display_latest_version()}), do you want to update ?", default=True):
UpdateManager.updateWrapper()
else:
logger.empty_line(log_level=logging.DEBUG)
Expand Down
6 changes: 5 additions & 1 deletion exegol/manager/UpdateManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def display_current_version():
module = ExegolModules().getWrapperGit(fast_load=True)
if module.isAvailable:
commit_version = f" [bright_black]\[{str(module.get_current_commit())[:8]}][/bright_black]"
return f"[blue]v{ConstantConfig.version}[blue]{commit_version}"
return f"[blue]v{ConstantConfig.version}[/blue]{commit_version}"

@classmethod
def __tagUpdateAvailable(cls, latest_version, current_version=None):
Expand All @@ -286,6 +286,10 @@ def isUpdateTag(cls) -> bool:
cls.__untagUpdateAvailable(current_version)
return False

@classmethod
def display_latest_version(cls) -> str:
return f"[blue]v{DataCache().get_wrapper_data().last_version}[/blue]"

@classmethod
def __untagUpdateAvailable(cls, current_version: Optional[str] = None):
"""Reset the latest version to the current version"""
Expand Down
2 changes: 1 addition & 1 deletion exegol/utils/GuiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __windowsGuiChecks(cls) -> bool:
logger.error("WSL is [orange3]not available[/orange3] on your system. GUI is not supported.")
return False
# Only WSL2 support WSLg
if EnvInfo.getDockerEngine() != "wsl2":
if EnvInfo.getDockerEngine() != EnvInfo.DockerEngine.WLS2:
logger.error("Docker must be run with [orange3]WSL2[/orange3] engine in order to support GUI applications.")
return False
logger.debug("WSL is [green]available[/green] and docker is using WSL2")
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docker~=6.0.0
requests~=2.28.2
docker~=6.1.2
requests>=2.30.0
rich~=13.3.0
GitPython~=3.1.29
PyYAML>=6.0
argcomplete~=2.1.1
argcomplete~=3.0.8
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"Operating System :: OS Independent",
],
install_requires=[
'docker~=6.0.0',
'requests~=2.28.2',
'docker~=6.1.2',
'requests>=2.30.0',
'rich~=13.3.0',
'PyYAML',
'GitPython',
'argcomplete~=2.1.1'
'argcomplete~=3.0.8'
],
packages=find_packages(exclude=["tests"]),
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exegol.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == '4.2.2'
assert __version__ == '4.2.3'

0 comments on commit 62fab24

Please sign in to comment.