~jonas-drange/ubuntu-start-page/1252899-mobile-friendly

« back to all changes in this revision

Viewing changes to src/BeautifulSoup/setup.py

  • Committer: Matthew Nuzum
  • Date: 2008-04-18 01:58:53 UTC
  • Revision ID: matthew.nuzum@canonical.com-20080418015853-2b8rf979z2c2exxl
adding files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from distutils.core import setup
 
2
import unittest
 
3
import warnings
 
4
warnings.filterwarnings("ignore", "Unknown distribution option")
 
5
 
 
6
import sys
 
7
# patch distutils if it can't cope with the "classifiers" keyword
 
8
if sys.version < '2.2.3':
 
9
    from distutils.dist import DistributionMetadata
 
10
    DistributionMetadata.classifiers = None
 
11
    DistributionMetadata.download_url = None
 
12
 
 
13
from BeautifulSoup import __version__
 
14
 
 
15
#Make sure all the tests complete.
 
16
import BeautifulSoupTests
 
17
loader = unittest.TestLoader()
 
18
result = unittest.TestResult()
 
19
suite = loader.loadTestsFromModule(BeautifulSoupTests)
 
20
suite.run(result)
 
21
if not result.wasSuccessful():
 
22
    print "Unit tests have failed!"
 
23
    for l in result.errors, result.failures:
 
24
        for case, error in l:
 
25
            print "-" * 80
 
26
            desc = case.shortDescription()
 
27
            if desc:
 
28
                print desc
 
29
            print error        
 
30
    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?'''
 
31
    print "This might or might not be a problem depending on what you plan to do with\nBeautiful Soup."
 
32
    if sys.argv[1] == 'sdist':
 
33
        print
 
34
        print "I'm not going to make a source distribution since the tests don't pass."
 
35
        sys.exit(1)
 
36
 
 
37
setup(name="BeautifulSoup",
 
38
      version=__version__,
 
39
      py_modules=['BeautifulSoup', 'BeautifulSoupTests'],
 
40
      description="HTML/XML parser for quick-turnaround applications like screen-scraping.",
 
41
      author="Leonard Richardson",
 
42
      author_email = "leonardr@segfault.org",
 
43
      long_description="""Beautiful Soup parses arbitrarily invalid SGML and provides a variety of methods and Pythonic idioms for iterating and searching the parse tree.""",
 
44
      classifiers=["Development Status :: 5 - Production/Stable",
 
45
                   "Intended Audience :: Developers",
 
46
                   "License :: OSI Approved :: Python Software Foundation License",
 
47
                   "Programming Language :: Python",
 
48
                   "Topic :: Text Processing :: Markup :: HTML",
 
49
                   "Topic :: Text Processing :: Markup :: XML",
 
50
                   "Topic :: Text Processing :: Markup :: SGML",
 
51
                   "Topic :: Software Development :: Libraries :: Python Modules",
 
52
                   ],
 
53
      url="http://www.crummy.com/software/BeautifulSoup/",
 
54
      license="BSD",
 
55
      download_url="http://www.crummy.com/software/BeautifulSoup/download/"
 
56
      )
 
57
    
 
58
    # Send announce to:
 
59
    #   python-announce@python.org
 
60
    #   python-list@python.org