Skip to content

Commit

Permalink
fix source/doc/examples with qstkdrepo changes.
Browse files Browse the repository at this point in the history
This handles all_os/qt/qt6_xyz_src_doc_examples changing
to all_os/qt/qt6/xyz/[unix|windows]_line_endings_src
for both list and install commands.
  • Loading branch information
tsteven4 committed Dec 18, 2024
1 parent fa49772 commit 4147a85
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def __init__(
)

def _arch_ext(self) -> str:
return "_src_doc_examples"
return "_" + QtRepoProperty.sde_ext(self.version)

def _base_module_name(self) -> str:
"""
Expand Down
23 changes: 20 additions & 3 deletions aqt/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import itertools
import operator
import os
import posixpath
import re
import secrets as random
Expand Down Expand Up @@ -275,7 +276,7 @@ def to_url(self) -> str:
)

def to_folder(self, version: Version, qt_version_no_dots: str, extension: Optional[str] = None) -> str:
if version >= Version("6.8.0"):
if (version >= Version("6.8.0")) and not ((self.host == "all_os") and (self.target == "qt")):

Check failure on line 279 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[mypy] reported by reviewdog 🐶 error: Call to untyped function "Version" in typed Raw Output: aqt/metadata.py:279:24: error: Call to untyped function "Version" in typed

Check failure on line 279 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[pylint] reported by reviewdog 🐶 Line too long (101/100) (line-too-long) Raw Output: aqt/metadata.py:279:0: C0301: Line too long (101/100) (line-too-long)

Check failure on line 279 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[pylint] reported by reviewdog 🐶 Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) Raw Output: aqt/metadata.py:279:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
return "{category}{major}_{ver}/{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
Expand Down Expand Up @@ -569,6 +570,16 @@ def known_extensions(version: Version) -> List[str]:
return ["qtpdf", "qtwebengine"]
return []

@staticmethod
def sde_ext(version: Version) -> str:

Check failure on line 574 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[pylint] reported by reviewdog 🐶 Missing function or method docstring (missing-function-docstring) Raw Output: aqt/metadata.py:574:4: C0116: Missing function or method docstring (missing-function-docstring)
if version >= Version("6.8.0"):

Check failure on line 575 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[mypy] reported by reviewdog 🐶 error: Call to untyped function "Version" in typed Raw Output: aqt/metadata.py:575:23: error: Call to untyped function "Version" in typed
if os.linesep == "\r\n":

Check failure on line 576 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[pylint] reported by reviewdog 🐶 Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) Raw Output: aqt/metadata.py:576:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
return "windows_line_endings_src"
else:
return "unix_line_endings_src"
else:
return "src_doc_examples"


class MetadataFactory:
"""Retrieve metadata of Qt variations, versions, and descriptions from Qt site."""
Expand Down Expand Up @@ -973,7 +984,9 @@ def fetch_modules_sde(self, cmd_type: str, version: Version) -> List[str]:
"qt",
), "Internal misuse of fetch_modules_sde"
qt_ver_str = self._get_qt_version_str(version)
modules_meta = self._fetch_module_metadata(self.archive_id.to_folder(version, qt_ver_str, "src_doc_examples"))
modules_meta = self._fetch_module_metadata(
self.archive_id.to_folder(version, qt_ver_str, QtRepoProperty.sde_ext(version))
)
# pattern: Match all names "qt.qt5.12345.doc.(\w+)
pattern = re.compile(r"^qt\.(qt" + str(version.major) + r"\.)?" + qt_ver_str + r"\." + cmd_type + r"\.(.+)$")

Expand All @@ -993,7 +1006,11 @@ def fetch_archives_sde(self, cmd_type: str, version: Version) -> List[str]:
return self.fetch_archives(version, cmd_type, [], is_sde=True)

def fetch_archives(self, version: Version, arch: str, modules: List[str], is_sde: bool = False) -> List[str]:
extension = "src_doc_examples" if is_sde else QtRepoProperty.extension_for_arch(arch, version >= Version("6.0.0"))
extension = (
QtRepoProperty.sde_ext(version)
if is_sde
else QtRepoProperty.extension_for_arch(arch, version >= Version("6.0.0"))

Check failure on line 1012 in aqt/metadata.py

View workflow job for this annotation

GitHub Actions / Linter

[mypy] reported by reviewdog 🐶 error: Call to untyped function "Version" in typed Raw Output: aqt/metadata.py:1012:69: error: Call to untyped function "Version" in typed
)
qt_version_str = self._get_qt_version_str(version)
nonempty = MetadataFactory._has_nonempty_downloads

Expand Down

0 comments on commit 4147a85

Please sign in to comment.