Skip to content

Instantly share code, notes, and snippets.

@blink1073
Created December 13, 2014 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blink1073/4e4e9239cd3ad093d0f3 to your computer and use it in GitHub Desktop.
Save blink1073/4e4e9239cd3ad093d0f3 to your computer and use it in GitHub Desktop.
Scikit Image py2exe Changes
diff --git a/setup.py b/setup.py
index 01b6962..fa3f50e 100755
--- a/setup.py
+++ b/setup.py
@@ -20,14 +20,29 @@ DOWNLOAD_URL = 'http://github.com/scikit-image/scikit-image'
VERSION = '0.11dev'
PYTHON_VERSION = (2, 6)
-import re
import os
import sys
-import setuptools
+try:
+ import py2exe as _py2exe
+except ImportError:
+ pass
+
+from distutils.core import setup
from distutils.command.build_py import build_py
from distutils.version import LooseVersion
+from pkgutil import walk_packages
+
+
+def find_packages(path=__file__, prefix="", exclude=None):
+ for _, name, ispkg in walk_packages(path, ''):
+ if exclude:
+ for e in exclude:
+ if name == e:
+ continue
+ if ispkg:
+ yield name
# These are manually checked.
# These packages are sometimes installed outside of the setuptools scope
@@ -151,7 +166,7 @@ if __name__ == "__main__":
install_requires=[
"six>=%s" % DEPENDENCIES['six']
],
- packages=setuptools.find_packages(exclude=['doc']),
+ packages=list(find_packages(exclude=['doc'])),
include_package_data=True,
zip_safe=False, # the package can run out of an .egg file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment