Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG-37774 Remove Python 2 traces #133

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion python/shotgun_desktop/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(self, reason, toolkit_path):

class EngineNotCompatibleWithDesktop16(ShotgunDesktopError):
def __init__(self, app_version):
super(EngineNotCompatibleWithDesktop16, self).__init__(
super().__init__(
"Your version of tk-desktop is not compatible with this PTR desktop app {}.\n"
"\n"
"Please upgrade your site configuration's tk-desktop to v2.5.9+ or "
Expand Down
2 changes: 1 addition & 1 deletion python/shotgun_desktop/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
import sys
from tank_vendor.six.moves.urllib import parse
from urllib import parse
import pprint
import sgtk

Expand Down
13 changes: 0 additions & 13 deletions python/shotgun_desktop/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.

from __future__ import absolute_import

import os
import sys
import time
Expand Down Expand Up @@ -552,17 +550,6 @@ def __start_engine_in_zero_config(app, app_bootstrap, splash, user):

mgr = sgtk.bootstrap.ToolkitManager(user)

# If 'SHOTGUN_PYTHON_VERSION' environment variable has been set, but at this point
# we are running in Python 3 we should warn the user that this will have no
# effect as there is no Python 2 version available.
if str(os.environ.get("SHOTGUN_PYTHON_VERSION")) == "2" and sys.version_info[0] > 2:
DesktopMessageBox.critical(
"Flow Production Tracking Warning",
"{constant} will have no effect because there's not Python 2 available version.\n".format(
constant="SHOTGUN_PYTHON_VERSION"
),
)

julien-lang marked this conversation as resolved.
Show resolved Hide resolved
# Allows to take over the site config to use with Desktop without impacting the projects
# configurations.
mgr.base_configuration = os.environ.get(
Expand Down
15 changes: 1 addition & 14 deletions python/shotgun_desktop/upgrade_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def _supports_get_from_location_and_paths(sgtk):

def _out_of_date_check(latest_descriptor, current_desc):
"""
Check if the version is out of date, this prevents an upgrade of the startup logic
in the event that it detects PTR desktop app is running on Python 2.
Check if the version is out of date.

:param latest_descriptor:`sgtk.descriptor.FrameworkDescriptor` instance with the latest startup descriptor.
:param current_desc:`sgtk.descriptor.FrameworkDescriptor` instance with the current startup descriptor.
Expand All @@ -44,18 +43,6 @@ def _out_of_date_check(latest_descriptor, current_desc):
appstore. False otherwise.
"""

# If we're running in Python 2 and if the bundled framework exists on disk,
# returns False to avoid upgrade the startup logic.
if sys.version_info[0] < 3 and os.path.exists(current_desc.get_path()):
logger.debug(
"Using Python version '%s'"
% ".".join(str(i) for i in sys.version_info[0:3])
)
logger.debug(
"Desktop startup is Currently running version %s"
% current_desc.get_version(),
)
return False
carlos-villavicencio-adsk marked this conversation as resolved.
Show resolved Hide resolved
return latest_descriptor.get_version() != current_desc.get_version()


Expand Down
22 changes: 0 additions & 22 deletions software_credits
Original file line number Diff line number Diff line change
Expand Up @@ -541,25 +541,3 @@ SOFTWARE.
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


=== six (https://pypi.org/project/six/) ============================

Copyright (c) 2010-2019 Benjamin Peterson

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
carlos-villavicencio-adsk marked this conversation as resolved.
Show resolved Hide resolved