Skip to content

Commit

Permalink
Fix python3 compatibility and switch travis to python3
Browse files Browse the repository at this point in the history
Python2 is EOL. Switch to py3. The move to python3 requires the 'typing'
package to be installed. Add it to the travisci file. Also update to
'focal' Ubuntu release to get a python newer than 3.3.

This patch reworks the use of git-describe to work out the document
version number. The existing code falls over when using Sphinx on Python
3 due to the string datatype changes. Wrap the output of subprocess with
str() to fix.

Finally, the changebar version build is currently failing and causing
latex to stall. Drop it for now until it can be resolved.

Signed-off-by: Grant Likely <[email protected]>
  • Loading branch information
glikely committed Sep 17, 2020
1 parent 045ff32 commit a4ef87f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
26 changes: 12 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: false
dist: trusty
dist: focal

cache:
apt: true
Expand All @@ -15,40 +15,38 @@ git:
addons:
apt:
packages:
- python-pip
- python3-pip
- latexmk
- libalgorithm-diff-perl
- texlive
- texlive-latex-extra
- texlive-humanities
- texlive-generic-recommended
- graphviz
- texlive-generic-extra

install:
- pip install --user mako
- pip install --user Sphinx
- pip install --user codespell
- pip3 install --user mako
- pip3 install --user typing
- pip3 install --user Sphinx
- pip3 install --user codespell

before_script:
- wget https://github.com/ftilmann/latexdiff/releases/download/1.2.1/latexdiff-1.2.1.tar.gz
- tar xvf latexdiff-1.2.1.tar.gz
- export PATH=$PWD/latexdiff-1.2.1/:$PATH

script:
- make check
- git checkout $DIFF_COMMIT
#- git checkout $DIFF_COMMIT
#- make latexpdf
#- mv build/latex build/latex-previous
#- git checkout $TRAVIS_COMMIT
- make latexpdf
- mv build/latex build/latex-previous
- git checkout $TRAVIS_COMMIT
- make latexpdf
- make latexdiff
#- make latexdiff
- make html
- make singlehtml

before_deploy:
- cp build/latex/devicetree-specification.pdf build/devicetree-specification-$TRAVIS_TAG.pdf
- cp build/latex/devicetree-specification-changebars.pdf build/devicetree-specification-changebars-$TRAVIS_TAG.pdf
#- cp build/latex/devicetree-specification-changebars.pdf build/devicetree-specification-changebars-$TRAVIS_TAG.pdf

deploy:
- provider: releases
Expand Down
2 changes: 1 addition & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def setup(app):
#
# The short X.Y version.
try:
version = subprocess.check_output(["git", "describe", "--dirty"]).strip().encode()
version = str(subprocess.check_output(["git", "describe", "--dirty"]), 'utf-8').strip()
except:
version = "unknown-rev"
# The full version, including alpha/beta/rc tags.
Expand Down

0 comments on commit a4ef87f

Please sign in to comment.