Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make this long_description and README differ by a couple of sentences?

For a package of mine, I have a README.rst file that is read into the setup.py's long description like so:

readme = open('README.rst', 'r')
README_TEXT = readme.read()
readme.close()

setup(
    ...
    long_description = README_TEXT,
    ....
    )

This way that I can have the README file show up on my github page every time I commit and on the pypi page every time I python setup.py register. There's only one problem. I'd like the github page to say something like "This document reflects a pre-release version of envbuilder. For the most recent release, see pypi."

I could just put those lines in README.rst and delete them before I python setup.py register, but I know that there's going to be a time that I forget to remove the sentences before I push to pypi.

I'm trying to think of the best way to automate this so I don't have to worry about it. Anyone have any ideas? Is there any setuptools/distutils magic I can do?

like image 218
Jason Baker Avatar asked Jan 25 '10 19:01

Jason Baker


1 Answers

You can just use a ReST comment with some text like "split here", and then split on that in your setup.py. Ian Bicking does that in virtualenv with index.txt and setup.py.

like image 114
Carl Meyer Avatar answered Sep 17 '22 20:09

Carl Meyer