aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/sdist.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-xsetuptools/command/sdist.py48
1 files changed, 16 insertions, 32 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index 1bd07e65..04cbccdf 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -1,9 +1,12 @@
+import os
+import re
+import sys
+from glob import glob
+
+import pkg_resources
from distutils.command.sdist import sdist as _sdist
from distutils.util import convert_path
from distutils import log
-from glob import glob
-import os, re, sys, pkg_resources
-from glob import glob
from setuptools import svn_utils
READMES = ('README', 'README.rst', 'README.txt')
@@ -19,7 +22,7 @@ def walk_revctrl(dirname=''):
#TODO will need test case
class re_finder(object):
- def __init__(self, path, pattern, postproc=None):
+ def __init__(self, path, pattern, postproc=lambda x: x):
self.pattern = pattern
self.postproc = postproc
self.path = convert_path(path)
@@ -32,10 +35,9 @@ class re_finder(object):
f.close()
for match in self.pattern.finditer(data):
path = match.group(1)
- if postproc:
- #postproc used to be used when the svn finder
- #was an re_finder for calling unescape
- path = postproc(path)
+ # postproc was formerly used when the svn finder
+ # was an re_finder for calling unescape
+ path = self.postproc(path)
yield svn_utils.joinpath(dirname,path)
def find(self, dirname=''):
@@ -64,17 +66,6 @@ finders = [
]
-
-
-
-
-
-
-
-
-
-
-
class sdist(_sdist):
"""Smart sdist that finds anything supported by revision control"""
@@ -129,11 +120,12 @@ class sdist(_sdist):
# Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle
# has been fixed, so only override the method if we're using an earlier
# Python.
- if (
- sys.version_info < (2,7,2)
- or (3,0) <= sys.version_info < (3,1,4)
- or (3,2) <= sys.version_info < (3,2,1)
- ):
+ has_leaky_handle = (
+ sys.version_info < (2,7,2)
+ or (3,0) <= sys.version_info < (3,1,4)
+ or (3,2) <= sys.version_info < (3,2,1)
+ )
+ if has_leaky_handle:
read_template = __read_template_hack
def add_defaults(self):
@@ -198,7 +190,6 @@ class sdist(_sdist):
"standard file not found: should have one of " +', '.join(READMES)
)
-
def make_release_tree(self, base_dir, files):
_sdist.make_release_tree(self, base_dir, files)
@@ -245,10 +236,3 @@ class sdist(_sdist):
continue
self.filelist.append(line)
manifest.close()
-
-
-
-
-
-
-#