Skip to content
Open
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
5 changes: 5 additions & 0 deletions apps/connect/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ftrack Connect release Notes

## Upcoming

* [new] Support for overriding the Photoshop standalone Python interpreter executable path, by adding 'standalone_interpreter' setting to launch config. It can also be overridden by setting FTRACK_CONNECT_STANDALONE_INTERPRETER environment variable, or by modifying the launch event.


## v3.0.0
2024-04-02

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ def _search_filesystem(
variant='',
description=None,
integrations=None,
standalone_module=None,
extensions_path=None,
standalone_module=None,
standalone_interpreter=None,
environment_variables=None,
connect_plugin_path=None,
rosetta=False,
Expand Down Expand Up @@ -245,10 +246,13 @@ def _search_filesystem(
*integrations* is the list of integrations that are required for this
application to run.

*extensions_path* is a raw dictionary containing extension paths.

*standalone_module* is the name of the standalone module that should be
launched together with the application.

*extensions_path* is a raw dictionary containing extension paths.
*standalone_interpreter* is the name of the standalone module that should be
launched together with the application.

*environment_variables* is a dictionary of environment variables that
should be set when launching the application.
Expand Down Expand Up @@ -364,6 +368,29 @@ def _search_filesystem(
application[
'standalone_module'
] = standalone_module
if standalone_interpreter:
self.logger.debug(
f'Using overridden standalone Python interpreter '
f'from env: {standalone_interpreter}'
)
application[
'standalone_interpreter'
] = standalone_interpreter
elif (
not standalone_interpreter
and 'FTRACK_CONNECT_STANDALONE_INTERPRETER'
in os.environ
):
standalone_interpreter = os.environ[
'FTRACK_CONNECT_STANDALONE_INTERPRETER'
]
self.logger.debug(
f'Using overridden standalone Python interpreter '
f'from launch config: {standalone_interpreter}'
)
application[
'standalone_interpreter'
] = standalone_interpreter
application['environment_variables'] = {}
if extensions_path:
# Convert to list and expand paths
Expand Down Expand Up @@ -571,6 +598,9 @@ def launch(self, applicationIdentifier, context=None):
'version': None,
'env': application.get('environment_variables', {}),
'launch_arguments': [],
'standalone_interpreter': application.get(
'standalone_interpreter', {}
),
},
platform=self.current_os,
)
Expand Down Expand Up @@ -618,6 +648,29 @@ def launch(self, applicationIdentifier, context=None):
application = launchData['application']
options['env'] = environment

standalone_interpreter = None
if 'standalone_module' in application:
# Check if interpreter is overridden
for r in results:
if (
'integration' in r
and 'standalone_interpreter' in r['integration']
):
standalone_interpreter = r['integration'][
'standalone_interpreter'
]
self.logger.info(
f'Standalone interpreter overridden at launch: {standalone_interpreter}'
)
break
if (
not standalone_interpreter
and 'standalone_interpreter' in application
):
standalone_interpreter = application[
'standalone_interpreter'
]

enable_app_bundle_launch = (
True # Allow .app to be launched directly on Mac
)
Expand Down Expand Up @@ -754,19 +807,29 @@ def launch(self, applicationIdentifier, context=None):
)

command = []
executable_filename = sys.argv[0]
if not executable_filename.endswith('.py'):
command.append(executable_filename)
if standalone_interpreter:
# Use this instead of Connect
command.extend(
[
standalone_interpreter,
"-m",
application['standalone_module'],
]
)
else:
# Support invocation through Python interpreter
command.extend([sys.executable, executable_filename])

command.extend(
[
"--run-framework-standalone",
application['standalone_module'],
]
)
executable_filename = sys.argv[0]
if not executable_filename.endswith('.py'):
command.append(executable_filename)
else:
# Support invocation through Python interpreter
command.extend([sys.executable, executable_filename])

command.extend(
[
"--run-framework-standalone",
application['standalone_module'],
]
)

# Append PID to environment for framework to use.
environment['FTRACK_APPLICATION_PID'] = str(process.pid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ def _build_launchers(self, configurations):
variant=config['variant'],
launchArguments=launch_arguments,
integrations=config.get('integrations'),
standalone_module=config.get('standalone_module'),
extensions_path=config.get('extensions_path'),
standalone_module=config.get('standalone_module'),
standalone_interpreter=config.get(
'standalone_interpreter'
),
environment_variables=config.get('environment_variables'),
connect_plugin_path=os.path.realpath(
os.path.join(os.path.dirname(config_path), '..')
Expand Down