Skip to content

Commit

Permalink
Merge pull request #69 from mdickinson/fix/long-description-urls
Browse files Browse the repository at this point in the history
Fix readthedocs URLs in the long description.
  • Loading branch information
mdickinson authored Jun 27, 2017
2 parents da7270b + 761c6d6 commit 74d299a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ def get_version_info():
return version_info


def long_description(version):
def long_description(release):
with open('README.rst') as f:
contents = f.read()
# For a released version, we want the description to link to the
# corresponding docs rather than the docs for master.
tag = 'v{}'.format(release)
contents = contents.replace(
'refcycle.readthedocs.org/en/latest',
'refcycle.readthedocs.org/en/maintenance-v{}'.format(version),
'refcycle.readthedocs.io/en/{}'.format(tag),
)
return contents

Expand All @@ -50,7 +51,7 @@ def long_description(version):
url=PROJECT_URL,
license="Apache license",
description="Find and visualise reference cycles between Python objects.",
long_description=long_description(version_info['version']),
long_description=long_description(version_info['release']),
install_requires=["six"],
packages=find_packages(),
classifiers=[
Expand Down

0 comments on commit 74d299a

Please sign in to comment.