Skip to content

Commit

Permalink
MAINT dev version to follow PEP440
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrisel authored and jnothman committed Dec 25, 2014
1 parent 3d1ede9 commit 6d7d25f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
27 changes: 18 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
import shutil
from distutils.command.clean import clean as Clean


if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins

# This is a bit (!) hackish: we are setting a global variable so that the main
# sklearn __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet.
# avoid attempting to load components that aren't built yet:
# the numpy distutils extensions that are used by scikit-learn to recursively
# build the compiled extensions in sub-packages is based on the Python import
# machinery.
builtins.__SKLEARN_SETUP__ = True

DISTNAME = 'scikit-learn'
Expand All @@ -43,11 +47,15 @@
# as it monkey-patches the 'setup' function

# For some commands, use setuptools
if len(set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
'bdist_wininst', 'install_egg_info', 'build_sphinx',
'egg_info', 'easy_install', 'upload', 'bdist_wheel',
'--single-version-externally-managed',
)).intersection(sys.argv)) > 0:
SETUPTOOLS_COMMANDS = set([
'develop', 'release', 'bdist_egg', 'bdist_rpm',
'bdist_wininst', 'install_egg_info', 'build_sphinx',
'egg_info', 'easy_install', 'upload', 'bdist_wheel',
'--single-version-externally-managed',
])


if len(SETUPTOOLS_COMMANDS.intersection(sys.argv)) > 0:
import setuptools
extra_setuptools_args = dict(
zip_safe=False, # the package can run out of an .egg file
Expand All @@ -58,8 +66,9 @@

###############################################################################


class CleanCommand(Clean):
description = "Remove build directories, and compiled file in the source tree"
description = "Remove build artifacts from the source tree"

def run(self):
Clean.run(self)
Expand All @@ -68,8 +77,8 @@ def run(self):
for dirpath, dirnames, filenames in os.walk('sklearn'):
for filename in filenames:
if (filename.endswith('.so') or filename.endswith('.pyd')
or filename.endswith('.dll')
or filename.endswith('.pyc')):
or filename.endswith('.dll')
or filename.endswith('.pyc')):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
Expand Down
24 changes: 20 additions & 4 deletions sklearn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,30 @@
import sys
import re
import warnings
__version__ = '0.16-git'


# Make sure that DeprecationWarning within this package always gets printed
warnings.filterwarnings('always', category=DeprecationWarning,
module='^{0}\.'.format(re.escape(__name__)))

# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Release Candidate
# X.Y # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
#
__version__ = '0.16.dev'


try:
# This variable is injected in the __builtins__ by the build
# process. It used to enable importing subpackages of sklearn when
Expand Down Expand Up @@ -52,9 +70,7 @@


def setup_module(module):
"""Fixture for the tests to assure globally controllable seeding of RNGs
"""

"""Fixture for the tests to assure globally controllable seeding of RNGs"""
import os
import numpy as np
import random
Expand Down

0 comments on commit 6d7d25f

Please sign in to comment.