From: W. Trevor King Date: Tue, 7 Jun 2011 00:43:05 +0000 (-0400) Subject: Rework setup.py to use distutils instead of setuptools. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be95484a0c2f8b060ac74a704b1f545d5a220161;p=g-pypi.git Rework setup.py to use distutils instead of setuptools. I'm not super happy about this step, but here are the pros and cons: + Include ebuild.tmpl in distribution (`issue 11`_) + Remove setuptools dependency - Implement test command by hand setuptools also supports package_data, but I couldn't find an incantation that included ebuild.tmpl. The distutils incantation is simple enough. .. _issue 11: http://code.google.com/p/g-pypi/issues/detail?id=11 --- diff --git a/setup.py b/setup.py index ce9bd75..26d7bd3 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,60 @@ -#!/usr/bin/python - -from setuptools import setup - -from g_pypi.__init__ import __version__ as VERSION - - -setup(name="g-pypi", - license="GPL-2", - version=VERSION, - description="Tool for creating Gentoo ebuilds for Python packages by querying PyPI (The Cheese Shop)", - long_description=open("README", "r").read(), - maintainer="Rob Cakebread", - author="Rob Cakebread", - author_email="gentoodev@gmail.com", - url="http://tools.assembla.com/g-pypi/", - keywords="gentoo ebuilds PyPI setuptools cheeseshop distutils eggs portage package management", - classifiers=["Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License (GPL)", - "Programming Language :: Python", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - install_requires=["Pygments", - "setuptools", - "Cheetah", - "ConfigObj", - ], +#!/usr/bin/env python + +'Create Gentoo ebuilds for Python packages by querying PyPI' + +from distutils.core import setup, Command +import os.path + +try: + import nose +except ImportError, e: + import sys + sys.stdout.write(str(e)+'\n') + nose = None + +from g_pypi import __version__ + + +if nose: # add a `test` command + class TestCommand(Command): + description = "run the test suite with nose" + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + nose.run(argv=['setup.py test', '-vv', '.']) + + cmdclass = {'test': TestCommand} +else: + cmdclass = {} + + +setup( + name='g-pypi', + license='GPL-2', + version=__version__, + description=__doc__, + long_description=open('README', 'r').read(), + maintainer='Rob Cakebread', + author='Rob Cakebread', + author_email='gentoodev@gmail.com', + url='http://code.google.com/p/g-pypi/', + keywords=('gentoo ebuilds PyPI setuptools cheeseshop distutils eggs ' + 'portage package management'), + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Programming Language :: Python', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], packages=['g_pypi'], - package_dir={'g_pypi':'g_pypi' }, - include_package_data = True, - entry_points={'console_scripts': ['g-pypi = g_pypi.cli:main']}, - test_suite='nose.collector', + package_data={'g_pypi':['ebuild.tmpl']}, + scripts=['scripts/g-pypi'], + cmdclass=cmdclass, ) -