Mercurial > pylearn
annotate setup.py @ 1531:88f361283a19 tip
Fix url/name to pylearn2.
author | Frederic Bastien <nouiz@nouiz.org> |
---|---|
date | Mon, 09 Sep 2013 10:08:05 -0400 |
parents | 61134776e33c |
children |
rev | line source |
---|---|
538 | 1 #!/bin/env python |
2 | |
1520
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
3 import os |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
4 from fnmatch import fnmatchcase |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
5 from distutils.util import convert_path |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
6 try: |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
7 from setuptools import setup |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
8 except ImportError: |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
9 from distutils.core import setup |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
10 |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
11 |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
12 def find_packages(where='.', exclude=()): |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
13 out = [] |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
14 stack = [(convert_path(where), '')] |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
15 while stack: |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
16 where, prefix = stack.pop(0) |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
17 for name in os.listdir(where): |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
18 fn = os.path.join(where, name) |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
19 if ('.' not in name and os.path.isdir(fn) and |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
20 os.path.isfile(os.path.join(fn, '__init__.py')) |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
21 ): |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
22 out.append(prefix + name) |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
23 stack.append((fn, prefix + name + '.')) |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
24 for pat in list(exclude) + ['ez_setup', 'distribute_setup']: |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
25 out = [item for item in out if not fnmatchcase(item, pat)] |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
26 return out |
61134776e33c
make the setup.py file work.
Frederic Bastien <nouiz@nouiz.org>
parents:
538
diff
changeset
|
27 |
538 | 28 setup(name="Pylearn", |
29 version="0.1", | |
30 description="Pylearn", | |
31 long_description="""Machine learning toolkit""", | |
32 author="LISA", | |
33 author_email="pylearn-dev@googlegroups.com", | |
34 packages=find_packages(exclude='tests'), | |
35 ) |