Skip to content

Commit

Permalink
fix rst issues in pip long_description
Browse files Browse the repository at this point in the history
  • Loading branch information
delgadom committed Sep 19, 2019
1 parent 7946eab commit 18c7b42
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
23 changes: 23 additions & 0 deletions description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
history = history_file.read()

import re

long_description = re.sub(
r':py:[a-z]+:`([^`]+)`',
r'``\1``',
readme + '\n\n' + history)

long_description = re.sub(
r':issue:`([^`]+)`',
r'`GH issue #\1 <https://github.com/ClimateImpactLab/climate_toolbox/issues/\1>`_',
long_description)

long_description = re.sub(
r':pull:`([^`]+)`',
r'`GH PR #\1 <https://github.com/ClimateImpactLab/climate_toolbox/pull/\1>`_',
long_description)
9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"""The setup script."""

from setuptools import setup, find_packages

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
history = history_file.read()
from description import long_description

requirements = [
'Click>=6.0',
Expand All @@ -31,7 +26,7 @@
name='climate_toolbox',
version='0.1.5',
description="Tools for climate data wrangling",
long_description=readme + '\n\n' + history,
long_description=long_description,
author="Justin Simcock",
author_email='[email protected]',
url='https://github.com/ClimateImpactLab/climate_toolbox',
Expand Down

0 comments on commit 18c7b42

Please sign in to comment.