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

Exegol 4.2.4 #170

Merged
merged 10 commits into from
Jul 20, 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 exegol-resources
Submodule exegol-resources updated 1 files
+1 −1 README.md
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.3"
version: str = "4.2.4"

# Exegol documentation link
documentation: str = "https://exegol.rtfd.io/"
Expand Down
2 changes: 1 addition & 1 deletion exegol/config/EnvInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def initData(cls, docker_info):
# Deduct a Windows Host from data
cls.__is_docker_desktop = docker_os == "docker desktop"
is_host_windows = cls.__is_docker_desktop and "microsoft" in docker_kernel
is_orbstack = "(containerized)" in docker_os and "orbstack" in docker_kernel
is_orbstack = (docker_os == "orbstack" or "(containerized)" in docker_os) and "orbstack" in docker_kernel
if is_host_windows:
# Check docker engine with Windows host
if "wsl2" in docker_kernel:
Expand Down
3 changes: 2 additions & 1 deletion exegol/manager/UpdateManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def __checkUpdate(cls) -> bool:
module = ExegolModules().getWrapperGit(fast_load=True)
if module.isAvailable:
isUpToDate = module.isUpToDate()
remote_version = str(module.get_latest_commit())[:8]
last_commit = module.get_latest_commit()
remote_version = "?" if last_commit is None else str(last_commit)[:8]
current_version = str(module.get_current_commit())[:8]
else:
# If Exegol have not been installed from git clone. Auto-check update in this case is only available from mates release
Expand Down
4 changes: 4 additions & 0 deletions exegol/model/ExegolContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ def __applyXhostACL(self):
"""
if self.config.isGUIEnable() and not self.__xhost_applied and not EnvInfo.isWindowsHost():
self.__xhost_applied = True # Can be applied only once per execution
if shutil.which("xhost") is None:
logger.error("The [green]xhost[/green] command is not available on your [bold]host[/bold]. "
"Exegol was unable to allow your container to access your graphical environment (or you don't have one).")
return

if EnvInfo.isMacHost():
logger.debug(f"Adding xhost ACL to localhost")
Expand Down
4 changes: 3 additions & 1 deletion exegol/utils/DockerUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ def __findLocalRecoveryImages(cls, include_untag: bool = False) -> List[Image]:
id_list = set()
for img in recovery_images:
# Docker can keep track of 2 images maximum with RepoTag or RepoDigests, after it's hard to track origin without labels, so this recovery option is "best effort"
if len(img.attrs.get('RepoTags', [1])) > 0 or (not include_untag and len(img.attrs.get('RepoDigests', [1])) > 0) or img.id in id_list:
repo_tags = img.attrs.get('RepoTags')
repo_digest = img.attrs.get('RepoDigests')
if repo_tags is not None and len(repo_tags) > 0 or (not include_untag and repo_digest is not None and len(repo_digest) > 0) or img.id in id_list:
# Skip image from other repo and image already found
continue
if img.labels.get('org.exegol.app', '') == "Exegol":
Expand Down
7 changes: 5 additions & 2 deletions exegol/utils/GitUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def clone(self, repo_url: str, optimize_disk_space: bool = True) -> bool:
progress.add_task(f"[bold red]Cloning {self.getName()} git repository", start=True)
self.__gitRepo = Repo.clone_from(repo_url, str(self.__repo_path), multi_options=custom_options, progress=clone_update_progress)
progress.remove_task(progress.tasks[0].id)
logger.success(f"The {self.getName()} git repository have been successfully clone!")
logger.success(f"The Git repository {self.getName()} was successfully cloned!")
except GitCommandError as e:
# GitPython user \n only
error = GitUtils.formatStderr(e.stderr)
Expand Down Expand Up @@ -217,6 +217,7 @@ def isUpToDate(self, branch: Optional[str] = None) -> bool:
logger.debug("NEW TAG flag detected")

remote_commit = self.get_latest_commit()
assert remote_commit is not None
# Check if remote_commit is an ancestor of the last local commit (check if there is local commit ahead)
return self.__gitRepo.is_ancestor(remote_commit, current_commit)

Expand Down Expand Up @@ -253,7 +254,9 @@ def get_latest_commit(self):
assert self.isAvailable
assert not ParametersManager().offline_mode
if self.__fetchBranchInfo is None:
self.__fetch_update()
if not self.__fetch_update():
logger.debug("The latest commit cannot be retrieved.")
return None
assert self.__fetchBranchInfo is not None
return self.__fetchBranchInfo.commit

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docker~=6.1.2
requests>=2.30.0
rich~=13.3.0
docker~=6.1.3
requests>=2.31.0
rich~=13.4.2
GitPython~=3.1.29
PyYAML>=6.0
argcomplete~=3.0.8
argcomplete~=3.1.1
8 changes: 4 additions & 4 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.1.2',
'requests>=2.30.0',
'rich~=13.3.0',
'docker~=6.1.3',
'requests>=2.31.0',
'rich~=13.4.2',
'PyYAML',
'GitPython',
'argcomplete~=3.0.8'
'argcomplete~=3.1.1'
],
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.3'
assert __version__ == '4.2.4'
Loading