diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-12-07 10:21:08 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-12-07 12:02:34 +0100 |
commit | 30e4777956513daeba0f55cef50de4881d0bb2f1 (patch) | |
tree | 1567dde2f711d52183d7eea965bca8a9bbdad13b | |
parent | fe1b1026d02722a4b7b4b0e0e2811f2a799c38c9 (diff) |
Documentation: Remove the snippets copy step
This is no longer necessary since the snippets have been removed from
the repository. Generate them directly into the build directory.
Pick-to: 6.2
Task-number: PYSIDE-1721
Change-Id: I0a4d9bc3c466b689fa28a982f608104cc5936570
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/pyside6/doc/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tools/snippets_translate/main.py | 19 |
2 files changed, 8 insertions, 21 deletions
diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt index 09677fe95..48705aee4 100644 --- a/sources/pyside6/doc/CMakeLists.txt +++ b/sources/pyside6/doc/CMakeLists.txt @@ -107,7 +107,7 @@ if (FULLDOCSBUILD) # Note QT_SRC_DIR points to 'qtbase', # so we use the general SRC directory to copy all the other snippets execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SNIPPETS_TOOL} - --qt ${QT_ROOT_PATH} --pyside ${PYSIDE_ROOT} -w + --qt ${QT_ROOT_PATH} --target ${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets -w WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} RESULT_VARIABLE SNIPPETS_RESULT) if (SNIPPETS_RESULT) @@ -290,13 +290,6 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/rst/PySide6/QtCore/index. WORKING_DIRECTORY ${${module}_SOURCE_DIR} COMMENT "Running generator to generate documentation...") -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets" - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst - COMMENT "Copying docs...") - -add_custom_target("doc_copy" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets") - add_custom_target("docrsts" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/rst/PySide6/QtCore/index.rst") @@ -311,7 +304,6 @@ add_custom_target("licensedocrsts" if (FULLDOCSBUILD) add_dependencies(apidoc docrsts licensedocrsts) add_dependencies(licensedocrsts docrsts) - add_dependencies(docrsts doc_copy qdoc) endif() #install files diff --git a/tools/snippets_translate/main.py b/tools/snippets_translate/main.py index d279392d4..a0a4663a0 100644 --- a/tools/snippets_translate/main.py +++ b/tools/snippets_translate/main.py @@ -73,7 +73,6 @@ log = logging.getLogger("snippets_translate") # Filter and paths configuration SKIP_END = (".pro", ".pri", ".cmake", ".qdoc", ".yaml", ".frag", ".qsb", ".vert", "CMakeLists.txt") SKIP_BEGIN = ("changes-", ".") -OUT_MAIN = Path("sources/pyside6/doc/codesnippets/") SNIPPET_PATTERN = re.compile(r"//! \[([^]]+)\]") @@ -94,11 +93,11 @@ def get_parser(): ) parser.add_argument( - "--pyside", + "--target", action="store", - dest="pyside_dir", + dest="target_dir", required=True, - help="Path to the pyside-setup directory", + help="Directory into which to generate the snippets", ) parser.add_argument( @@ -155,7 +154,7 @@ def check_arguments(options): if options.write_files: if not opt_quiet: log.warning( - f"Files will be copied from '{options.qt_dir}':\n" f"\tto '{options.pyside_dir}'" + f"Files will be copied from '{options.qt_dir}':\n" f"\tto '{options.target_dir}'" ) else: msg = "This is a listing only, files are not being copied" @@ -164,11 +163,8 @@ def check_arguments(options): if not opt_quiet: log.info(msg, extra=extra) - # Check 'qt_dir' and 'pyside_dir' - if is_directory(options.qt_dir) and is_directory(options.pyside_dir): - return True - - return False + # Check 'qt_dir' + return is_directory(options.qt_dir) def is_valid_file(x): @@ -341,8 +337,7 @@ def copy_file(file_path, qt_path, out_path, write=False, debug=False): def process(options): qt_path = Path(options.qt_dir) - py_path = Path(options.pyside_dir) - out_path = py_path / OUT_MAIN + out_path = Path(options.target_dir) # (new, exists) valid_new, valid_exists = 0, 0 |