From 3cc430b41814b1d7b30a3266ba6a39a6bda3fa32 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 17 Nov 2019 20:30:07 +0300 Subject: [PATCH] Update docutils and remove docutils workaround --- pelican/readers.py | 13 ------------- poetry.lock | 8 ++++---- pyproject.toml | 2 +- setup.py | 5 +++-- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index c650913f..653464af 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -201,18 +201,6 @@ class RstReader(BaseReader): writer_class = PelicanHTMLWriter field_body_translator_class = _FieldBodyTranslator - class FileInput(docutils.io.FileInput): - """Patch docutils.io.FileInput to remove "U" mode in py3. - - Universal newlines is enabled by default and "U" mode is deprecated - in py3. - - """ - - def __init__(self, *args, **kwargs): - kwargs['mode'] = kwargs.get('mode', 'r').replace('U', '') - docutils.io.FileInput.__init__(self, *args, **kwargs) - def __init__(self, *args, **kwargs): super(RstReader, self).__init__(*args, **kwargs) @@ -273,7 +261,6 @@ class RstReader(BaseReader): pub = docutils.core.Publisher( writer=self.writer_class(), - source_class=self.FileInput, destination_class=docutils.io.StringOutput) pub.set_components('standalone', 'restructuredtext', 'html') pub.process_programmatic_settings(None, extra_params, None) diff --git a/poetry.lock b/poetry.lock index 50ba33bc..3b85d1d2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -50,8 +50,8 @@ category = "main" description = "Docutils -- Python Documentation Utilities" name = "docutils" optional = false -python-versions = "*" -version = "0.14" +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "0.15.2" [[package]] category = "dev" @@ -392,7 +392,7 @@ version = "0.5.1" markdown = ["markdown"] [metadata] -content-hash = "0163177d87dca0955d111319de9481cf2ed0ef014e63a3740ffaf32a1cf07212" +content-hash = "b8fa239ebaf9bf4bcd5c2e02cf94d065a1add4e19d8354cedf19db6378d6b848" python-versions = "^3.5" [metadata.hashes] @@ -401,7 +401,7 @@ babel = ["af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab", "e8 beautifulsoup4 = ["034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", "ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718"] blinker = ["471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"] colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] -docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", "7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"] +docutils = ["6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0", "9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"] entrypoints = ["589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"] feedgenerator = ["5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"] filelock = ["18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", "929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"] diff --git a/pyproject.toml b/pyproject.toml index 50408d7f..41314c99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ pytz = "^2019.1" blinker = "^1.4" unidecode = "^1.1" python-dateutil = "^2.8" -docutils = "^0.14" +docutils = "^0.15" markdown = {version = "~3.1.1", optional = true} [tool.poetry.dev-dependencies] diff --git a/setup.py b/setup.py index d79f055a..7c583da2 100755 --- a/setup.py +++ b/setup.py @@ -9,8 +9,9 @@ from setuptools import setup version = "4.2.0" -requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz >= 0a', 'blinker', 'unidecode', 'python-dateutil'] +requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', + 'docutils>=0.15', 'pytz >= 0a', 'blinker', 'unidecode', + 'python-dateutil'] entry_points = { 'console_scripts': [