Skip to content

Commit

Permalink
Adding setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Croft committed Sep 20, 2011
1 parent c76a072 commit a0217b5
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions setup.py
@@ -0,0 +1,38 @@
import os
from distutils.core import setup


def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == "":
return [tail] + result
if head == path:
return result
return fullsplit(head, [tail] + result)


package_dir = "rating"


packages = []
for dirpath, dirnames, filenames in os.walk(package_dir):
# ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith("."):
del dirnames[i]
if "__init__.py" in filenames:
packages.append(".".join(fullsplit(dirpath)))


setup(name='rating',
version='0.1',
description='Provides five star rating functionality for Django',
author='Jeff Croft',
url='http://github.com/jcroft/django-rating',
packages=packages)

0 comments on commit a0217b5

Please sign in to comment.