Skip to content

Commit

Permalink
feat: doc_src_examples for 6.7.0
Browse files Browse the repository at this point in the history
- Qt 6.7.0 and later move repository folder into .../all_os/qt/...

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
  • Loading branch information
miurahr committed May 4, 2024
1 parent a5dea63 commit 40721ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 18 additions & 3 deletions aqt/archives.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# Copyright (C) 2018 Linus Jahn <lnj@kaidan.im>
# Copyright (C) 2019-2022 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2019-2024 Hiroshi Miura <miurahr@linux.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down Expand Up @@ -29,7 +29,7 @@

from aqt.exceptions import ArchiveDownloadError, ArchiveListError, ChecksumDownloadFailure, NoPackageFound
from aqt.helper import Settings, get_hash, getUrl, ssplit
from aqt.metadata import QtRepoProperty, Version
from aqt.metadata import QtRepoProperty, Version, SimpleSpec


@dataclass
Expand Down Expand Up @@ -388,6 +388,18 @@ def _get_archives_base(self, name, target_packages):
update_xml_text = self._download_update_xml(update_xml_url)
self._parse_update_xml(os_target_folder, update_xml_text, target_packages)

def _get_archives_doc(self, name, target_packages):
os_target_folder = posixpath.join(
"online/qtsdkrepository",
self.os_name
+ ("" if self.os_name in ("all_os", "linux_arm64") else ("_x86" if self.os_name == "windows" else "_x64")),
self.target,
name,
)
update_xml_url = posixpath.join(os_target_folder, "Updates.xml")
update_xml_text = self._download_update_xml(update_xml_url)
self._parse_update_xml(os_target_folder, update_xml_text, target_packages)

def _download_update_xml(self, update_xml_path):
"""Hook for unit test."""
if not Settings.ignore_hash:
Expand Down Expand Up @@ -532,7 +544,7 @@ def __init__(
self.base = base
self.logger = getLogger("aqt.archives")
super(SrcDocExamplesArchives, self).__init__(
os_name,
self.os_name,
target,
version,
arch=self.flavor,
Expand All @@ -557,6 +569,9 @@ def _base_module_name(self) -> str:
def _module_name_suffix(self, module: str) -> str:
return f"{self.flavor}.{module}"

def _get_archives(self):
self._get_archives_doc(f"qt{self.version.major}_{self._version_str()}{self._arch_ext()}", self._target_packages())

def get_target_config(self) -> TargetConfig:
"""Get target configuration.
Expand Down
5 changes: 4 additions & 1 deletion aqt/installer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018 Linus Jahn <lnj@kaidan.im>
# Copyright (C) 2019-2021 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2019-2024 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2020, Aurélien Gâteau
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -481,6 +481,9 @@ def _run_src_doc_examples(self, flavor, args, cmd_name: Optional[str] = None):
else:
qt_version = args.qt_version
Cli._validate_version_str(qt_version)
if Version(qt_version) in SimpleSpec(">=6.7.0"):
os_name = "all_os"
target = "qt"
if args.timeout is not None:
timeout = (args.timeout, args.timeout)
else:
Expand Down

0 comments on commit 40721ad

Please sign in to comment.