Skip to content
Permalink
Browse files

Removed svn support from setuptools. Ref #313.

  • Loading branch information...
jaraco committed Dec 24, 2014
1 parent 21f7539 commit a7e5648bda737683c4ad220e61c44c1d17b73d87
@@ -172,9 +172,6 @@ def _save_entry_points(self):
],
"console_scripts": console_scripts,

"setuptools.file_finders":
["svn_cvs = setuptools.command.sdist:_default_revctrl"],

"setuptools.installation":
['eggsecutable = setuptools.command.easy_install:bootstrap'],
},
@@ -11,10 +11,14 @@
import re
import sys

try:
from setuptools_svn import svn_utils
except ImportError:
pass

from setuptools import Command
from setuptools.command.sdist import sdist
from setuptools.compat import basestring, PY3, StringIO
from setuptools import svn_utils
from setuptools.command.sdist import walk_revctrl
from pkg_resources import (
parse_requirements, safe_name, parse_version,
@@ -190,6 +194,8 @@ def tags(self):

@staticmethod
def get_svn_revision():
if 'svn_utils' not in globals():
return "0"
return str(svn_utils.SvnInfo.load(os.curdir).get_revision())

def find_sources(self):
@@ -1,12 +1,9 @@
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

from setuptools import svn_utils
from setuptools.compat import PY3
from setuptools.utils import cs_path_exists

@@ -22,60 +19,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"""

0 comments on commit a7e5648

Please sign in to comment.
You can’t perform that action at this time.