Skip to content

Commit 18c7b42

Browse files
committed
fix rst issues in pip long_description
1 parent 7946eab commit 18c7b42

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

description.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
with open('README.rst') as readme_file:
3+
readme = readme_file.read()
4+
5+
with open('HISTORY.rst') as history_file:
6+
history = history_file.read()
7+
8+
import re
9+
10+
long_description = re.sub(
11+
r':py:[a-z]+:`([^`]+)`',
12+
r'``\1``',
13+
readme + '\n\n' + history)
14+
15+
long_description = re.sub(
16+
r':issue:`([^`]+)`',
17+
r'`GH issue #\1 <https://github.com/ClimateImpactLab/climate_toolbox/issues/\1>`_',
18+
long_description)
19+
20+
long_description = re.sub(
21+
r':pull:`([^`]+)`',
22+
r'`GH PR #\1 <https://github.com/ClimateImpactLab/climate_toolbox/pull/\1>`_',
23+
long_description)

setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"""The setup script."""
55

66
from setuptools import setup, find_packages
7-
8-
with open('README.rst') as readme_file:
9-
readme = readme_file.read()
10-
11-
with open('HISTORY.rst') as history_file:
12-
history = history_file.read()
7+
from description import long_description
138

149
requirements = [
1510
'Click>=6.0',
@@ -31,7 +26,7 @@
3126
name='climate_toolbox',
3227
version='0.1.5',
3328
description="Tools for climate data wrangling",
34-
long_description=readme + '\n\n' + history,
29+
long_description=long_description,
3530
author="Justin Simcock",
3631
author_email='jsimcock@rhg.com',
3732
url='https://github.com/ClimateImpactLab/climate_toolbox',

0 commit comments

Comments
 (0)