From 61eb3ba1e7e91ed15bf08bfa04935b6efe18294a Mon Sep 17 00:00:00 2001 From: M Pacer Date: Sat, 24 Feb 2018 11:57:07 -0800 Subject: [PATCH] change the way we set booktabs to use the internal mechanism MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The set_table_style api was borked with 0.13… it expects a string, but then iterates over it as though it were a list/tuple of strings. Internally it falls back to the settings.table_style value, so we'll use that. --- publisher/writer/__init__.py | 10 +--------- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/publisher/writer/__init__.py b/publisher/writer/__init__.py index 0392c3efef..a575015521 100644 --- a/publisher/writer/__init__.py +++ b/publisher/writer/__init__.py @@ -57,14 +57,7 @@ def __init__(self, *args, **kwargs): self.figure_type = 'figure' self.figure_alignment = 'left' self.table_type = 'table' - - try: - self.active_table.set_table_style('booktabs') - except TypeError: - raise TypeError( - "You are running into an error because you are using docutils " - "version {}, instead please install docutils version {}".format(dc.__version__, '0.12.0') - ) + self.settings.table_style = ['booktabs'] def visit_docinfo(self, node): pass @@ -395,7 +388,6 @@ def depart_table(self, node): self.out.append(r'\end{%s}' % self.table_type) self.active_table.set('preamble written', 1) - self.active_table.set_table_style('booktabs') def visit_thead(self, node): # Store table caption locally and then remove it diff --git a/requirements.txt b/requirements.txt index cd131a165e..cbedc77cb2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,4 @@ pygments pytest testpath ##### requirements with version specifiers -docutils == 0.12 +docutils >= 0.14