Skip to content

Commit

Permalink
Updated setup.py to use distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Sankaran authored and Rohit Sankaran committed Apr 20, 2009
1 parent 7208dda commit 14af224
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions setup.py
@@ -1,5 +1,32 @@
from setuptools import setup, find_packages

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 = "trml2pdf"

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 = 'trml2pdf',
version = '0.1',
Expand All @@ -21,7 +48,6 @@
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages = find_packages(),
packages = packages,
include_package_data = True,
)

0 comments on commit 14af224

Please sign in to comment.