Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.
#
# coverage.py configuration (https://pypi.org/project/coverage/)
#

[run]
omit=
resources/*
tests/*
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exclude: "(resources\/.*)|(tests\/python\/(websocket|websocket_client.*|six-.*)\
# List of super useful formatters.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v6.0.0
hooks:
# Ensures the code is syntaxically correct
- id: check-ast
Expand All @@ -37,7 +37,7 @@ repos:
- id: check-yaml
# Leave black at the bottom so all touchups are done before it is run.
- repo: https://github.com/psf/black
rev: 25.1.0
rev: 26.1.0
hooks:
- id: black
language_version: python3
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[![VFX Platform](https://img.shields.io/badge/vfxplatform-2025%20%7C%202024%20%7C%202023%20%7C%202022-blue.svg)](http://www.vfxplatform.com/)
[![Python](https://img.shields.io/badge/python-3.11%20%7C%203.10%20%7C%203.9-blue.svg)](https://www.python.org/)
[![Supported VFX Platform: CY2022 - CY2025](https://img.shields.io/badge/VFX_Reference_Platform-CY2022_|_CY2023_|_CY2024_|_CY20255-blue)](http://www.vfxplatform.com/ "Supported VFX Reference Platform versions")
[![Supported Python versions: 3.9, 3.10, 3.11](https://img.shields.io/badge/Python-3.9_|_3.10_|_3.11-blue?logo=python&logoColor=f5f5f5)](https://www.python.org/ "Supported Python versions")

[![Build Status](https://dev.azure.com/shotgun-ecosystem/Toolkit/_apis/build/status/shotgunsoftware.tk-framework-desktopserver?branchName=master)](https://dev.azure.com/shotgun-ecosystem/Toolkit/_build/latest?definitionId=81&branchName=master)
[![codecov](https://codecov.io/gh/shotgunsoftware/tk-framework-desktopserver/branch/master/graph/badge.svg)](https://codecov.io/gh/shotgunsoftware/tk-framework-desktopserver)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Linting](https://img.shields.io/badge/PEP8%20by-Hound%20CI-a873d1.svg)](https://houndci.com)

# Toolkit Framework Desktop Server

Expand Down
19 changes: 13 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,22 @@ jobs:
- Twisted==22.10.0 # Last version supporting Python 3.7
- websocket-client==1.6.1 # Last version supporting Python 3.7
post_tests_steps:
- bash: python -m pytest tests/integration_tests/interpreters.py -v
- task: Bash@3
displayName: Run interpreter integration tests
inputs:
targetType: inline
script: |
python -m pytest \
--cov \
--nunit-xml=test-results-interpreters.xml \
--verbose \
tests/integration_tests/interpreters.py
env:
CI: 1 # Used to skip certain tests on Azure

COVERAGE_FILE: .coverage.interpreters
# Use a specific name so tk-ci-tools will properly coverage combine

SHOTGUN_HOST: $(sg.ci.host)
SHOTGUN_SCRIPT_NAME: $(sg.ci.script.name)
SHOTGUN_SCRIPT_KEY: $(sg.ci.script.key)
Expand All @@ -53,8 +65,3 @@ jobs:
# Sandbox each test executing based on the Azure agent name. Those are
# Azure Pipelines 1-10
SHOTGUN_TEST_ENTITY_SUFFIX: '$(Agent.Name)'

- ${{ if and(not(endsWith( variables['System.PullRequest.SourceBranch'], '-automated')), ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))) }}:
- template: resources/python/pipelines/pipelines.yml
parameters:
branch: $(System.PullRequest.SourceBranch)-automated
1 change: 0 additions & 1 deletion python/tk_framework_desktopserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import sgtk.util


# framework path
base_path = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
Expand Down
6 changes: 3 additions & 3 deletions python/tk_framework_desktopserver/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def get_project_actions(self, pipeline_config_paths):
shotgun_get_actions_dict[env_filename] = {}
shotgun_cache_actions_dict[cache_filename] = {}

(out, err, code) = self.execute_toolkit_command(
out, err, code = self.execute_toolkit_command(
pipeline_config_path,
"shotgun_get_actions",
[cache_filename, env_filename],
Expand All @@ -288,7 +288,7 @@ def get_project_actions(self, pipeline_config_paths):
)

if code == 1:
(out, err, code) = self.execute_toolkit_command(
out, err, code = self.execute_toolkit_command(
pipeline_config_path,
"shotgun_cache_actions",
[entity, cache_filename],
Expand All @@ -298,7 +298,7 @@ def get_project_actions(self, pipeline_config_paths):
)

if code == 0:
(out, err, code) = self.execute_toolkit_command(
out, err, code = self.execute_toolkit_command(
pipeline_config_path,
"shotgun_get_actions",
[cache_filename, env_filename],
Expand Down
2 changes: 1 addition & 1 deletion python/tk_framework_desktopserver/shotgun/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def executeToolkitCommand(self, data):
self.host.report_error(message)

try:
(out, err, returncode) = self.process_manager.execute_toolkit_command(
out, err, returncode = self.process_manager.execute_toolkit_command(
pipeline_config_path, command, args
)
self._handle_toolkit_output(out, err, returncode)
Expand Down
8 changes: 3 additions & 5 deletions python/tk_framework_desktopserver/shotgun/api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _execute_action(self, data):
# The arguments list is the name of the command, then the entity
# type, and then a comma-separated list of entity ids.
entity_ids = [str(e["id"]) for e in entities]
(out, err, retcode) = self.process_manager.execute_toolkit_command(
out, err, retcode = self.process_manager.execute_toolkit_command(
config_entity[constants.LEGACY_CONFIG_ROOT],
"shotgun_run_action",
[data["name"], entities[0]["type"], ",".join(entity_ids)],
Expand Down Expand Up @@ -1017,11 +1017,9 @@ def _write_commands_to_db(self, commands, config_data, contents_hash):
self._engine.log_debug("Creating schema in sqlite db.")

# We have a brand new database. Create all tables and indices.
cursor.executescript(
"""
cursor.executescript("""
CREATE TABLE engine_commands (lookup_hash text, contents_hash text, commands blob);
"""
)
""")

connection.commit()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def core_info(engine):
% (lv, req_sg)
)
elif status == TankCoreUpdater.UPDATE_POSSIBLE:
(summary, url) = installer.get_release_notes()
summary, url = installer.get_release_notes()

engine.log_info("*A new version of the Toolkit API (%s) is available!*" % lv)
engine.log_info(
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/config/bundles/test_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""
A dummy app
"""

import os
from sgtk.platform import Application

Expand Down
4 changes: 0 additions & 4 deletions tests/integration_tests/interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,3 @@ def test_get_actions(self):
("python", self.test_app_name, "Command A"),
("python", self.test_app_name, "Command B"),
}


if __name__ == "__main__":
ret_val = unittest.main(failfast=True, verbosity=2)