Skip to content

Commit

Permalink
removing master branch section from PyPI long description
Browse files Browse the repository at this point in the history
  • Loading branch information
Miroslav Shubernetskiy committed Jan 15, 2016
1 parent f933cab commit 734f751
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ License

The MIT License (MIT)

Copyright © 2015, dealertrack technologies
Copyright © 2015-2016, dealertrack technologies

::

Expand Down
27 changes: 26 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os
from itertools import chain

from setuptools import find_packages, setup

Expand All @@ -13,6 +14,25 @@ def read(fname):
return fid.read().decode('utf-8')


def remove_section_from_rst(text, section):
lines = text.splitlines()

section_line = lines.index(section)

separator = lines[section_line + 1]
assert set(separator) == {separator[0]}

next_section_line = next(
i for i, l in enumerate(lines[section_line + 2:])
if set(l) == {separator[0]}
)

return '\n'.join(chain(
lines[:section_line - 1],
lines[section_line + next_section_line:]
))


authors = read('AUTHORS.rst')
history = read('HISTORY.rst').replace('.. :changelog:', '')
licence = read('LICENSE.rst')
Expand All @@ -27,12 +47,17 @@ def read(fname):
read('requirements-dev.txt').splitlines()[1:]
)

long_description = remove_section_from_rst(
'\n\n'.join([readme, history, authors, licence]),
'Master (not yet on PyPI)'
)

setup(
name='celery-redis-sentinel',
version=__version__,
author=__author__,
description='Celery broker and results backend implementation for Redis Sentinel',
long_description='\n\n'.join([readme, history, authors, licence]),
long_description=long_description,
url='https://github.com/dealertrack/celery-redis-sentinel',
license='MIT',
packages=find_packages(exclude=['tests', 'tests.*', 'test_tasks', 'test_tasks.*']),
Expand Down

0 comments on commit 734f751

Please sign in to comment.