diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 18:38:36 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 18:38:36 -0500 |
commit | 16ee10c47583a4a2b7480af6fc5a205343acfdfd (patch) | |
tree | 7cfbb6d488a92fa01ddb86d6f226f549ad26a01e /setuptools/command/sdist.py | |
parent | 866ff739f6e64aaaefcf7816263410527c9f55f7 (diff) | |
parent | 41f2c5ec8dd669747f3cfd8d6b2ae9a40d219545 (diff) | |
download | external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.tar.gz external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.tar.bz2 external_python_setuptools-16ee10c47583a4a2b7480af6fc5a205343acfdfd.zip |
Merge with 10.2.1
--HG--
branch : feature/issue-229
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-x | setuptools/command/sdist.py | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index a15582c3..4ec7ec91 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -1,20 +1,18 @@ from glob import glob -from distutils.util import convert_path from distutils import log import distutils.command.sdist as orig import os -import re import sys import six -from setuptools import svn_utils from setuptools.utils import cs_path_exists import pkg_resources -READMES = ('README', 'README.rst', 'README.txt') +READMES = 'README', 'README.rst', 'README.txt' +_default_revctrl = list def walk_revctrl(dirname=''): """Find all files under revision control""" @@ -23,60 +21,6 @@ def walk_revctrl(dirname=''): yield item -# TODO will need test case -class re_finder(object): - """ - Finder that locates files based on entries in a file matched by a - regular expression. - """ - - def __init__(self, path, pattern, postproc=lambda x: x): - self.pattern = pattern - self.postproc = postproc - self.entries_path = convert_path(path) - - def _finder(self, dirname, filename): - f = open(filename, 'rU') - try: - data = f.read() - finally: - f.close() - for match in self.pattern.finditer(data): - path = match.group(1) - # 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=''): - path = svn_utils.joinpath(dirname, self.entries_path) - - if not os.path.isfile(path): - # entries file doesn't exist - return - for path in self._finder(dirname, path): - if os.path.isfile(path): - yield path - elif os.path.isdir(path): - for item in self.find(path): - yield item - - __call__ = find - - -def _default_revctrl(dirname=''): - 'Primary svn_cvs entry point' - for finder in finders: - for item in finder(dirname): - yield item - - -finders = [ - re_finder('CVS/Entries', re.compile(r"^\w?/([^/]+)/", re.M)), - svn_utils.svn_finder, -] - - class sdist(orig.sdist): """Smart sdist that finds anything supported by revision control""" |