diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 100 |
1 files changed, 40 insertions, 60 deletions
@@ -1,64 +1,44 @@ -from distutils.core import setup -import unittest -import warnings -warnings.filterwarnings("ignore", "Unknown distribution option") +#!/usr/bin/env python -import sys -# patch distutils if it can't cope with the "classifiers" keyword -if sys.version < '2.2.3': - from distutils.dist import DistributionMetadata - DistributionMetadata.classifiers = None - DistributionMetadata.download_url = None +import ez_setup +ez_setup.use_setuptools() -from BeautifulSoup import __version__ +import sys +from setuptools import setup, find_packages -#Make sure all the tests complete. -import BeautifulSoupTests -loader = unittest.TestLoader() -result = unittest.TestResult() -suite = loader.loadTestsFromModule(BeautifulSoupTests) -suite.run(result) -if not result.wasSuccessful(): - print "Unit tests have failed!" - for l in result.errors, result.failures: - for case, error in l: - print "-" * 80 - desc = case.shortDescription() - if desc: - print desc - print error - print '''If you see an error like: "'ascii' codec can't encode character...", see\nthe Beautiful Soup documentation:\n http://www.crummy.com/software/BeautifulSoup/documentation.html#Why%20can't%20Beautiful%20Soup%20print%20out%20the%20non-ASCII%20characters%20I%20gave%20it?''' - print "This might or might not be a problem depending on what you plan to do with\nBeautiful Soup." - if sys.argv[1] == 'sdist': - print - print "I'm not going to make a source distribution since the tests don't pass." - sys.exit(1) +sys.path.insert(0, 'src') +from beautifulsoup import __version__ -setup(name="BeautifulSoup", - version=__version__, - py_modules=['BeautifulSoup', 'BeautifulSoupTests'], - scripts=['testall.sh', 'to3.sh', - # Whatever, I'll fix this later. - 'README', 'CHANGELOG', - 'BeautifulSoup.py.3.diff', 'BeautifulSoupTests.py.3.diff'], - description="HTML/XML parser for quick-turnaround applications like screen-scraping.", - author="Leonard Richardson", - author_email = "leonardr@segfault.org", - long_description="""Beautiful Soup parses arbitrarily invalid SGML and provides a variety of methods and Pythonic idioms for iterating and searching the parse tree.""", - classifiers=["Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: Python Software Foundation License", - "Programming Language :: Python", - "Topic :: Text Processing :: Markup :: HTML", - "Topic :: Text Processing :: Markup :: XML", - "Topic :: Text Processing :: Markup :: SGML", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - url="http://www.crummy.com/software/BeautifulSoup/", - license="BSD", - download_url="http://www.crummy.com/software/BeautifulSoup/download/" - ) - - # Send announce to: - # python-announce@python.org - # python-list@python.org +setup( + name='beautifulsoup', + version=__version__, + packages=find_packages('src'), + package_dir={'':'src'}, + include_package_data=True, + zip_safe=False, + maintainer='Leonard Richardson', + maintainer_email='leonardr@segfault.org', + long_description="""Beautiful Soup parses arbitrarily invalid XML/HTML and provides a variety of methods and Pythonic idioms for iterating and searching the parse tree.""" + license='New-style BSD', + install_requires=[ + 'setuptools', + 'zope.interface', + ], + url='https://launchpad.net/beautifulsoup', + download_url= 'https://launchpad.net/beautifulsoup/+download', + classifiers=["Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Python Software Foundation License", + "Programming Language :: Python", + "Topic :: Text Processing :: Markup :: HTML", + "Topic :: Text Processing :: Markup :: XML", + "Topic :: Text Processing :: Markup :: SGML", + "Topic :: Software Development :: Libraries :: Python Modules", + ], + extras_require=dict( + docs=['Sphinx', + 'z3c.recipe.sphinxdoc'] + ), + setup_requires=['eggtestinfo', 'setuptools_bzr'], + test_suite='beautifulsoup.tests', + ) |