summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2018-03-24 14:51:53 -0400
committerPaul Ganssle <paul@ganssle.io>2018-03-24 15:02:11 -0400
commitdf0618323bcba68b5d21ca5b67d5f8bbcd612715 (patch)
tree163e1cc88dd87c301438634da3715f12ba249949 /setup.py
parentc0ea860be9b5005d38f20a0ab6b137e7b5edb2af (diff)
downloaddateutil-git-df0618323bcba68b5d21ca5b67d5f8bbcd612715.tar.gz
Fix RST renderer for PyPI
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index d742d3c..51102a7 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,19 @@ PACKAGES = find_packages(where='.', exclude=['dateutil.test'])
def README():
with open('README.rst') as f:
- return f.read()
+ readme_lines = f.readlines()
+
+ # The .. doctest directive is not supported by PyPA
+ lines_out = []
+ doctest_line_found = False
+ for line in readme_lines:
+ if line.startswith('.. doctest'):
+ doctest_line_found = True
+ lines_out.append('.. code-block:: python3\n')
+ else:
+ lines_out.append(line)
+
+ return ''.join(lines_out)
README = README()
setup(name="python-dateutil",