Skip to content

(ISSUE #146) Adds license and long_description for pypi #154

Merged
merged 2 commits into from May 9, 2012

4 participants

@silent1mezzo

This adds both the license and long_description to pypi.

It just uses the contents from LICENSE and README.markdown to populate these fields.

@silent1mezzo silent1mezzo (ISSUE #146) Adds license and long_description for pypi e5f15c4
@silent1mezzo

One other thing. I tried automatically adding the version from reversion/__init__.py but because you're importing django as well there's no simple way to do it.

Couple of solutions I thought of:
1. Read __init__.py and then parse through with a regex searching for the VERSION
2. Create reversion/version.py and import that into __init__.py and setup.py

The second solution is much cleaner IMO but it requires an extra file and it's up to you. This would mean you'd only need to update the version in that one place and you could have it import into setup.py for both version and for your download links.

@charettes

First solution is definitely not good idea.

@silent1mezzo

I agree with @charettes, I just included it because some other large projects use that.

@etianen
Owner
etianen commented May 9, 2012

Your code will still be embedding markdown syntax in pypi. I suppose that's better than the broken ascii!

What's the problem with

from reversion import VERSION

In any case, solution 2 is clearly better!

@etianen etianen referenced this pull request May 9, 2012
Closed

pypi page looks broken #146

@silent1mezzo

from reversion import VERSION dies in fire because __init__.py also includes import django which exceptions out when pypi runs setup.py

@etianen
Owner
etianen commented May 9, 2012

Ah, I see. D'oh!

If you can implement your solution 2, then I'll gladly pull this in.

@silent1mezzo

A little more hacky than I usually like to make sure everything is backwards compatible.

@etianen etianen commented on the diff May 9, 2012
src/reversion/version.py
@@ -0,0 +1 @@
+__version__ = (1, 6, 0)
@etianen
Owner
etianen added a note May 9, 2012

Why the version here? Isn't this just adding lines of code for no reason?

@etianen
Owner
etianen added a note May 9, 2012

Nice markdown formatting error there. I mean __version__

@silent1mezzo
silent1mezzo added a note May 9, 2012

__version__ is the PEP standard. Because you've used VERSION every where else I didn't want to break backwards compatibility incase anyone is relying on VERSION. http://www.python.org/dev/peps/pep-0396/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@etianen etianen merged commit c1e3d49 into etianen:master May 9, 2012
@etianen
Owner
etianen commented May 9, 2012

You're pulled! Many thanks! I've learned something today. :)

@jedie
jedie commented on f00dd2c May 10, 2012

IMHO it's better to store __version__ = (1, 6, 0) in src/reversion/__init__.py: It's more common, isn't it?

It is but it then can't be used for setup.py on pypi due to dependency issues

Owner

I wonder... what if we were to move the django version check into models.py, or similar? That would still be auto-imported by django, and allow us to keep things more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.