Skip to content

Commit de04e56

Browse files
SG-30910 Support latest version of Sphinx (#52)
* Support latest version of Sphinx * Remove whitespace * Condition sphinx version for 3.7 * Use tk-core branch for this ticket * Update pyside6 link * Remove tk-core-ref
1 parent 2bb9869 commit de04e56

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

setup.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# -*- coding: utf-8 -*-
1313

1414
import os
15+
import sys
1516
import codecs
1617
from setuptools import setup, find_packages
1718

@@ -29,7 +30,7 @@ def read_file(fname):
2930

3031
setup(
3132
name="tk-toolchain",
32-
version="0.2.0.dev",
33+
version="0.2.1.dev",
3334
author="Autodesk",
3435
author_email="https://developer.shotgridsoftware.com",
3536
maintainer="Autodesk",
@@ -65,21 +66,16 @@ def read_file(fname):
6566
# Tests
6667
"pytest==7.4.2",
6768
"pytest-cov==4.1.0",
68-
# Locking down these 3 tools to these specific versions is important
69+
# Locking down these 2 tools to these specific versions is important
6970
# because we should use the same tools that tk-core ships with.
7071
"mock==5.1.0",
71-
"coverage==7.2.7", # supports Python 3.7
72+
"coverage==7.2.7",
7273
# Doc generation
7374
"PyYAML",
74-
# Use the latest version of Sphinx that supports Python 2 and 3.
75-
# We have some rendering issues on Sphinx 2, notably bullet list in .rst items
76-
# get rendered to html without the * in front.
77-
"sphinx==1.8.5",
78-
"sphinx_rtd_theme==0.4.3",
75+
"sphinx==7.0.0" if sys.version_info[0:2] >= (3, 9) else "sphinx==5.3.0",
76+
"sphinx_rtd_theme==1.3.0",
7977
"docopt==0.6.2",
8078
"six==1.14.0",
81-
# Lock down docutils because 0.18 break the build.
82-
"docutils==0.17.1",
8379
# Lock down jinja because 3.1.0 breaks the build.
8480
"jinja2==3.0.3",
8581
# Other tools used by devs that are useful to have.

tk_toolchain/cmd_line_tools/tk_docs_generation/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,20 @@ def main(arguments=None):
192192
return 0
193193

194194
# Make sure Qt is available if we're dealing with Toolkit repos.
195-
if not repo.is_python_api():
195+
if not repo.is_python_api() and not repo.is_sg_jira_bridge():
196196
try:
197-
import PySide # noqa
197+
import PySide2 # noqa
198198
except ImportError:
199199
try:
200-
import PySide2 # noqa testing importability, ignore unused import
200+
import PySide6 # noqa
201201
except ImportError:
202-
log.error(
203-
"PySide or PySide2 are required to build the documentation."
204-
)
205-
return 1
206-
202+
try:
203+
import PySide # noqa
204+
except ImportError:
205+
log.error(
206+
"PySide, PySide2, or PySide6 are required to build the documentation."
207+
)
208+
return 1
207209
# If the specified the core path, we'll use it.
208210
if options.core:
209211
core_path = util.expand_path(options.core)

tk_toolchain/cmd_line_tools/tk_docs_generation/sphinx_data/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def setup(app):
212212
#
213213
# This is also used if you do content translation via gettext catalogs.
214214
# Usually you set "language" from the command line for these cases.
215-
language = None
215+
language = "en"
216216

217217
# There are two options for replacing |today|: either, you set today to some
218218
# non-false value, then it is used:
@@ -365,9 +365,10 @@ def setup(app):
365365
# external references. This allows for proper cross referencing between bundles
366366
# and extrnal libs
367367
intersphinx_mapping = {
368-
"python": ("https://docs.python.org/2", None),
368+
"python": ("https://docs.python.org/3.9", None),
369369
"PySide": ("http://pyside.github.io/docs/pyside/", None),
370-
"PySide2": ("https://doc.qt.io/qtforpython", None),
370+
"PySide2": ("https://doc.qt.io/qtforpython-5", None),
371+
"PySide6": ("https://doc.qt.io/qtforpython-6", None),
371372
"sgtk": ("http://developer.shotgridsoftware.com/tk-core/", None),
372373
"tk-framework-qtwidgets": (
373374
"http://developer.shotgridsoftware.com/tk-framework-qtwidgets/",

tk_toolchain/repo.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ def is_python_api(self):
178178
"""
179179
return self._folder_contains("shotgun_api3")
180180

181+
def is_sg_jira_bridge(self):
182+
"""
183+
Check if the repository is for the Jira Bridge
184+
185+
:returns: ``True`` is the repository is for the Jira Bridge, ``False`` otherwise.
186+
"""
187+
return self._folder_contains("sg_jira")
188+
181189
def _folder_contains(self, filename):
182190
"""
183191
Check if a given file is under the root.

0 commit comments

Comments
 (0)