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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exclude: "tank_vendor|third_party|ui\/.*py$|\/.*png|\/.*pickle|test_post_update_
# List of super useful formatters.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
# Ensures the code is syntaxically correct
- id: check-ast
Expand Down Expand Up @@ -54,7 +54,7 @@ repos:
exclude: "scripts\/tank_cmd.bat|setup\/root_binaries\/tank.bat"
# 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
exclude: "tests|python\/tank"
13 changes: 5 additions & 8 deletions developer/bake_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def main():

desc = "Bake a self contained Toolkit config from a descriptor"

epilog = """
epilog = f"""

Details and Examples
--------------------
Expand All @@ -211,17 +211,14 @@ def main():
By default, all bundle types are cached. If you want to omit certain types, simply provide a comma seperated list
of bundle types to skip, e.g. --skip-bundle-types=app_store,shotgun,github_release.

{automated_setup_documentation}
f{automated_setup_documentation}

For information about the various descriptors that can be used, see
http://developer.shotgridsoftware.com/tk-core/descriptor


""".format(
automated_setup_documentation=automated_setup_documentation
).format(
script_name="bake_config.py"
)
"""

parser = OptionParserLineBreakingEpilog(
usage=usage, description=desc, epilog=epilog
)
Expand All @@ -246,7 +243,7 @@ def main():
add_authentication_options(parser)

# parse cmd line
(options, remaining_args) = parser.parse_args()
options, remaining_args = parser.parse_args()

logger.info("Welcome to the Toolkit config baker.")
logger.info("")
Expand Down
8 changes: 3 additions & 5 deletions developer/build_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def build_plugin(
# uri to use at runtime - in the case of baked descriptors, the config_uri_str
# contains a manual descriptor uri and install_path is set with the baked
# folder.
(cfg_descriptor, config_uri_str, install_path) = _process_configuration(
cfg_descriptor, config_uri_str, install_path = _process_configuration(
sg_connection,
source_path,
target_path,
Expand Down Expand Up @@ -728,9 +728,7 @@ def main():
http://developer.shotgridsoftware.com/tk-core/descriptor


""".format(
automated_setup_documentation=automated_setup_documentation
).format(
""".format(automated_setup_documentation=automated_setup_documentation).format(
script_name="build_plugin.py"
)
parser = OptionParserLineBreakingEpilog(
Expand Down Expand Up @@ -769,7 +767,7 @@ def main():
add_authentication_options(parser)

# parse cmd line
(options, remaining_args) = parser.parse_args()
options, remaining_args = parser.parse_args()

logger.info("Welcome to the Toolkit plugin builder.")
logger.info("")
Expand Down
6 changes: 2 additions & 4 deletions developer/populate_bundle_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ def main():
http://developer.shotgridsoftware.com/tk-core/descriptor


""".format(
automated_setup_documentation=automated_setup_documentation
).format(
""".format(automated_setup_documentation=automated_setup_documentation).format(
Comment thread
julien-lang marked this conversation as resolved.
script_name="populate_bundle_cache.py"
)
parser = OptionParserLineBreakingEpilog(
Expand All @@ -163,7 +161,7 @@ def main():
add_authentication_options(parser)

# parse cmd line
(options, remaining_args) = parser.parse_args()
options, remaining_args = parser.parse_args()

logger.info("Welcome to the Toolkit bundle cache builder.")
logger.info("")
Expand Down
1 change: 0 additions & 1 deletion developer/utils/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from tank import LogManager
from tank.authentication import ShotgunAuthenticator


logger = LogManager.get_logger("utils.authentication")

automated_setup_documentation = """For automated build setups, you can provide a specific shotgun API script name and
Expand Down
1 change: 1 addition & 0 deletions hooks/context_additional_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

Contact support if you have any questions about how to migrate away from this hook.
"""

from tank import Hook


Expand Down
1 change: 1 addition & 0 deletions hooks/default_storage_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Hook that gets executed during Toolkit initialization.
This hook makes it possible to modify the default storage root.
"""

import sgtk
from tank import Hook

Expand Down
6 changes: 3 additions & 3 deletions scripts/tank_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def _shotgun_run_action(

elif status == TankCoreUpdater.UPDATE_POSSIBLE:

(summary, url) = installer.get_release_notes()
summary, url = installer.get_release_notes()

logger.info(
"<b>A new version of the Toolkit API (%s) is available!</b>" % lv
Expand Down Expand Up @@ -941,7 +941,7 @@ def _list_commands(tk, ctx):
Outputs a list of commands to the logger given the current context.
"""
# get all the action objets (commands) suitable for the current context
(aa, engine) = get_actions(logger, tk, ctx)
aa, engine = get_actions(logger, tk, ctx)

logger.info("")
logger.info("The following commands are available:")
Expand Down Expand Up @@ -1398,7 +1398,7 @@ def run_engine_cmd(pipeline_config_root, context_items, command, using_cwd, args
entity_search_token = ":".join(entity_search_token.split(":")[1:])

# now try to resolve this project
(project_id, project_name) = _resolve_shotgun_pattern(
project_id, project_name = _resolve_shotgun_pattern(
"Project", proj_token
)
logger.info("- Searching in project '%s' only" % project_name)
Expand Down
1 change: 0 additions & 1 deletion setup/tank_api_proxy/sgtk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import os
import sys


# first look for our parent file
current_folder = os.path.abspath(os.path.dirname(__file__))
file_name_lookup = {
Expand Down
1 change: 0 additions & 1 deletion setup/tank_api_proxy/tank/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import os
import sys


# first look for our parent file
current_folder = os.path.abspath(os.path.dirname(__file__))
file_name_lookup = {
Expand Down
28 changes: 15 additions & 13 deletions tests/integration_tests/run_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import subprocess
import sys
import time
import uuid


def main():
Expand All @@ -36,9 +37,6 @@ def main():
os.path.join(current_folder, "..", "..", "python"),
]
)
environ["SHOTGUN_SCRIPT_NAME"] = os.environ.get("SHOTGUN_SCRIPT_NAME")
environ["SHOTGUN_SCRIPT_KEY"] = os.environ.get("SHOTGUN_SCRIPT_KEY")
environ["SHOTGUN_HOST"] = os.environ.get("SHOTGUN_HOST")

current_folder, current_file = os.path.split(__file__)

Expand All @@ -60,21 +58,25 @@ def main():
if filename.endswith(current_file):
continue

uid = uuid.uuid4()
# Defines a unique id to be used for test results and coverage files

print("=" * 79)
print("Running %s" % os.path.basename(filename))
print("=" * 79)

args = [
sys.executable,
"-m",
"pytest",
filename,
f"--nunit-xml=test-results-{uid}.xml",
"--verbose",
]

if "SHOTGUN_TEST_COVERAGE" in os.environ:
args = [
sys.executable,
"-m",
"coverage",
"run",
"--parallel-mode",
filename,
]
else:
args = [sys.executable, filename]
args.append("--cov")
environ["COVERAGE_FILE"] = f".coverage.{uid}"

subprocess.check_call(args, env=environ)

Expand Down
Loading