[MERGE] (#183391) improve PyPI integration by adding project metadata to setup.py

John Arbash Meinel john at arbash-meinel.com
Wed Jan 16 21:56:28 GMT 2008

Hash: SHA1

Martin Pool wrote:
> While I was doing the 1.1 release and updating the docs, I noticed that
> we could add more information to setup.py to be automatically included
> in our index.
> The index entry previously had some text from README.  Rather than
> duplicating it, I'v changed setup.py to pull it in from there.
> (I think the convention is that setup.py is always run from the source
> directory, so openining it in that way is safe.)
> As a followon, I see our version number format differs from that
> specified in <http://docs.python.org/dist/meta-data.html>, which wants
> e.g. '1.1pr1'.  We could change that.  I remember Alexander previously
> said that 1.1.0.preview.1 was somehow easier for him to use though...


We went with 1.1.0.final.1 because it is easier to parse with a simple

I believe python itself does 1.1.0final1 which is what we did for a while.

We could leave the value of "bzrlib.__version__" alone, and just use:

version='%s.%s.%s%s%s' % bzrlib.version_info

if you prefer.

+    'long_description': file("README").read(),

^- This seems like a risky thing to do. Maybe we should at least split
it out from inside the dict() into a helper function?
I would usually do something like:

def get_long_description():
  dirname = os.path.dirname(os.path.abspath(__file__))
  readme = os.path.join(dirname, 'README')
  f = open(readme, 'rb')
    text = f.read()
  return text

It *is* convention to run "python setup.py" or "./setup.py". But it
isn't a lot harder to make it robust if someone wants to build
out-of-directory or something like that.

I think we also want to open the file in binary mode, and not text mode,
but I could be wrong.

Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list