|
1 | 1 | importast |
2 | | -importos |
3 | 2 | importcodecs |
4 | 3 |
|
5 | | -fromsetuptoolsimportsetup |
| 4 | +fromos.pathimportjoin,dirname |
| 5 | +fromsetuptoolsimportsetup,find_packages |
6 | 6 |
|
7 | 7 |
|
8 | 8 | classifiers= [ |
|
22 | 22 | 'Topic :: Text Processing :: Markup :: HTML' |
23 | 23 | ] |
24 | 24 |
|
25 | | -packages= ['html5lib']+ ['html5lib.'+name |
26 | | -fornameinos.listdir(os.path.join('html5lib')) |
27 | | -ifos.path.isdir(os.path.join('html5lib',name))and |
28 | | -notname.startswith('.')andname!='tests'] |
29 | | - |
30 | | -current_dir=os.path.dirname(__file__) |
31 | | -withcodecs.open(os.path.join(current_dir,'README.rst'),'r','utf8')asreadme_file: |
32 | | -withcodecs.open(os.path.join(current_dir,'CHANGES.rst'),'r','utf8')aschanges_file: |
| 25 | +here=dirname(__file__) |
| 26 | +withcodecs.open(join(here,'README.rst'),'r','utf8')asreadme_file: |
| 27 | +withcodecs.open(join(here,'CHANGES.rst'),'r','utf8')aschanges_file: |
33 | 28 | long_description=readme_file.read()+'\n'+changes_file.read() |
34 | 29 |
|
35 | 30 | version=None |
36 | | -withopen(os.path.join("html5lib","__init__.py"),"rb")asinit_file: |
| 31 | +withopen(join("html5lib","__init__.py"),"rb")asinit_file: |
37 | 32 | t=ast.parse(init_file.read(),filename="__init__.py",mode="exec") |
38 | 33 | assertisinstance(t,ast.Module) |
39 | 34 | assignments=filter(lambdax:isinstance(x,ast.Assign),t.body) |
|
53 | 48 | classifiers=classifiers, |
54 | 49 | maintainer='James Graham', |
55 | 50 | maintainer_email='james@hoppipolla.co.uk', |
56 | | -packages=packages, |
| 51 | +packages=find_packages(exclude=["*.tests","*.tests.*","tests.*","tests"]), |
57 | 52 | install_requires=[ |
58 | 53 | 'six', |
59 | 54 | 'webencodings', |
|
70 | 65 |
|
71 | 66 | # Standard extras, will be installed when the extra is requested. |
72 | 67 | "genshi": ["genshi"], |
73 | | -"charade": ["charade"], |
| 68 | +"chardet": ["chardet>=2.2"], |
74 | 69 |
|
75 | 70 | # The all extra combines a standard extra which will be used anytime |
76 | 71 | # the all extra is requested, and it extends it with a conditional |
77 | 72 | # extra that will be installed whenever the condition matches and the |
78 | 73 | # all extra is requested. |
79 | | -"all": ["genshi","charade"], |
| 74 | +"all": ["genshi","chardet>=2.2"], |
80 | 75 | "all:platform.python_implementation == 'CPython'": ["datrie","lxml"], |
81 | 76 | }, |
82 | 77 | ) |