Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ee4fe6

Browse files
committed
MISC: switch line returns back to unix
Shame on me for messing up line returns. This diff will make history ugly. Sorry
1 parent 3d68c33 commit 4ee4fe6

File tree

1 file changed

+156
-156
lines changed

1 file changed

+156
-156
lines changed

setup.py

Lines changed: 156 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,156 @@
1-
#! /usr/bin/env python
2-
#
3-
# Copyright (C) 2007-2009 Cournapeau David <[email protected]>
4-
# 2010 Fabian Pedregosa <[email protected]>
5-
6-
descr = """A set of python modules for machine learning and data mining"""
7-
8-
import sys
9-
import os
10-
import shutil
11-
from distutils.core import Command
12-
13-
if sys.version_info[0] < 3:
14-
import __builtin__ as builtins
15-
else:
16-
import builtins
17-
18-
# This is a bit (!) hackish: we are setting a global variable so that the main
19-
# sklearn __init__ can detect if it is being loaded by the setup routine, to
20-
# avoid attempting to load components that aren't built yet.
21-
builtins.__SKLEARN_SETUP__ = True
22-
23-
DISTNAME = 'scikit-learn'
24-
DESCRIPTION = 'A set of python modules for machine learning and data mining'
25-
LONG_DESCRIPTION = open('README.rst').read()
26-
MAINTAINER = 'Andreas Mueller'
27-
MAINTAINER_EMAIL = '[email protected]'
28-
URL = 'http://scikit-learn.org'
29-
LICENSE = 'new BSD'
30-
DOWNLOAD_URL = 'http://sourceforge.net/projects/scikit-learn/files/'
31-
32-
# We can actually import a restricted version of sklearn that
33-
# does not need the compiled code
34-
import sklearn
35-
36-
VERSION = sklearn.__version__
37-
38-
###############################################################################
39-
# Optional setuptools features
40-
# We need to import setuptools early, if we want setuptools features,
41-
# as it monkey-patches the 'setup' function
42-
43-
# For some commands, use setuptools
44-
if len(set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
45-
'bdist_wininst', 'install_egg_info', 'build_sphinx',
46-
'egg_info', 'easy_install', 'upload',
47-
'--single-version-externally-managed',
48-
)).intersection(sys.argv)) > 0:
49-
import setuptools
50-
extra_setuptools_args = dict(
51-
zip_safe=False, # the package can run out of an .egg file
52-
include_package_data=True,
53-
)
54-
else:
55-
extra_setuptools_args = dict()
56-
57-
###############################################################################
58-
59-
class CleanCommand(Command):
60-
description = "Remove build directories, and compiled file in the source tree"
61-
user_options = []
62-
63-
def initialize_options(self):
64-
self.cwd = None
65-
66-
def finalize_options(self):
67-
self.cwd = os.getcwd()
68-
69-
def run(self):
70-
assert os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
71-
if os.path.exists('build'):
72-
shutil.rmtree('build')
73-
for dirpath, dirnames, filenames in os.walk('sklearn'):
74-
for filename in filenames:
75-
if (filename.endswith('.so') or filename.endswith('.pyd')
76-
or filename.endswith('.dll')
77-
or filename.endswith('.pyc')):
78-
os.unlink(os.path.join(dirpath, filename))
79-
80-
81-
82-
###############################################################################
83-
def configuration(parent_package='', top_path=None):
84-
if os.path.exists('MANIFEST'):
85-
os.remove('MANIFEST')
86-
87-
from numpy.distutils.misc_util import Configuration
88-
config = Configuration(None, parent_package, top_path)
89-
90-
# Avoid non-useful msg:
91-
# "Ignoring attempt to set 'name' (from ... "
92-
config.set_options(ignore_setup_xxx_py=True,
93-
assume_default_configuration=True,
94-
delegate_options_to_subpackages=True,
95-
quiet=True)
96-
97-
config.add_subpackage('sklearn')
98-
99-
return config
100-
101-
102-
def setup_package():
103-
metadata = dict(name=DISTNAME,
104-
maintainer=MAINTAINER,
105-
maintainer_email=MAINTAINER_EMAIL,
106-
description=DESCRIPTION,
107-
license=LICENSE,
108-
url=URL,
109-
version=VERSION,
110-
download_url=DOWNLOAD_URL,
111-
long_description=LONG_DESCRIPTION,
112-
classifiers=['Intended Audience :: Science/Research',
113-
'Intended Audience :: Developers',
114-
'License :: OSI Approved',
115-
'Programming Language :: C',
116-
'Programming Language :: Python',
117-
'Topic :: Software Development',
118-
'Topic :: Scientific/Engineering',
119-
'Operating System :: Microsoft :: Windows',
120-
'Operating System :: POSIX',
121-
'Operating System :: Unix',
122-
'Operating System :: MacOS',
123-
'Programming Language :: Python :: 2',
124-
'Programming Language :: Python :: 2.6',
125-
'Programming Language :: Python :: 2.7',
126-
'Programming Language :: Python :: 3',
127-
'Programming Language :: Python :: 3.3',
128-
],
129-
cmdclass={'clean': CleanCommand},
130-
**extra_setuptools_args)
131-
132-
if (len(sys.argv) >= 2
133-
and ('--help' in sys.argv[1:] or sys.argv[1]
134-
in ('--help-commands', 'egg_info', '--version', 'clean'))):
135-
136-
# For these actions, NumPy is not required.
137-
#
138-
# They are required to succeed without Numpy for example when
139-
# pip is used to install Scikit when Numpy is not yet present in
140-
# the system.
141-
try:
142-
from setuptools import setup
143-
except ImportError:
144-
from distutils.core import setup
145-
146-
metadata['version'] = VERSION
147-
else:
148-
from numpy.distutils.core import setup
149-
150-
metadata['configuration'] = configuration
151-
152-
setup(**metadata)
153-
154-
155-
if __name__ == "__main__":
156-
setup_package()
1+
#! /usr/bin/env python
2+
#
3+
# Copyright (C) 2007-2009 Cournapeau David <[email protected]>
4+
# 2010 Fabian Pedregosa <[email protected]>
5+
6+
descr = """A set of python modules for machine learning and data mining"""
7+
8+
import sys
9+
import os
10+
import shutil
11+
from distutils.core import Command
12+
13+
if sys.version_info[0] < 3:
14+
import __builtin__ as builtins
15+
else:
16+
import builtins
17+
18+
# This is a bit (!) hackish: we are setting a global variable so that the main
19+
# sklearn __init__ can detect if it is being loaded by the setup routine, to
20+
# avoid attempting to load components that aren't built yet.
21+
builtins.__SKLEARN_SETUP__ = True
22+
23+
DISTNAME = 'scikit-learn'
24+
DESCRIPTION = 'A set of python modules for machine learning and data mining'
25+
LONG_DESCRIPTION = open('README.rst').read()
26+
MAINTAINER = 'Andreas Mueller'
27+
MAINTAINER_EMAIL = '[email protected]'
28+
URL = 'http://scikit-learn.org'
29+
LICENSE = 'new BSD'
30+
DOWNLOAD_URL = 'http://sourceforge.net/projects/scikit-learn/files/'
31+
32+
# We can actually import a restricted version of sklearn that
33+
# does not need the compiled code
34+
import sklearn
35+
36+
VERSION = sklearn.__version__
37+
38+
###############################################################################
39+
# Optional setuptools features
40+
# We need to import setuptools early, if we want setuptools features,
41+
# as it monkey-patches the 'setup' function
42+
43+
# For some commands, use setuptools
44+
if len(set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
45+
'bdist_wininst', 'install_egg_info', 'build_sphinx',
46+
'egg_info', 'easy_install', 'upload',
47+
'--single-version-externally-managed',
48+
)).intersection(sys.argv)) > 0:
49+
import setuptools
50+
extra_setuptools_args = dict(
51+
zip_safe=False, # the package can run out of an .egg file
52+
include_package_data=True,
53+
)
54+
else:
55+
extra_setuptools_args = dict()
56+
57+
###############################################################################
58+
59+
class CleanCommand(Command):
60+
description = "Remove build directories, and compiled file in the source tree"
61+
user_options = []
62+
63+
def initialize_options(self):
64+
self.cwd = None
65+
66+
def finalize_options(self):
67+
self.cwd = os.getcwd()
68+
69+
def run(self):
70+
assert os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
71+
if os.path.exists('build'):
72+
shutil.rmtree('build')
73+
for dirpath, dirnames, filenames in os.walk('sklearn'):
74+
for filename in filenames:
75+
if (filename.endswith('.so') or filename.endswith('.pyd')
76+
or filename.endswith('.dll')
77+
or filename.endswith('.pyc')):
78+
os.unlink(os.path.join(dirpath, filename))
79+
80+
81+
82+
###############################################################################
83+
def configuration(parent_package='', top_path=None):
84+
if os.path.exists('MANIFEST'):
85+
os.remove('MANIFEST')
86+
87+
from numpy.distutils.misc_util import Configuration
88+
config = Configuration(None, parent_package, top_path)
89+
90+
# Avoid non-useful msg:
91+
# "Ignoring attempt to set 'name' (from ... "
92+
config.set_options(ignore_setup_xxx_py=True,
93+
assume_default_configuration=True,
94+
delegate_options_to_subpackages=True,
95+
quiet=True)
96+
97+
config.add_subpackage('sklearn')
98+
99+
return config
100+
101+
102+
def setup_package():
103+
metadata = dict(name=DISTNAME,
104+
maintainer=MAINTAINER,
105+
maintainer_email=MAINTAINER_EMAIL,
106+
description=DESCRIPTION,
107+
license=LICENSE,
108+
url=URL,
109+
version=VERSION,
110+
download_url=DOWNLOAD_URL,
111+
long_description=LONG_DESCRIPTION,
112+
classifiers=['Intended Audience :: Science/Research',
113+
'Intended Audience :: Developers',
114+
'License :: OSI Approved',
115+
'Programming Language :: C',
116+
'Programming Language :: Python',
117+
'Topic :: Software Development',
118+
'Topic :: Scientific/Engineering',
119+
'Operating System :: Microsoft :: Windows',
120+
'Operating System :: POSIX',
121+
'Operating System :: Unix',
122+
'Operating System :: MacOS',
123+
'Programming Language :: Python :: 2',
124+
'Programming Language :: Python :: 2.6',
125+
'Programming Language :: Python :: 2.7',
126+
'Programming Language :: Python :: 3',
127+
'Programming Language :: Python :: 3.3',
128+
],
129+
cmdclass={'clean': CleanCommand},
130+
**extra_setuptools_args)
131+
132+
if (len(sys.argv) >= 2
133+
and ('--help' in sys.argv[1:] or sys.argv[1]
134+
in ('--help-commands', 'egg_info', '--version', 'clean'))):
135+
136+
# For these actions, NumPy is not required.
137+
#
138+
# They are required to succeed without Numpy for example when
139+
# pip is used to install Scikit when Numpy is not yet present in
140+
# the system.
141+
try:
142+
from setuptools import setup
143+
except ImportError:
144+
from distutils.core import setup
145+
146+
metadata['version'] = VERSION
147+
else:
148+
from numpy.distutils.core import setup
149+
150+
metadata['configuration'] = configuration
151+
152+
setup(**metadata)
153+
154+
155+
if __name__ == "__main__":
156+
setup_package()

0 commit comments

Comments
 (0)