Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- Sphinx 1.8.2 -> 2.0.1
- PyYAML 3.13 -> 5.1
- recommonmark 0.4.0 -> 0.5.0
- sphinxcontrib-openapi 0.3.2 -> 0.4.0
- sphinxcontrib-plantuml 0.12 -> 0.15
- Pillow 5.3.0 -> 6.0.0
- sphinx_bootstrap_theme 0.6.5 -> 0.7.1
- sphinx_rtd_theme 0.4.2 -> 0.4.3
- Removed javasphinx which is not maintained anymore.
- Build:
  - PlantUML 1.2018.12 -> plantuml-1.2019.5
  • Loading branch information
trustin committed Apr 28, 2019
1 parent 1c8f8f1 commit 514541c
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 119 deletions.
15 changes: 7 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@ fi
# Install the core packages.
pip install \
'PyInstaller==3.4' \
'PyYAML==3.13' \
'Sphinx==1.8.2'
'PyYAML==5.1' \
'Sphinx==2.0.1'

# Install the extensions.
pip install \
'javasphinx==0.9.15' \
'recommonmark==0.4.0' \
'recommonmark==0.5.0' \
'sphinxcontrib-httpdomain==1.7.0' \
'sphinxcontrib-inlinesyntaxhighlight==0.2' \
'sphinxcontrib-openapi==0.3.2' \
'sphinxcontrib-plantuml==0.12' 'Pillow==5.3.0' \
'sphinxcontrib-openapi==0.4.0' \
'sphinxcontrib-plantuml==0.15' 'Pillow==6.0.0' \
'sphinxcontrib-redoc==1.5.1' \
'sphinxcontrib-websupport==1.1.0' \
'git+https://github.com/shomah4a/sphinxcontrib.youtube.git@404e8f17c2505333a0781a62800c5a8a08ba3c52#egg=sphinxcontrib.youtube' \
'sphinx-markdown-tables==0.0.9'

# Install the themes.
pip install \
'sphinx_bootstrap_theme==0.6.5' \
'sphinx_rtd_theme==0.4.2'
'sphinx_bootstrap_theme==0.7.1' \
'sphinx_rtd_theme==0.4.3'

# Apply some patches and recompile the patched files.
PATCH_DIR="$PWD/patches"
Expand Down
3 changes: 3 additions & 0 deletions hooks/hook-sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
datas.extend(collect_data_files('sphinx_rtd_theme'))
datas.extend(collect_data_files('sphinxcontrib'))
datas.extend(copy_metadata('sphinxcontrib-redoc'))

# https://github.com/pyinstaller/pyinstaller/issues/4100
datas.extend(copy_metadata('jsonschema'))
11 changes: 7 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ cd "$(dirname "$0")"
rm -fr build

# Install or find Python 3.6.
# Note that we can upgrade to 3.7 only after upgrading from Trusty to Xenial.
# See: https://github.com/deadsnakes/issues/issues/63
if [[ "$(uname)" =~ ([Ll]inux) ]]; then
if [[ "$TRAVIS_OS_NAME" == 'linux' ]]; then
sudo add-apt-repository -y ppa:deadsnakes/ppa
Expand All @@ -12,10 +14,11 @@ if [[ "$(uname)" =~ ([Ll]inux) ]]; then
PYTHON=/usr/bin/python3.6
elif [[ "$(uname)" =~ ([Dd]arwin) ]]; then
if [[ "$TRAVIS_OS_NAME" == 'osx' ]]; then
BREW_REPO="$(brew --repo homebrew/core)"
echo "Updating $BREW_REPO"
git -C "$BREW_REPO" fetch --unshallow
brew update
#BREW_REPO="$(brew --repo homebrew/core)"
#echo "Updating $BREW_REPO"
#git -C "$BREW_REPO" fetch --unshallow
#brew update
export HOMEBREW_NO_AUTO_UPDATE=1
brew uninstall --ignore-dependencies --force python || true
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
fi
Expand Down
185 changes: 95 additions & 90 deletions patches/sphinx.diff
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
diff -urN dist.orig/sphinx/builders/applehelp.py dist/sphinx/builders/applehelp.py
--- dist.orig/sphinx/builders/applehelp.py 2018-11-11 14:47:20.000000000 +0900
+++ dist/sphinx/builders/applehelp.py 2018-11-24 09:37:58.181510454 +0900
@@ -11,6 +11,7 @@
from __future__ import print_function

import codecs
+import os
import pipes
import plistlib
import shlex
@@ -231,7 +232,8 @@
try:
p = subprocess.Popen(args,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT,
+ env=_new_env())

output = p.communicate()[0]

@@ -264,7 +266,8 @@
try:
p = subprocess.Popen(args,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT,
+ env=_new_env())

output = p.communicate()[0]

@@ -276,6 +279,17 @@
raise AppleHelpCodeSigningFailed(__('Command not found: %s') % args[0])


diff -urN dist.orig/sphinx/cmd/make_mode.py dist/sphinx/cmd/make_mode.py
--- dist.orig/sphinx/cmd/make_mode.py 2019-04-08 11:25:09.000000000 +0900
+++ dist/sphinx/cmd/make_mode.py 2019-04-28 10:57:34.455970210 +0900
@@ -104,7 +104,7 @@
makecmd = self.makecmd
try:
with cd(self.builddir_join('latex')):
- return subprocess.call([makecmd, 'all-pdf'])
+ return subprocess.run([makecmd, 'all-pdf'], env=_new_env())
except OSError:
print('Error: Failed to run: %s' % makecmd)
return 1
@@ -120,7 +120,7 @@
makecmd = self.makecmd
try:
with cd(self.builddir_join('latex')):
- return subprocess.call([makecmd, 'all-pdf'])
+ return subprocess.run([makecmd, 'all-pdf'], env=_new_env())
except OSError:
print('Error: Failed to run: %s' % makecmd)
return 1
@@ -131,7 +131,7 @@
return 1
try:
with cd(self.builddir_join('texinfo')):
- return subprocess.call([self.makecmd, 'info'])
+ return subprocess.run([self.makecmd, 'info'], env=_new_env())
except OSError:
print('Error: Failed to run: %s' % self.makecmd)
return 1
@@ -171,3 +171,14 @@
if hasattr(make, run_method):
return getattr(make, run_method)()
return make.run_generic_build(args[0])
+
+
+def _new_env():
+ env = dict(os.environ) # make a copy of the environment
+ lp_key = 'LD_LIBRARY_PATH' # for Linux and *BSD.
Expand All @@ -42,31 +43,27 @@ diff -urN dist.orig/sphinx/builders/applehelp.py dist/sphinx/builders/applehelp.
+ else:
+ env.pop(lp_key, None) # last resort: remove the env var
+ return env
+
+
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
app.setup_extension('sphinx.builders.html')
diff -urN dist.orig/sphinx/ext/graphviz.py dist/sphinx/ext/graphviz.py
--- dist.orig/sphinx/ext/graphviz.py 2018-11-11 14:47:20.000000000 +0900
+++ dist/sphinx/ext/graphviz.py 2018-11-24 09:36:52.971512778 +0900
@@ -11,6 +11,7 @@
--- dist.orig/sphinx/ext/graphviz.py 2019-04-08 11:25:09.000000000 +0900
+++ dist/sphinx/ext/graphviz.py 2019-04-28 10:46:16.708261877 +0900
@@ -9,6 +9,7 @@
:license: BSD, see LICENSE for details.
"""

import codecs
+import os
import posixpath
import re
from hashlib import sha1
@@ -246,6 +247,7 @@
if format == 'png':
dot_args.extend(['-Tcmapx', '-o%s.map' % outfn])
import subprocess
@@ -245,7 +246,7 @@

try:
+ p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE, cwd=cwd, env=_new_env())
p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE, cwd=cwd)
except OSError as err:
if err.errno != ENOENT: # No such file or directory
@@ -416,6 +418,17 @@
ret = subprocess.run(dot_args, input=code.encode(), stdout=PIPE, stderr=PIPE,
- cwd=cwd, check=True)
+ cwd=cwd, env=_new_env(), check=True)
if not path.isfile(outfn):
raise GraphvizError(__('dot did not produce an output file:\n[stderr]\n%r\n'
'[stdout]\n%r') % (ret.stderr, ret.stdout))
@@ -402,6 +403,17 @@
copy_asset(src, dst)


Expand All @@ -82,31 +79,39 @@ diff -urN dist.orig/sphinx/ext/graphviz.py dist/sphinx/ext/graphviz.py
+
+
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
# type: (Sphinx) -> Dict[str, Any]
app.add_node(graphviz,
diff -urN dist.orig/sphinx/ext/imgconverter.py dist/sphinx/ext/imgconverter.py
--- dist.orig/sphinx/ext/imgconverter.py 2018-11-11 14:47:20.000000000 +0900
+++ dist/sphinx/ext/imgconverter.py 2018-11-24 09:37:08.971490704 +0900
@@ -9,6 +9,7 @@
--- dist.orig/sphinx/ext/imgconverter.py 2019-04-08 11:25:09.000000000 +0900
+++ dist/sphinx/ext/imgconverter.py 2019-04-28 10:48:46.344087660 +0900
@@ -7,6 +7,7 @@
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import locale
+import os
import subprocess
from subprocess import CalledProcessError, PIPE

from sphinx.errors import ExtensionError
@@ -39,7 +40,8 @@
@@ -37,7 +38,7 @@
try:
args = [self.config.image_converter, '-version']
logger.debug('Invoking %r ...', args)
- p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ env=_new_env())
except (OSError, IOError):
- subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
+ subprocess.run(args, stdout=PIPE, stderr=PIPE, env=_new_env(), check=True)
return True
except OSError:
logger.warning(__('convert command %r cannot be run.'
'check the image_converter setting'),
@@ -98,6 +100,17 @@
return True
@@ -62,7 +63,7 @@
self.config.image_converter_args +
[_from, _to])
logger.debug('Invoking %r ...', args)
- subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
+ subprocess.run(args, stdout=PIPE, stderr=PIPE, env=_new_env(), check=True)
return True
except OSError:
logger.warning(__('convert command %r cannot be run.'
@@ -75,6 +76,17 @@
(exc.stderr, exc.stdout))


+def _new_env():
Expand All @@ -121,38 +126,38 @@ diff -urN dist.orig/sphinx/ext/imgconverter.py dist/sphinx/ext/imgconverter.py
+
+
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
# type: (Sphinx) -> Dict[str, Any]
app.add_post_transform(ImagemagickConverter)
diff -urN dist.orig/sphinx/ext/imgmath.py dist/sphinx/ext/imgmath.py
--- dist.orig/sphinx/ext/imgmath.py 2018-11-11 14:47:20.000000000 +0900
+++ dist/sphinx/ext/imgmath.py 2018-11-24 09:37:20.711474920 +0900
@@ -11,6 +11,7 @@
--- dist.orig/sphinx/ext/imgmath.py 2019-04-08 11:25:09.000000000 +0900
+++ dist/sphinx/ext/imgmath.py 2019-04-28 10:50:00.805987096 +0900
@@ -9,6 +9,7 @@
"""

import codecs
import posixpath
+import os
import re
import shutil
import tempfile
@@ -136,7 +137,7 @@
import subprocess
@@ -133,7 +134,7 @@
command.append('math.tex')

with cd(tempdir):
try:
- p = Popen(command, stdout=PIPE, stderr=PIPE)
+ p = Popen(command, stdout=PIPE, stderr=PIPE, env=_new_env())
except OSError as err:
if err.errno != ENOENT: # No such file or directory
raise
@@ -156,7 +157,7 @@
# type: (List[unicode], unicode) -> Tuple[unicode, unicode]
try:
- subprocess.run(command, stdout=PIPE, stderr=PIPE, cwd=tempdir, check=True)
+ subprocess.run(command, stdout=PIPE, stderr=PIPE, cwd=tempdir, env=_new_env(), check=True)
return path.join(tempdir, 'math.dvi')
except OSError:
logger.warning(__('LaTeX command %r cannot be run (needed for math '
@@ -148,7 +149,7 @@
# type: (List[str], str) -> Tuple[bytes, bytes]
"""Convert DVI file to specific image format."""
try:
- p = Popen(command, stdout=PIPE, stderr=PIPE)
+ p = Popen(command, stdout=PIPE, stderr=PIPE, env=_new_env())
except OSError as err:
if err.errno != ENOENT: # No such file or directory
raise
@@ -345,6 +346,17 @@
- ret = subprocess.run(command, stdout=PIPE, stderr=PIPE, check=True)
+ ret = subprocess.run(command, stdout=PIPE, stderr=PIPE, env=_new_env(), check=True)
return ret.stdout, ret.stderr
except OSError:
logger.warning(__('%s command %r cannot be run (needed for math '
@@ -332,6 +333,17 @@
raise nodes.SkipNode


Expand All @@ -168,5 +173,5 @@ diff -urN dist.orig/sphinx/ext/imgmath.py dist/sphinx/ext/imgmath.py
+
+
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
# type: (Sphinx) -> Dict[str, Any]
app.add_html_math_renderer('imgmath',
6 changes: 3 additions & 3 deletions patches/sphinx_bootstrap_theme.diff
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff -urN dist.orig/sphinx_bootstrap_theme/__init__.py dist/sphinx_bootstrap_theme/__init__.py
--- dist.orig/sphinx_bootstrap_theme/__init__.py 2018-04-12 07:28:04.000000000 +0900
+++ dist/sphinx_bootstrap_theme/__init__.py 2018-04-24 10:14:59.447640178 +0900
--- dist.orig/sphinx_bootstrap_theme/__init__.py 2019-03-30 02:56:20.000000000 +0900
+++ dist/sphinx_bootstrap_theme/__init__.py 2019-04-28 11:08:00.001426140 +0900
@@ -1,5 +1,6 @@
"""Sphinx bootstrap theme."""
import os
+import sys

VERSION = (0, 6, 5)
VERSION = (0, 7, 1)

@@ -8,7 +9,10 @@

Expand Down
8 changes: 4 additions & 4 deletions patches/sphinx_rtd_theme.diff
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff -urN dist.orig/sphinx_rtd_theme/__init__.py dist/sphinx_rtd_theme/__init__.py
--- dist.orig/sphinx_rtd_theme/__init__.py 2018-10-05 20:31:07.000000000 +0900
+++ dist/sphinx_rtd_theme/__init__.py 2018-11-24 08:59:14.763484412 +0900
--- dist.orig/sphinx_rtd_theme/__init__.py 2019-02-13 04:37:55.000000000 +0900
+++ dist/sphinx_rtd_theme/__init__.py 2019-04-28 11:02:47.203040056 +0900
@@ -4,6 +4,7 @@

"""
from os import path
+import sys

__version__ = '0.4.2'
__version__ = '0.4.3'
__version_full__ = __version__
@@ -11,7 +12,10 @@

Expand All @@ -20,4 +20,4 @@ diff -urN dist.orig/sphinx_rtd_theme/__init__.py dist/sphinx_rtd_theme/__init__.
+ cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
return cur_dir

# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package

15 changes: 8 additions & 7 deletions patches/sphinxcontrib-plantuml.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -urN -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.py
--- dist.orig/sphinxcontrib/plantuml.py 2018-07-22 13:43:31.000000000 +0900
+++ dist/sphinxcontrib/plantuml.py 2018-08-12 17:22:24.619860343 +0900
@@ -183,7 +183,8 @@
diff -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.py
--- dist.orig/sphinxcontrib/plantuml.py 2019-04-12 08:20:15.000000000 +0900
+++ dist/sphinxcontrib/plantuml.py 2019-04-28 11:15:08.938191235 +0900
@@ -201,7 +201,8 @@
fileformat),
stdout=f, stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand All @@ -11,7 +11,7 @@ diff -urN -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.p
except OSError as err:
if err.errno != ENOENT:
raise
@@ -204,7 +205,8 @@
@@ -222,7 +223,8 @@
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand All @@ -21,7 +21,7 @@ diff -urN -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.p
except OSError as err:
if err.errno != ENOENT:
raise
@@ -345,13 +347,15 @@
@@ -376,13 +378,15 @@
try:
try:
p = subprocess.Popen(args, stdout=subprocess.PIPE,
Expand All @@ -39,7 +39,7 @@ diff -urN -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.p
except OSError as err:
if err.errno != ENOENT:
raise
@@ -437,6 +441,16 @@
@@ -496,6 +500,17 @@
}


Expand All @@ -52,6 +52,7 @@ diff -urN -urN dist.orig/sphinxcontrib/plantuml.py dist/sphinxcontrib/plantuml.p
+ else:
+ env.pop(lp_key, None) # last resort: remove the env var
+ return env
+
+
def setup(app):
app.add_node(plantuml, **_NODE_VISITORS)
Expand Down
Loading

0 comments on commit 514541c

Please sign in to comment.