fix list-src,doc,examples for >= 6.8.0 (#880)
Some checks are pending
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.0) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.1) (push) Waiting to run
Check tox tests / Check packaging 📦 (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Publish Python 🐍 distributions 📦 to PyPI / Build and publish Python 🐍 distributions 📦 to PyPI (push) Waiting to run
Test on GH actions environment / test (binary, windows-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.5.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.5.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.7.3) (push) Waiting to run

* fix list-src,doc,examples for >= 6.8.0

* generalize test_list_src_doc_examples_cli for version

* tweak expected url patterns.
This commit is contained in:
tsteven4
2025-01-28 04:55:01 -07:00
committed by GitHub
parent cbe159f38a
commit 06b821965d
4 changed files with 1678 additions and 13 deletions

View File

@@ -336,8 +336,13 @@ class ArchiveId:
ext="_" + extension if extension else "",
)
else:
base = f"qt{version.major}_{qt_version_no_dots}"
return f"{base}/{base}"
# traditional structure, still used by sde.
return "{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
ver=qt_version_no_dots,
ext="_" + extension if extension else "",
)
elif version >= Version("6.5.0") and self.target == "wasm":
# Qt 6.5-6.7 WASM uses direct wasm_[single|multi]thread folder
if extension:

View File

@@ -0,0 +1,97 @@
{
"src": {
"modules": [],
"archives": [
"qt3d",
"qt5",
"qt5compat",
"qtactiveqt",
"qtbase",
"qtcharts",
"qtcoap",
"qtconnectivity",
"qtdatavis3d",
"qtdeclarative",
"qtdoc",
"qtgraphs",
"qtgrpc",
"qthttpserver",
"qtimageformats",
"qtlanguageserver",
"qtlocation",
"qtlottie",
"qtmqtt",
"qtmultimedia",
"qtnetworkauth",
"qtopcua",
"qtpositioning",
"qtquick3d",
"qtquick3dphysics",
"qtquickeffectmaker",
"qtquicktimeline",
"qtremoteobjects",
"qtscxml",
"qtsensors",
"qtserialbus",
"qtserialport",
"qtshadertools",
"qtspeech",
"qtsvg",
"qttools",
"qttranslations",
"qtvirtualkeyboard",
"qtwayland",
"qtwebchannel",
"qtwebsockets",
"qtwebview"
]
},
"doc": {
"modules": [],
"archives": [
"qdoc",
"qmake",
"qt5",
"qtassistant",
"qtcmake",
"qtconcurrent",
"qtcore",
"qtdbus",
"qtdesigner",
"qtdistancefieldgenerator",
"qtdoc",
"qtgui",
"qthelp",
"qtlabsplatform",
"qtlinguist",
"qtnetwork",
"qtopengl",
"qtplatformintegration",
"qtprintsupport",
"qtqml",
"qtqmlcore",
"qtqmlmodels",
"qtqmltest",
"qtqmlworkerscript",
"qtqmlxmllistmodel",
"qtquick",
"qtquickcontrols",
"qtquickdialogs",
"qtsql",
"qtsvg",
"qttestlib",
"qtuitools",
"qtwidgets",
"qtxml"
]
},
"examples": {
"modules": [],
"archives": [
"qtbase",
"qtdeclarative",
"qtdoc",
"qttools"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -208,13 +208,17 @@ def win_5152_sde_xml_file() -> str:
return (Path(__file__).parent / "data" / "windows-5152-src-doc-example-update.xml").read_text("utf-8")
def win_5152_sde_expected(cmd_type: str, query_type: str) -> Set[str]:
def win_sde_expected(cmd_type: str, query_type: str, expect_out_file: str) -> Set[str]:
assert cmd_type in ("src", "doc", "examples")
assert query_type in ("archives", "modules")
_json = json.loads((Path(__file__).parent / "data/windows-5152-src-doc-example-expect.json").read_text("utf-8"))
_json = json.loads((Path(__file__).parent / "data" / expect_out_file).read_text("utf-8"))
return set(_json[cmd_type][query_type])
def win_5152_sde_expected(cmd_type: str, query_type: str) -> Set[str]:
return win_sde_expected(cmd_type, query_type, "windows-5152-src-doc-example-expect.json")
@pytest.mark.parametrize(
"cmd_type, host, version, expected",
[
@@ -260,19 +264,82 @@ def test_list_src_doc_examples_modules(
@pytest.mark.parametrize(
"command, expected",
"command, updates_file, url, expected",
(
("list-src windows 5.15.2", win_5152_sde_expected("src", "archives")),
("list-doc windows 5.15.2", win_5152_sde_expected("doc", "archives")),
("list-example windows 5.15.2", win_5152_sde_expected("examples", "archives")),
("list-doc windows 5.15.2 --modules", win_5152_sde_expected("doc", "modules")),
("list-example windows 5.15.2 --modules", win_5152_sde_expected("examples", "modules")),
(
"list-src windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("src", "archives"),
),
(
"list-doc windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("doc", "archives"),
),
(
"list-example windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("examples", "archives"),
),
(
"list-doc windows 5.15.2 --modules",
"windows-5152-src-doc-example-update.xml",
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("doc", "modules"),
),
(
"list-example windows 5.15.2 --modules",
"windows-5152-src-doc-example-update.xml",
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("examples", "modules"),
),
(
"list-src windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("src", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-doc windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("doc", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-example windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("examples", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-src all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("src", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-doc all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("doc", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-example all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("examples", "archives", "all_os-681-src-doc-example-expect.json"),
),
),
)
def test_list_src_doc_examples_cli(monkeypatch, capsys, win_5152_sde_xml_file, command: str, expected: Set[str]):
def test_list_src_doc_examples_cli(
monkeypatch, capsys, command: str, updates_file: str, url: re.Pattern, expected: Set[str]
):
def mock_fetch(self, rest_of_url):
assert rest_of_url == "online/qtsdkrepository/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"
return win_5152_sde_xml_file
assert url.search(rest_of_url), f"Unexpected URL: {rest_of_url}"
return (Path(__file__).parent / "data" / updates_file).read_text("utf-8")
monkeypatch.setattr(MetadataFactory, "fetch_http", mock_fetch)