Skip to content

Commit 9825d17

Browse files
committed
MAINT make it possible to use wheelhouse-uploader
wheelhouse-uploader makes it possible to leverage our CI infrastructure (travis and appveyor) to automate the generation of binary packages for OSX and windows (both .exe and .whl packages). The cloud containers that are used to store the build artifacts of the CI workers are configured in the setup.cfg file. More details at: https://github.com/ogrisel/wheelhouse-uploader
1 parent 132ac81 commit 9825d17

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

setup.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ doctest-extension = rst
2121
doctest-fixtures = _fixture
2222
#doctest-options = +ELLIPSIS,+NORMALIZE_WHITESPACE
2323

24+
[wheelhouse_uploader]
25+
artifact_indexes=
26+
# OSX wheels built by travis (only for specific tags):
27+
# https://github.com/MacPython/scikit-learn-wheels
28+
http://wheels.scipy.org
29+
# Windows wheels buit by:
30+
# https://ci.appveyor.com/project/sklearn-ci/scikit-learn/
31+
http://windows-wheels.scikit-learn.org/
32+
2433
# Uncomment the following under windows to build using:
2534
# http://sourceforge.net/projects/mingw/
2635

setup.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,20 @@
3838
# We can actually import a restricted version of sklearn that
3939
# does not need the compiled code
4040
import sklearn
41-
4241
VERSION = sklearn.__version__
4342

44-
###############################################################################
43+
4544
# Optional setuptools features
4645
# We need to import setuptools early, if we want setuptools features,
4746
# as it monkey-patches the 'setup' function
48-
4947
# For some commands, use setuptools
5048
SETUPTOOLS_COMMANDS = set([
5149
'develop', 'release', 'bdist_egg', 'bdist_rpm',
5250
'bdist_wininst', 'install_egg_info', 'build_sphinx',
5351
'egg_info', 'easy_install', 'upload', 'bdist_wheel',
5452
'--single-version-externally-managed',
5553
])
56-
57-
58-
if len(SETUPTOOLS_COMMANDS.intersection(sys.argv)) > 0:
54+
if SETUPTOOLS_COMMANDS.intersection(sys.argv):
5955
import setuptools
6056
extra_setuptools_args = dict(
6157
zip_safe=False, # the package can run out of an .egg file
@@ -64,8 +60,8 @@
6460
else:
6561
extra_setuptools_args = dict()
6662

67-
###############################################################################
6863

64+
# Custom clean command to remove build artifacts
6965

7066
class CleanCommand(Clean):
7167
description = "Remove build artifacts from the source tree"
@@ -84,8 +80,22 @@ def run(self):
8480
if dirname == '__pycache__':
8581
shutil.rmtree(os.path.join(dirpath, dirname))
8682

83+
cmdclass = {'clean': CleanCommand}
84+
85+
86+
# Optional wheelhouse-uploader features
87+
# To automate release of binary packages for scikit-learn we need a tool
88+
# to download the packages generated by travis and appveyor workers (with
89+
# version number matching the current release) and upload them all at once
90+
# to PyPI at release time.
91+
# The URL of the artifact repositories are configured in the setup.cfg file.
92+
93+
WHEELHOUSE_UPLOADER_COMMANDS = set(['fetch_artifacts', 'upload_all'])
94+
if WHEELHOUSE_UPLOADER_COMMANDS.intersection(sys.argv):
95+
import wheelhouse_uploader.cmd
96+
cmdclass.update(vars(wheelhouse_uploader.cmd))
97+
8798

88-
###############################################################################
8999
def configuration(parent_package='', top_path=None):
90100
if os.path.exists('MANIFEST'):
91101
os.remove('MANIFEST')
@@ -133,7 +143,7 @@ def setup_package():
133143
'Programming Language :: Python :: 3.3',
134144
'Programming Language :: Python :: 3.4',
135145
],
136-
cmdclass={'clean': CleanCommand},
146+
cmdclass=cmdclass,
137147
**extra_setuptools_args)
138148

139149
if (len(sys.argv) >= 2
@@ -143,7 +153,7 @@ def setup_package():
143153
# For these actions, NumPy is not required.
144154
#
145155
# They are required to succeed without Numpy for example when
146-
# pip is used to install Scikit when Numpy is not yet present in
156+
# pip is used to install Scikit-learn when Numpy is not yet present in
147157
# the system.
148158
try:
149159
from setuptools import setup

0 commit comments

Comments
 (0)