From c5bf65ef2c717efa9023b5259ec50dff8d351a0b Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 10:26:18 -0800 Subject: [PATCH 1/8] Tests --- .pre-commit-config.yaml | 5 ++ .../build_documentation.yml | 57 +++++++++++++++++++ .../code_style_validation.yml | 29 ++++++---- azure-pipelines.yml | 1 + 4 files changed, 82 insertions(+), 10 deletions(-) create mode 100644 azure-pipelines-templates/build_documentation.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 537da22cf..53347115a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,6 +43,11 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace + - repo: https://github.com/pycqa/flake8 + rev: 7.3.0 + hooks: + - id: flake8 + - repo: https://github.com/psf/black rev: 25.1.0 hooks: diff --git a/azure-pipelines-templates/build_documentation.yml b/azure-pipelines-templates/build_documentation.yml new file mode 100644 index 000000000..d86506cc5 --- /dev/null +++ b/azure-pipelines-templates/build_documentation.yml @@ -0,0 +1,57 @@ +# Copyright (c) 2025 Shotgun Software Inc. +# +# CONFIDENTIAL AND PROPRIETARY +# +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# Source Code License included in this distribution package. See LICENSE. +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# not expressly granted therein are reserved by Shotgun Software Inc. + +parameters: + # Git ref of tk-toolchain to use. + tk_toolchain_ref: master + # Git ref of tk-core to use. + tk_core_ref: master + + +jobs: +- job: build_documentation + displayName: Build Sphinx Documentation + pool: + vmImage: ubuntu-latest + + steps: + - task: UsePythonVersion@0 + displayName: Use Python 3.10 + inputs: + versionSpec: 3.10 + +## TODO switch to Py 3.11 Pyside6 + + - task: Bash@3 + displayName: Install Python dependencies + inputs: + targetType: inline + script: | + pip install --upgrade pip + pip install --upgrade setuptools wheel + pip install --upgrade \ + PySide2 \ + https://github.com/shotgunsoftware/tk-toolchain/archive/${{ parameters.tk_toolchain_ref }}.zip + + - task: Bash@3 + displayName: Clone the tk-core repository + inputs: + targetType: inline + script: | + git clone --depth 1 \ + --branch ${{ parameters.tk_core_ref }} \ + https://github.com/shotgunsoftware/tk-core \ + ../tk-core + + - task: Bash@3 + displayName: Build Shpinx Documentation + inputs: + targetType: inline + script: tk-docs-preview --build-only --verbose diff --git a/azure-pipelines-templates/code_style_validation.yml b/azure-pipelines-templates/code_style_validation.yml index 9808f1d7a..7884f9ea6 100644 --- a/azure-pipelines-templates/code_style_validation.yml +++ b/azure-pipelines-templates/code_style_validation.yml @@ -29,22 +29,31 @@ jobs: - job: code_style_validation displayName: Code Style Validation pool: - vmImage: 'ubuntu-latest' + vmImage: ubuntu-latest steps: - task: UsePythonVersion@0 + displayName: Use Python 3.10 inputs: versionSpec: 3.10 - addToPath: True - architecture: 'x64' - - script: | - pip install --upgrade pip setuptools wheel - pip install --upgrade pre-commit - displayName: Install dependencies + - task: Bash@3 + displayName: Install Python dependencies + inputs: + targetType: inline + script: | + pip install --upgrade pip + pip install --upgrade setuptools wheel + pip install --upgrade pre-commit - - bash: pre-commit autoupdate + - task: Bash@3 displayName: Update pre-commit hook versions + inputs: + targetType: inline + script: pre-commit autoupdate - - bash: pre-commit run --all - displayName: Validate code with pre-commit + - task: Bash@3 + displayName: Validate code + inputs: + targetType: inline + script: pre-commit run --all diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0e465bf22..8c5829692 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,6 +53,7 @@ pr: jobs: - template: azure-pipelines-templates/code_style_validation.yml - template: azure-pipelines-templates/type_checking.yml +- template: azure-pipelines-templates/build_documentation.yml # These are jobs templates, they allow to reduce the redundancy between # variations of the same build. We pass in the image name From 3e9c281af6334ef2c120d91b01405b6d91a21f00 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 11:28:36 -0800 Subject: [PATCH 2/8] Tests --- .pre-commit-config.yaml | 11 ++++++----- azure-pipelines-templates/build_documentation.yml | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 53347115a..320aed3bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,12 +43,13 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/pycqa/flake8 - rev: 7.3.0 - hooks: - - id: flake8 - - repo: https://github.com/psf/black rev: 25.1.0 hooks: - id: black + +### does not work .... lots of errors +# - repo: https://github.com/pycqa/flake8 +# rev: 7.3.0# +# hooks: +# - id: flake8 diff --git a/azure-pipelines-templates/build_documentation.yml b/azure-pipelines-templates/build_documentation.yml index d86506cc5..2b437a506 100644 --- a/azure-pipelines-templates/build_documentation.yml +++ b/azure-pipelines-templates/build_documentation.yml @@ -10,7 +10,7 @@ parameters: # Git ref of tk-toolchain to use. - tk_toolchain_ref: master + tk_toolchain_ref: ticket/SG-40980-docs-warning-on-error-always # Git ref of tk-core to use. tk_core_ref: master @@ -28,6 +28,7 @@ jobs: versionSpec: 3.10 ## TODO switch to Py 3.11 Pyside6 +# NOPE tk-ci-tools knows we don'T need PySide for this one - task: Bash@3 displayName: Install Python dependencies @@ -37,7 +38,6 @@ jobs: pip install --upgrade pip pip install --upgrade setuptools wheel pip install --upgrade \ - PySide2 \ https://github.com/shotgunsoftware/tk-toolchain/archive/${{ parameters.tk_toolchain_ref }}.zip - task: Bash@3 From 520748dd3cab603e8cac0331a664cf2d4233368d Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 12:04:43 -0800 Subject: [PATCH 3/8] Fixup doc string indent --- shotgun_api3/shotgun.py | 1 + 1 file changed, 1 insertion(+) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 2d06823c8..9b6a91a9d 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -1898,6 +1898,7 @@ def export_page(self, page_id, format, layout_name=None): "ID,Name,Status\\n1,Shot 001,ip\\n2, Shot 002,rev\\n" >>> sg.export_page(12345, "csv") "ID,Name,Status\\n1,Shot 001,ip\\n2,Shot 002,rev\\n" + :param int page_id: The ID of the page to export. :param str format: The format to export the page to. Supported format is ``"csv"``. :param str layout_name: Optional layout name. This should be the name of the layout seen in the Flow Production Tracking UI. From 6917d011842cf1371cc6a2f524cedf78e12dc3ae Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 12:07:09 -0800 Subject: [PATCH 4/8] Try without core --- .../build_documentation.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines-templates/build_documentation.yml b/azure-pipelines-templates/build_documentation.yml index 2b437a506..61d7bb4b3 100644 --- a/azure-pipelines-templates/build_documentation.yml +++ b/azure-pipelines-templates/build_documentation.yml @@ -40,15 +40,15 @@ jobs: pip install --upgrade \ https://github.com/shotgunsoftware/tk-toolchain/archive/${{ parameters.tk_toolchain_ref }}.zip - - task: Bash@3 - displayName: Clone the tk-core repository - inputs: - targetType: inline - script: | - git clone --depth 1 \ - --branch ${{ parameters.tk_core_ref }} \ - https://github.com/shotgunsoftware/tk-core \ - ../tk-core + # - task: Bash@3 + # displayName: Clone the tk-core repository + # inputs: + # targetType: inline + # script: | + # git clone --depth 1 \ + # --branch ${{ parameters.tk_core_ref }} \ + # https://github.com/shotgunsoftware/tk-core \ + # ../tk-core - task: Bash@3 displayName: Build Shpinx Documentation From 02e3a23f60ec1c7229b399723fd4e087596728c1 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 12:33:15 -0800 Subject: [PATCH 5/8] Cleanups --- azure-pipelines-templates/build_documentation.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/azure-pipelines-templates/build_documentation.yml b/azure-pipelines-templates/build_documentation.yml index 61d7bb4b3..27a2722bf 100644 --- a/azure-pipelines-templates/build_documentation.yml +++ b/azure-pipelines-templates/build_documentation.yml @@ -25,10 +25,7 @@ jobs: - task: UsePythonVersion@0 displayName: Use Python 3.10 inputs: - versionSpec: 3.10 - -## TODO switch to Py 3.11 Pyside6 -# NOPE tk-ci-tools knows we don'T need PySide for this one + versionSpec: "3.10" - task: Bash@3 displayName: Install Python dependencies @@ -40,16 +37,6 @@ jobs: pip install --upgrade \ https://github.com/shotgunsoftware/tk-toolchain/archive/${{ parameters.tk_toolchain_ref }}.zip - # - task: Bash@3 - # displayName: Clone the tk-core repository - # inputs: - # targetType: inline - # script: | - # git clone --depth 1 \ - # --branch ${{ parameters.tk_core_ref }} \ - # https://github.com/shotgunsoftware/tk-core \ - # ../tk-core - - task: Bash@3 displayName: Build Shpinx Documentation inputs: From de1d8796a3c49fef0f129d2292acc6c6c25a3d2b Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 17:17:13 -0800 Subject: [PATCH 6/8] Tests --- .../build_documentation.yml | 44 ------------------- azure-pipelines.yml | 15 ++++++- 2 files changed, 13 insertions(+), 46 deletions(-) delete mode 100644 azure-pipelines-templates/build_documentation.yml diff --git a/azure-pipelines-templates/build_documentation.yml b/azure-pipelines-templates/build_documentation.yml deleted file mode 100644 index 27a2722bf..000000000 --- a/azure-pipelines-templates/build_documentation.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2025 Shotgun Software Inc. -# -# CONFIDENTIAL AND PROPRIETARY -# -# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit -# Source Code License included in this distribution package. See LICENSE. -# By accessing, using, copying or modifying this work you indicate your -# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights -# not expressly granted therein are reserved by Shotgun Software Inc. - -parameters: - # Git ref of tk-toolchain to use. - tk_toolchain_ref: ticket/SG-40980-docs-warning-on-error-always - # Git ref of tk-core to use. - tk_core_ref: master - - -jobs: -- job: build_documentation - displayName: Build Sphinx Documentation - pool: - vmImage: ubuntu-latest - - steps: - - task: UsePythonVersion@0 - displayName: Use Python 3.10 - inputs: - versionSpec: "3.10" - - - task: Bash@3 - displayName: Install Python dependencies - inputs: - targetType: inline - script: | - pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade \ - https://github.com/shotgunsoftware/tk-toolchain/archive/${{ parameters.tk_toolchain_ref }}.zip - - - task: Bash@3 - displayName: Build Shpinx Documentation - inputs: - targetType: inline - script: tk-docs-preview --build-only --verbose diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c5829692..786a01c18 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,6 +26,14 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +resources: + repositories: + - repository: templates + type: github + name: shotgunsoftware/tk-ci-tools + ref: refs/heads/master + endpoint: shotgunsoftware + # We've stored some variables in Azure. They contain credentials # and are encrypted. They are also not available to clients. # This statement says which variable groups this repo requires. @@ -51,9 +59,12 @@ pr: # This here is the list of jobs we want to run for our build. # Jobs run in parallel. jobs: -- template: azure-pipelines-templates/code_style_validation.yml +- template: build-pipeline.yml@templates + parameters: + has_unit_tests: false + has_ui_resources: false + - template: azure-pipelines-templates/type_checking.yml -- template: azure-pipelines-templates/build_documentation.yml # These are jobs templates, they allow to reduce the redundancy between # variations of the same build. We pass in the image name From c2b25b492cf7e3766015eda3a76c74e8511d371b Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 17:17:39 -0800 Subject: [PATCH 7/8] ee --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 786a01c18..c50d5a4d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,7 +31,7 @@ resources: - repository: templates type: github name: shotgunsoftware/tk-ci-tools - ref: refs/heads/master + ref: refs/heads/ticket/SG-41463 endpoint: shotgunsoftware # We've stored some variables in Azure. They contain credentials From b9a0fce71023d66e6f26e2d796eb7a66acf6b4ec Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 11 Dec 2025 20:22:11 -0800 Subject: [PATCH 8/8] Cleanup --- .pre-commit-config.yaml | 6 -- .../code_style_validation.yml | 59 ------------------- azure-pipelines.yml | 3 +- 3 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 azure-pipelines-templates/code_style_validation.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 320aed3bb..537da22cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,9 +47,3 @@ repos: rev: 25.1.0 hooks: - id: black - -### does not work .... lots of errors -# - repo: https://github.com/pycqa/flake8 -# rev: 7.3.0# -# hooks: -# - id: flake8 diff --git a/azure-pipelines-templates/code_style_validation.yml b/azure-pipelines-templates/code_style_validation.yml deleted file mode 100644 index 7884f9ea6..000000000 --- a/azure-pipelines-templates/code_style_validation.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2024, Shotgun Software Inc. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# - Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# - Neither the name of the Shotgun Software Inc nor the names of its -# contributors may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -jobs: -- job: code_style_validation - displayName: Code Style Validation - pool: - vmImage: ubuntu-latest - - steps: - - task: UsePythonVersion@0 - displayName: Use Python 3.10 - inputs: - versionSpec: 3.10 - - - task: Bash@3 - displayName: Install Python dependencies - inputs: - targetType: inline - script: | - pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade pre-commit - - - task: Bash@3 - displayName: Update pre-commit hook versions - inputs: - targetType: inline - script: pre-commit autoupdate - - - task: Bash@3 - displayName: Validate code - inputs: - targetType: inline - script: pre-commit run --all diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c50d5a4d4..9088422a3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,6 +33,7 @@ resources: name: shotgunsoftware/tk-ci-tools ref: refs/heads/ticket/SG-41463 endpoint: shotgunsoftware + ### Yes, this is not Toolkit but tk-ci-tools is a useful utility that we can use to avoid duplicating and maintaing CI pipelines # We've stored some variables in Azure. They contain credentials # and are encrypted. They are also not available to clients. @@ -61,7 +62,7 @@ pr: jobs: - template: build-pipeline.yml@templates parameters: - has_unit_tests: false + has_unit_tests: false # Python API does not follow the same Python version lifecycle than Toolkit has_ui_resources: false - template: azure-pipelines-templates/type_checking.yml