diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:59:03 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:59:03 -0500 |
commit | b393354ec71116fe7e1f34f6b94a991c253514f9 (patch) | |
tree | d479e57bac94159af9ba044c137f6591b6875456 | |
parent | 133272d7b4655411d3d7a1ce18fc66f3a568abd7 (diff) | |
parent | 7b82f0adbeafed8576e5c4c150d053b57822f101 (diff) | |
download | external_python_setuptools-b393354ec71116fe7e1f34f6b94a991c253514f9.tar.gz external_python_setuptools-b393354ec71116fe7e1f34f6b94a991c253514f9.tar.bz2 external_python_setuptools-b393354ec71116fe7e1f34f6b94a991c253514f9.zip |
Merge with remove-svn
43 files changed, 22 insertions, 2742 deletions
@@ -171,6 +171,7 @@ d62bf4e407b3b9b5bedcc1396a9ba46f35571902 8.0.1 995f6d9651312cd481ca1e5ddb271cbdd0474c57 8.2 efbe39dae0aba9a7db399f6442758ae94e315c93 8.2.1 cd14b2a72e51c7d13873ab6c2041f901b1a7a1cd 8.3 +0eee586a153f068142c1a0df4bc2635ed2c1a1cc 9.0b1 921e60a0f9067311571fde9ccf2f35223159d9f6 8.4 0d7b9b63d06ab7f68bc8edd56cb2034e6395d7fc 9.0 fa069bf2411a150c9379d31a04d1c3836e2d3027 9.0.1 diff --git a/.travis.yml b/.travis.yml index 0b685c1a..5f644e00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ python: - pypy # command to run tests script: + # invoke bootstrap and override egg_info based on setup.py in checkout + - python bootstrap.py - python setup.py egg_info + - python setup.py ptr - python ez_setup.py --version 7.0 diff --git a/CHANGES.txt b/CHANGES.txt index acde954e..3d059e41 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,15 @@ CHANGES ======= +---- +10.0 +---- + +* Issue #313: Removed built-in support for subversion. Projects wishing to + retain support for subversion will need to use a third party library. The + extant implementation is being ported to `setuptools_svn + <https://pypi.python.org/pypi/setuptools_svn>`_. + --- future --- @@ -172,9 +172,6 @@ setup_params = dict( ], "console_scripts": console_scripts, - "setuptools.file_finders": - ["svn_cvs = setuptools.command.sdist:_default_revctrl"], - "setuptools.installation": ['eggsecutable = setuptools.command.easy_install:bootstrap'], }, diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index f0d0b448..a9940677 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -11,10 +11,14 @@ import os 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 @@ class egg_info(Command): @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): diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index a77c39f2..371bf547 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -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""" diff --git a/setuptools/svn_utils.py b/setuptools/svn_utils.py deleted file mode 100644 index 6502fc98..00000000 --- a/setuptools/svn_utils.py +++ /dev/null @@ -1,585 +0,0 @@ -from __future__ import absolute_import
-
-import os
-import re
-import sys
-from distutils import log
-import xml.dom.pulldom
-import shlex
-import locale
-import codecs
-import unicodedata
-import warnings
-from setuptools.compat import unicode, PY2
-from setuptools.py31compat import TemporaryDirectory
-from xml.sax.saxutils import unescape
-
-try:
- import urlparse
-except ImportError:
- import urllib.parse as urlparse
-
-from subprocess import Popen as _Popen, PIPE as _PIPE
-
-#NOTE: Use of the command line options require SVN 1.3 or newer (December 2005)
-# and SVN 1.3 hasn't been supported by the developers since mid 2008.
-
-#subprocess is called several times with shell=(sys.platform=='win32')
-#see the follow for more information:
-# http://bugs.python.org/issue8557
-# http://stackoverflow.com/questions/5658622/
-# python-subprocess-popen-environment-path
-
-def _run_command(args, stdout=_PIPE, stderr=_PIPE, encoding=None, stream=0):
- #regarding the shell argument, see: http://bugs.python.org/issue8557
- try:
- proc = _Popen(args, stdout=stdout, stderr=stderr,
- shell=(sys.platform == 'win32'))
-
- data = proc.communicate()[stream]
- except OSError:
- return 1, ''
-
- #doubled checked and
- data = decode_as_string(data, encoding)
-
- #communciate calls wait()
- return proc.returncode, data
-
-
-def _get_entry_schedule(entry):
- schedule = entry.getElementsByTagName('schedule')[0]
- return "".join([t.nodeValue
- for t in schedule.childNodes
- if t.nodeType == t.TEXT_NODE])
-
-
-def _get_target_property(target):
- property_text = target.getElementsByTagName('property')[0]
- return "".join([t.nodeValue
- for t in property_text.childNodes
- if t.nodeType == t.TEXT_NODE])
-
-
-def _get_xml_data(decoded_str):
- if PY2:
- #old versions want an encoded string
- data = decoded_str.encode('utf-8')
- else:
- data = decoded_str
- return data
-
-
-def joinpath(prefix, *suffix):
- if not prefix or prefix == '.':
- return os.path.join(*suffix)
- return os.path.join(prefix, *suffix)
-
-def determine_console_encoding():
- try:
- #try for the preferred encoding
- encoding = locale.getpreferredencoding()
-
- #see if the locale.getdefaultlocale returns null
- #some versions of python\platforms return US-ASCII
- #when it cannot determine an encoding
- if not encoding or encoding == "US-ASCII":
- encoding = locale.getdefaultlocale()[1]
-
- if encoding:
- codecs.lookup(encoding) # make sure a lookup error is not made
-
- except (locale.Error, LookupError):
- encoding = None
-
- is_osx = sys.platform == "darwin"
- if not encoding:
- return ["US-ASCII", "utf-8"][is_osx]
- elif encoding.startswith("mac-") and is_osx:
- #certain versions of python would return mac-roman as default
- #OSX as a left over of earlier mac versions.
- return "utf-8"
- else:
- return encoding
-
-_console_encoding = determine_console_encoding()
-
-def decode_as_string(text, encoding=None):
- """
- Decode the console or file output explicitly using getpreferredencoding.
- The text paraemeter should be a encoded string, if not no decode occurs
- If no encoding is given, getpreferredencoding is used. If encoding is
- specified, that is used instead. This would be needed for SVN --xml
- output. Unicode is explicitly put in composed NFC form.
-
- --xml should be UTF-8 (SVN Issue 2938) the discussion on the Subversion
- DEV List from 2007 seems to indicate the same.
- """
- #text should be a byte string
-
- if encoding is None:
- encoding = _console_encoding
-
- if not isinstance(text, unicode):
- text = text.decode(encoding)
-
- text = unicodedata.normalize('NFC', text)
-
- return text
-
-
-def parse_dir_entries(decoded_str):
- '''Parse the entries from a recursive info xml'''
- doc = xml.dom.pulldom.parseString(_get_xml_data(decoded_str))
- entries = list()
-
- for event, node in doc:
- if event == 'START_ELEMENT' and node.nodeName == 'entry':
- doc.expandNode(node)
- if not _get_entry_schedule(node).startswith('delete'):
- entries.append((node.getAttribute('path'),
- node.getAttribute('kind')))
-
- return entries[1:] # do not want the root directory
-
-
-def parse_externals_xml(decoded_str, prefix=''):
- '''Parse a propget svn:externals xml'''
- prefix = os.path.normpath(prefix)
- prefix = os.path.normcase(prefix)
-
- doc = xml.dom.pulldom.parseString(_get_xml_data(decoded_str))
- externals = list()
-
- for event, node in doc:
- if event == 'START_ELEMENT' and node.nodeName == 'target':
- doc.expandNode(node)
- path = os.path.normpath(node.getAttribute('path'))
-
- if os.path.normcase(path).startswith(prefix):
- path = path[len(prefix)+1:]
-
- data = _get_target_property(node)
- #data should be decoded already
- for external in parse_external_prop(data):
- externals.append(joinpath(path, external))
-
- return externals # do not want the root directory
-
-
-def parse_external_prop(lines):
- """
- Parse the value of a retrieved svn:externals entry.
-
- possible token setups (with quotng and backscaping in laters versions)
- URL[@#] EXT_FOLDERNAME
- [-r#] URL EXT_FOLDERNAME
- EXT_FOLDERNAME [-r#] URL
- """
- externals = []
- for line in lines.splitlines():
- line = line.lstrip() # there might be a "\ "
- if not line:
- continue
-
- if PY2:
- #shlex handles NULLs just fine and shlex in 2.7 tries to encode
- #as ascii automatiically
- line = line.encode('utf-8')
- line = shlex.split(line)
- if PY2:
- line = [x.decode('utf-8') for x in line]
-
- #EXT_FOLDERNAME is either the first or last depending on where
- #the URL falls
- if urlparse.urlsplit(line[-1])[0]:
- external = line[0]
- else:
- external = line[-1]
-
- external = decode_as_string(external, encoding="utf-8")
- externals.append(os.path.normpath(external))
-
- return externals
-
-
-def parse_prop_file(filename, key):
- found = False
- f = open(filename, 'rt')
- data = ''
- try:
- for line in iter(f.readline, ''): # can't use direct iter!
- parts = line.split()
- if len(parts) == 2:
- kind, length = parts
- data = f.read(int(length))
- if kind == 'K' and data == key:
- found = True
- elif kind == 'V' and found:
- break
- finally:
- f.close()
-
- return data
-
-
-class SvnInfo(object):
- '''
- Generic svn_info object. No has little knowledge of how to extract
- information. Use cls.load to instatiate according svn version.
-
- Paths are not filesystem encoded.
- '''
-
- @staticmethod
- def get_svn_version():
- # Temp config directory should be enough to check for repository
- # This is needed because .svn always creates .subversion and
- # some operating systems do not handle dot directory correctly.
- # Real queries in real svn repos with be concerned with it creation
- with TemporaryDirectory() as tempdir:
- code, data = _run_command(['svn',
- '--config-dir', tempdir,
- '--version',
- '--quiet'])
-
- if code == 0 and data:
- return data.strip()
- else:
- return ''
-
- #svnversion return values (previous implementations return max revision)
- # 4123:4168 mixed revision working copy
- # 4168M modified working copy
- # 4123S switched working copy
- # 4123:4168MS mixed revision, modified, switched working copy
- revision_re = re.compile(r'(?:([\-0-9]+):)?(\d+)([a-z]*)\s*$', re.I)
-
- @classmethod
- def load(cls, dirname=''):
- normdir = os.path.normpath(dirname)
-
- # Temp config directory should be enough to check for repository
- # This is needed because .svn always creates .subversion and
- # some operating systems do not handle dot directory correctly.
- # Real queries in real svn repos with be concerned with it creation
- with TemporaryDirectory() as tempdir:
- code, data = _run_command(['svn',
- '--config-dir', tempdir,
- 'info', normdir])
-
- # Must check for some contents, as some use empty directories
- # in testcases, however only enteries is needed also the info
- # command above MUST have worked
- svn_dir = os.path.join(normdir, '.svn')
- is_svn_wd = (not code or
- os.path.isfile(os.path.join(svn_dir, 'entries')))
-
- svn_version = tuple(cls.get_svn_version().split('.'))
-
- try:
- base_svn_version = tuple(int(x) for x in svn_version[:2])
- except ValueError:
- base_svn_version = tuple()
-
- if not is_svn_wd:
- #return an instance of this NO-OP class
- return SvnInfo(dirname)
-
- if code or not base_svn_version or base_svn_version < (1, 3):
- warnings.warn(("No SVN 1.3+ command found: falling back "
- "on pre 1.7 .svn parsing"), DeprecationWarning)
- return SvnFileInfo(dirname)
-
- if base_svn_version < (1, 5):
- return Svn13Info(dirname)
-
- return Svn15Info(dirname)
-
- def __init__(self, path=''):
- self.path = path
- self._entries = None
- self._externals = None
-
- def get_revision(self):
- 'Retrieve the directory revision information using svnversion'
- code, data = _run_command(['svnversion', '-c', self.path])
- if code:
- log.warn("svnversion failed")
- return 0
-
- parsed = self.revision_re.match(data)
- if parsed:
- return int(parsed.group(2))
- else:
- return 0
-
- @property
- def entries(self):
- if self._entries is None:
- self._entries = self.get_entries()
- return self._entries
-
- @property
- def externals(self):
- if self._externals is None:
- self._externals = self.get_externals()
- return self._externals
-
- def iter_externals(self):
- '''
- Iterate over the svn:external references in the repository path.
- '''
- for item in self.externals:
- yield item
-
- def iter_files(self):
- '''
- Iterate over the non-deleted file entries in the repository path
- '''
- for item, kind in self.entries:
- if kind.lower() == 'file':
- yield item
-
- def iter_dirs(self, include_root=True):
- '''
- Iterate over the non-deleted file entries in the repository path
- '''
- if include_root:
- yield self.path
- for item, kind in self.entries:
- if kind.lower() == 'dir':
- yield item
-
- def get_entries(self):
- return []
-
- def get_externals(self):
- return []
-
-
-class Svn13Info(SvnInfo):
- def get_entries(self):
- code, data = _run_command(['svn', 'info', '-R', '--xml', self.path],
- encoding="utf-8")
-
- if code:
- log.debug("svn info failed")
- return []
-
- return parse_dir_entries(data)
-
- def get_externals(self):
- #Previous to 1.5 --xml was not supported for svn propget and the -R
- #output format breaks the shlex compatible semantics.
- cmd = ['svn', 'propget', 'svn:externals']
- result = []
- for folder in self.iter_dirs():
- code, lines = _run_command(cmd + [folder], encoding="utf-8")
- if code != 0:
- log.warn("svn propget failed")
- return []
- #lines should a str
- for external in parse_external_prop(lines):
- if folder:
- external = os.path.join(folder, external)
- result.append(os.path.normpath(external))
-
- return result
-
-
-class Svn15Info(Svn13Info):
- def get_externals(self):
- cmd = ['svn', 'propget', 'svn:externals', self.path, '-R', '--xml']
- code, lines = _run_command(cmd, encoding="utf-8")
- if code:
- log.debug("svn propget failed")
- return []
- return parse_externals_xml(lines, prefix=os.path.abspath(self.path))
-
-
-class SvnFileInfo(SvnInfo):
-
- def __init__(self, path=''):
- super(SvnFileInfo, self).__init__(path)
- self._directories = None
- self._revision = None
-
- def _walk_svn(self, base):
- entry_file = joinpath(base, '.svn', 'entries')
- if os.path.isfile(entry_file):
- entries = SVNEntriesFile.load(base)
- yield (base, False, entries.parse_revision())
- for path in entries.get_undeleted_records():
- path = decode_as_string(path)
- path = joinpath(base, path)
- if os.path.isfile(path):
- yield (path, True, None)
- elif os.path.isdir(path):
- for item in self._walk_svn(path):
- yield item
-
- def _build_entries(self):
- entries = list()
-
- rev = 0
- for path, isfile, dir_rev in self._walk_svn(self.path):
- if isfile:
- entries.append((path, 'file'))
- else:
- entries.append((path, 'dir'))
- rev = max(rev, dir_rev)
-
- self._entries = entries
- self._revision = rev
-
- def get_entries(self):
- if self._entries is None:
- self._build_entries()
- return self._entries
-
- def get_revision(self):
- if self._revision is None:
- self._build_entries()
- return self._revision
-
- def get_externals(self):
- prop_files = [['.svn', 'dir-prop-base'],
- ['.svn', 'dir-props']]
- externals = []
-
- for dirname in self.iter_dirs():
- prop_file = None
- for rel_parts in prop_files:
- filename = joinpath(dirname, *rel_parts)
- if os.path.isfile(filename):
- prop_file = filename
-
- if prop_file is not None:
- ext_prop = parse_prop_file(prop_file, 'svn:externals')
- #ext_prop should be utf-8 coming from svn:externals
- ext_prop = decode_as_string(ext_prop, encoding="utf-8")
- externals.extend(parse_external_prop(ext_prop))
-
- return externals
-
-
-def svn_finder(dirname=''):
- #combined externals due to common interface
- #combined externals and entries due to lack of dir_props in 1.7
- info = SvnInfo.load(dirname)
- for path in info.iter_files():
- yield path
-
- for path in info.iter_externals():
- sub_info = SvnInfo.load(path)
- for sub_path in sub_info.iter_files():
- yield sub_path
-
-
-class SVNEntriesFile(object):
- def __init__(self, data):
- self.data = data
-
- @classmethod
- def load(class_, base):
- filename = os.path.join(base, '.svn', 'entries')
- f = open(filename)
- try:
- result = SVNEntriesFile.read(f)
- finally:
- f.close()
- return result
-
- @classmethod
- def read(class_, fileobj):
- data = fileobj.read()
- is_xml = data.startswith('<?xml')
- class_ = [SVNEntriesFileText, SVNEntriesFileXML][is_xml]
- return class_(data)
-
- def parse_revision(self):
- all_revs = self.parse_revision_numbers() + [0]
- return max(all_revs)
-
-
-class SVNEntriesFileText(SVNEntriesFile):
- known_svn_versions = {
- '1.4.x': 8,
- '1.5.x': 9,
- '1.6.x': 10,
- }
-
- def __get_cached_sections(self):
- return self.sections
-
- def get_sections(self):
- SECTION_DIVIDER = '\f\n'
- sections = self.data.split(SECTION_DIVIDER)
- sections = [x for x in map(str.splitlines, sections)]
- try:
- # remove the SVN version number from the first line
- svn_version = int(sections[0].pop(0))
- if not svn_version in self.known_svn_versions.values():
- log.warn("Unknown subversion verson %d", svn_version)
- except ValueError:
- return
- self.sections = sections
- self.get_sections = self.__get_cached_sections
- return self.sections
-
- def is_valid(self):
- return bool(self.get_sections())
-
- def get_url(self):
- return self.get_sections()[0][4]
-
- def parse_revision_numbers(self):
- revision_line_number = 9
- rev_numbers = [
- int(section[revision_line_number])
- for section in self.get_sections()
- if (len(section) > revision_line_number
- and section[revision_line_number])
- ]
- return rev_numbers
-
- def get_undeleted_records(self):
- undeleted = lambda s: s and s[0] and (len(s) < 6 or s[5] != 'delete')
- result = [
- section[0]
- for section in self.get_sections()
- if undeleted(section)
- ]
- return result
-
-
-class SVNEntriesFileXML(SVNEntriesFile):
- def is_valid(self):
- return True
-
- def get_url(self):
- "Get repository URL"
- urlre = re.compile('url="([^"]+)"')
- return urlre.search(self.data).group(1)
-
- def parse_revision_numbers(self):
- revre = re.compile(r'committed-rev="(\d+)"')
- return [
- int(m.group(1))
- for m in revre.finditer(self.data)
- ]
-
- def get_undeleted_records(self):
- entries_pattern = \
- re.compile(r'name="([^"]+)"(?![^>]+deleted="true")', re.I)
- results = [
- unescape(match.group(1))
- for match in entries_pattern.finditer(self.data)
- ]
- return results
-
-
-if __name__ == '__main__':
- for name in svn_finder(sys.argv[1]):
- print(name)
diff --git a/setuptools/tests/entries-v10 b/setuptools/tests/entries-v10 deleted file mode 100644 index 4446c501..00000000 --- a/setuptools/tests/entries-v10 +++ /dev/null @@ -1,615 +0,0 @@ -10 - -dir -89001 -http://svn.python.org/projects/sandbox/branches/setuptools-0.6 -http://svn.python.org/projects - - - -2013-06-03T17:26:03.052972Z -89000 -phillip.eby - - - - - - - - - - - - - - -6015fed2-1504-0410-9fe1-9d1591cc4771 - -api_tests.txt -file - - - - -2013-06-19T13:20:47.948712Z -dec366372ca14fbeaeb26f492bcf5725 -2013-05-15T22:04:59.389374Z -88997 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -12312 - -setuptools.egg-info -dir - -README.txt -file - - - - -2013-06-19T13:20:47.948712Z -26f0dd5d095522ba3ad999b6b6777b92 -2011-05-31T20:10:56.416725Z -88846 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -7615 - -easy_install.py -file - - - - -2013-06-19T13:20:47.948712Z -97b52fe7253bf4683f9f626f015eb72e -2006-09-20T20:48:18.716070Z -51935 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -126 - -setuptools -dir - -launcher.c -file - - - - -2013-06-19T13:20:47.924700Z -e5a8e77de9022688b80f77fc6d742fee -2009-10-19T21:03:29.785400Z -75544 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -7476 - -ez_setup.py -file - - - - -2013-06-19T13:20:47.924700Z -17e8ec5e08faccfcb08b5f8d5167ca14 -2011-01-20T18:50:00.815420Z -88124 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -8350 - -version -file - - - - -2013-06-19T13:20:47.924700Z -e456da09e0c9e224a56302f8316b6dbf -2007-01-09T19:21:05.921317Z -53317 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -1143 - -setup.py -file - - - - -2013-06-19T13:20:47.924700Z -d4e5b3c16bd61bfef6c0bb9377a3a3ea -2013-05-15T22:04:59.389374Z -88997 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -5228 - -release.sh -file - - - - -2013-06-19T13:20:47.932704Z -b1fd4054a1c107ff0f27baacd97be94c -2009-10-28T17:12:45.227140Z -75925 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -1044 - -pkg_resources.txt -file - - - - -2013-06-19T13:20:47.928702Z -f497e7c92a4de207cbd9ab1943f93388 -2009-10-12T20:00:02.336146Z -75385 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -94518 - -site.py -file - - - - -2013-06-19T13:20:47.932704Z -ebaac6fb6525f77ca950d22e6f8315df -2006-03-11T00:39:09.666740Z -42965 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -2362 - -version.dat -file - - - - -2013-06-19T13:20:47.932704Z -8e14ecea32b9874cd7d29277494554c0 -2009-10-28T17:12:45.227140Z -75925 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -80 - -virtual-python.py -file - - - - -2013-06-19T13:20:47.932704Z -aa857add3b5563238f0a904187f5ded9 -2005-10-17T02:26:39.000000Z -41262 -pje -has-props - - - - - - - - - - - - - - - - - - - - -3898 - -setup.cfg -file - - - - -2013-06-19T13:20:47.932704Z -eda883e744fce83f8107ad8dc8303536 -2006-09-21T22:26:48.050256Z -51965 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -296 - -setuptools.txt -file - - - - -2013-06-19T13:20:47.940708Z -11926256f06046b196eaf814772504e7 -2013-05-15T22:04:59.389374Z -88997 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -149832 - -pkg_resources.py -file - - - - -2013-06-19T13:20:47.940708Z -b63a30f5f0f0225a788c2c0e3430b3cf -2013-05-15T22:04:59.389374Z -88997 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -90397 - -tests -dir - -wikiup.cfg -file - - - - -2013-06-19T13:20:47.944710Z -34ad845a5e0a0b46458557fa910bf429 -2008-08-21T17:23:50.797633Z -65935 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -136 - -EasyInstall.txt -file - - - - -2013-06-19T13:20:47.944710Z -e97387c517f70fc18a377e42d19d64d4 -2013-05-15T22:04:59.389374Z -88997 -phillip.eby -has-props - - - - - - - - - - - - - - - - - - - - -82495 - diff --git a/setuptools/tests/environment.py b/setuptools/tests/environment.py index c8d0e669..a23c0504 100644 --- a/setuptools/tests/environment.py +++ b/setuptools/tests/environment.py @@ -1,68 +1,10 @@ import os -import zipfile import sys -import tempfile -import unittest -import shutil -import stat import unicodedata from subprocess import Popen as _Popen, PIPE as _PIPE -def _remove_dir(target): - - #on windows this seems to a problem - for dir_path, dirs, files in os.walk(target): - os.chmod(dir_path, stat.S_IWRITE) - for filename in files: - os.chmod(os.path.join(dir_path, filename), stat.S_IWRITE) - shutil.rmtree(target) - - -class ZippedEnvironment(unittest.TestCase): - - datafile = None - dataname = None - old_cwd = None - - def setUp(self): - if self.datafile is None or self.dataname is None: - return - - if not os.path.isfile(self.datafile): - self.old_cwd = None - return - - self.old_cwd = os.getcwd() - - self.temp_dir = tempfile.mkdtemp() - zip_file, source, target = [None, None, None] - try: - zip_file = zipfile.ZipFile(self.datafile) - for files in zip_file.namelist(): - zip_file.extract(files, self.temp_dir) - finally: - if zip_file: - zip_file.close() - del zip_file - - os.chdir(os.path.join(self.temp_dir, self.dataname)) - - def tearDown(self): - #Assume setUp was never completed - if self.dataname is None or self.datafile is None: - return - - try: - if self.old_cwd: - os.chdir(self.old_cwd) - _remove_dir(self.temp_dir) - except OSError: - #sigh? - pass - - def _which_dirs(cmd): result = set() for path in os.environ.get('PATH', '').split(os.pathsep): diff --git a/setuptools/tests/svn_data/dummy.zip b/setuptools/tests/svn_data/dummy.zip Binary files differdeleted file mode 100644 index 1347be53..00000000 --- a/setuptools/tests/svn_data/dummy.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy13.zip b/setuptools/tests/svn_data/dummy13.zip Binary files differdeleted file mode 100644 index 47764342..00000000 --- a/setuptools/tests/svn_data/dummy13.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy14.zip b/setuptools/tests/svn_data/dummy14.zip Binary files differdeleted file mode 100644 index 02ed8cf0..00000000 --- a/setuptools/tests/svn_data/dummy14.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy15.zip b/setuptools/tests/svn_data/dummy15.zip Binary files differdeleted file mode 100644 index ed8daeeb..00000000 --- a/setuptools/tests/svn_data/dummy15.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy16.zip b/setuptools/tests/svn_data/dummy16.zip Binary files differdeleted file mode 100644 index b6e98d6c..00000000 --- a/setuptools/tests/svn_data/dummy16.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy17.zip b/setuptools/tests/svn_data/dummy17.zip Binary files differdeleted file mode 100644 index d96e1513..00000000 --- a/setuptools/tests/svn_data/dummy17.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/dummy18.zip b/setuptools/tests/svn_data/dummy18.zip Binary files differdeleted file mode 100644 index a7267838..00000000 --- a/setuptools/tests/svn_data/dummy18.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn13_example.zip b/setuptools/tests/svn_data/svn13_example.zip Binary files differdeleted file mode 100644 index d85fb84f..00000000 --- a/setuptools/tests/svn_data/svn13_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn13_ext_list.txt b/setuptools/tests/svn_data/svn13_ext_list.txt deleted file mode 100644 index 0bb0f438..00000000 --- a/setuptools/tests/svn_data/svn13_ext_list.txt +++ /dev/null @@ -1,3 +0,0 @@ -third_party3 file:///C:/development/svn_example/repos/svn13/extra1
-third_party2 -r3 file:///C:/development/svn_example/repos/svn13/extra1
-third_party -r1 file:///C:/development/svn_example/repos/svn13/extra1
diff --git a/setuptools/tests/svn_data/svn13_ext_list.xml b/setuptools/tests/svn_data/svn13_ext_list.xml deleted file mode 100644 index e69de29b..00000000 --- a/setuptools/tests/svn_data/svn13_ext_list.xml +++ /dev/null diff --git a/setuptools/tests/svn_data/svn13_info.xml b/setuptools/tests/svn_data/svn13_info.xml deleted file mode 100644 index 5c96520a..00000000 --- a/setuptools/tests/svn_data/svn13_info.xml +++ /dev/null @@ -1,121 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<info>
-<entry
- kind="dir"
- path="svn13_example"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<prop-updated>2013-07-13T15:33:23.187500Z</prop-updated>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:33:28.359375Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn13_example\a file"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main/a%20file</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:33:21.109375Z</text-updated>
-<checksum>a6166e5e98a5a503089cde9bc8031293</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:33:21.312500Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn13_example\to_delete"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main/to_delete</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>delete</schedule>
-<text-updated>2013-07-13T15:33:28.140625Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:33:28.359375Z</date>
-</commit>
-</entry>
-<entry
- kind="dir"
- path="svn13_example\folder"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main/folder</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<prop-updated>2013-07-13T15:33:26.187500Z</prop-updated>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:33:26.312500Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn13_example\folder\quest.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main/folder/quest.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:33:20.109375Z</text-updated>
-<checksum>795240c6a830c14f83961e57e07dad12</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:33:20.312500Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn13_example\folder\lalala.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn13/main/folder/lalala.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn13/main</root>
-<uuid>d2996769-47b0-9946-b618-da1aa3eceda3</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:33:19.375000Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:33:19.609375Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/svn_data/svn14_example.zip b/setuptools/tests/svn_data/svn14_example.zip Binary files differdeleted file mode 100644 index 57093c0b..00000000 --- a/setuptools/tests/svn_data/svn14_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn14_ext_list.txt b/setuptools/tests/svn_data/svn14_ext_list.txt deleted file mode 100644 index 800a0965..00000000 --- a/setuptools/tests/svn_data/svn14_ext_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -third_party3 file:///C:/development/svn_example/repos/svn13/extra1
-third_party2 -r3 file:///C:/development/svn_example/repos/svn13/extra1
-third_party -r1 file:///C:/development/svn_example/repos/svn13/extra1
-
diff --git a/setuptools/tests/svn_data/svn14_ext_list.xml b/setuptools/tests/svn_data/svn14_ext_list.xml deleted file mode 100644 index e69de29b..00000000 --- a/setuptools/tests/svn_data/svn14_ext_list.xml +++ /dev/null diff --git a/setuptools/tests/svn_data/svn14_info.xml b/setuptools/tests/svn_data/svn14_info.xml deleted file mode 100644 index a896a77f..00000000 --- a/setuptools/tests/svn_data/svn14_info.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0"?>
-<info>
-<entry
- kind="dir"
- path="svn14_example"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:34:14.406250Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn14_example\a file"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main/a%20file</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:34:08.109375Z</text-updated>
-<checksum>a6166e5e98a5a503089cde9bc8031293</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:34:08.390625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn14_example\to_delete"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main/to_delete</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>delete</schedule>
-<text-updated>2013-07-13T15:34:14.125000Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:34:14.406250Z</date>
-</commit>
-</entry>
-<entry
- kind="dir"
- path="svn14_example\folder"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main/folder</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:34:12.390625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn14_example\folder\quest.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main/folder/quest.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:34:07.109375Z</text-updated>
-<checksum>795240c6a830c14f83961e57e07dad12</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:34:07.390625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn14_example\folder\lalala.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn14/main/folder/lalala.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn14/main</root>
-<uuid>c75942e5-8b7a-354d-b1cf-73dee23fa94f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<text-updated>2013-07-13T15:34:06.250000Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:34:06.531250Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/svn_data/svn15_example.zip b/setuptools/tests/svn_data/svn15_example.zip Binary files differdeleted file mode 100644 index 52a1d45b..00000000 --- a/setuptools/tests/svn_data/svn15_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn15_ext_list.txt b/setuptools/tests/svn_data/svn15_ext_list.txt deleted file mode 100644 index 75fde4e6..00000000 --- a/setuptools/tests/svn_data/svn15_ext_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -third_party3 file:///C:/development/svn_example/repos/svn15/extra1
--r3 file:///C:/development/svn_example/repos/svn15/extra1 third_party2
-file:///C:/development/svn_example/repos/svn15/extra1@r1 third_party
-
diff --git a/setuptools/tests/svn_data/svn15_ext_list.xml b/setuptools/tests/svn_data/svn15_ext_list.xml deleted file mode 100644 index 6950b3c5..00000000 --- a/setuptools/tests/svn_data/svn15_ext_list.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?>
-<properties>
-<target
- path="C:/development/svn_example/svn15_example/folder">
-<property
- name="svn:externals">third_party3 file:///C:/development/svn_example/repos/svn15/extra2
--r3 file:///C:/development/svn_example/repos/svn15/extra2 third_party2
-file:///C:/development/svn_example/repos/svn15/extra2@r1 third_party大介
-</property>
-</target>
-<target
- path="C:/development/svn_example/svn15_example">
-<property
- name="svn:externals">third_party3 file:///C:/development/svn_example/repos/svn15/extra1
--r3 file:///C:/development/svn_example/repos/svn15/extra1 third_party2
-file:///C:/development/svn_example/repos/svn15/extra1@r1 third_party大介
-</property>
-</target>
-</properties>
diff --git a/setuptools/tests/svn_data/svn15_info.xml b/setuptools/tests/svn_data/svn15_info.xml deleted file mode 100644 index 0b3550af..00000000 --- a/setuptools/tests/svn_data/svn15_info.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0"?>
-<info>
-<entry
- kind="dir"
- path="svn15_example"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:34:49.562500Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn15_example\a file"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main/a%20file</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:34:43.109375Z</text-updated>
-<checksum>a6166e5e98a5a503089cde9bc8031293</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:34:43.484375Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn15_example\to_delete"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main/to_delete</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>delete</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:34:49.125000Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:34:49.562500Z</date>
-</commit>
-</entry>
-<entry
- kind="dir"
- path="svn15_example\folder"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main/folder</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:34:47.515625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn15_example\folder\quest.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main/folder/quest.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:34:42.109375Z</text-updated>
-<checksum>795240c6a830c14f83961e57e07dad12</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:34:42.484375Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn15_example\folder\lalala.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn15/main/folder/lalala.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn15/main</root>
-<uuid>4eab6983-54fe-384b-a282-9306f52d948f</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:34:41.375000Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:34:41.734375Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/svn_data/svn16_example.zip b/setuptools/tests/svn_data/svn16_example.zip Binary files differdeleted file mode 100644 index e886b2af..00000000 --- a/setuptools/tests/svn_data/svn16_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn16_ext_list.txt b/setuptools/tests/svn_data/svn16_ext_list.txt deleted file mode 100644 index 3ca54893..00000000 --- a/setuptools/tests/svn_data/svn16_ext_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -"third party3" file:///C:/development/svn_example/repos/svn16/extra1
-'third party3b' file:///C:/development/svn_example/repos/svn16/extra1
--r3 file:///C:/development/svn_example/repos/svn16/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn16/extra1@r1 third_party
diff --git a/setuptools/tests/svn_data/svn16_ext_list.xml b/setuptools/tests/svn_data/svn16_ext_list.xml deleted file mode 100644 index 8ddaed0a..00000000 --- a/setuptools/tests/svn_data/svn16_ext_list.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?>
-<properties>
-<target
- path="C:/development/svn_example/svn16_example/folder">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn16/extra2
--r3 file:///C:/development/svn_example/repos/svn16/extra2 third\ party2
-file:///C:/development/svn_example/repos/svn16/extra2@r1 third_party大介
-</property>
-</target>
-<target
- path="C:/development/svn_example/svn16_example">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn16/extra1
--r3 file:///C:/development/svn_example/repos/svn16/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn16/extra1@r1 third_party大介
-</property>
-</target>
-</properties>
diff --git a/setuptools/tests/svn_data/svn16_info.xml b/setuptools/tests/svn_data/svn16_info.xml deleted file mode 100644 index 745469c9..00000000 --- a/setuptools/tests/svn_data/svn16_info.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0"?>
-<info>
-<entry
- kind="dir"
- path="svn16_example"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:17.390625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn16_example\a file"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main/a%20file</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:14.578125Z</text-updated>
-<checksum>a6166e5e98a5a503089cde9bc8031293</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:35:14.906250Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn16_example\to_delete"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main/to_delete</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>delete</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:17.046875Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:17.390625Z</date>
-</commit>
-</entry>
-<entry
- kind="dir"
- path="svn16_example\folder"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main/folder</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:35:16.406250Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn16_example\folder\quest.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main/folder/quest.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:14.078125Z</text-updated>
-<checksum>795240c6a830c14f83961e57e07dad12</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:35:14.421875Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn16_example\folder\lalala.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn16/main/folder/lalala.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn16/main</root>
-<uuid>bd8d2cfc-1a74-de45-b166-262010c17c0a</uuid>
-</repository>
-<wc-info>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:12.171875Z</text-updated>
-<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:35:13.906250Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/svn_data/svn17_example.zip b/setuptools/tests/svn_data/svn17_example.zip Binary files differdeleted file mode 100644 index ba0e8823..00000000 --- a/setuptools/tests/svn_data/svn17_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn17_ext_list.txt b/setuptools/tests/svn_data/svn17_ext_list.txt deleted file mode 100644 index a8b832a8..00000000 --- a/setuptools/tests/svn_data/svn17_ext_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -"third party3" file:///C:/development/svn_example/repos/svn17/extra1
-'third party3b' file:///C:/development/svn_example/repos/svn17/extra1
--r3 file:///C:/development/svn_example/repos/svn17/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn17/extra1@r1 third_party
diff --git a/setuptools/tests/svn_data/svn17_ext_list.xml b/setuptools/tests/svn_data/svn17_ext_list.xml deleted file mode 100644 index 2879bb65..00000000 --- a/setuptools/tests/svn_data/svn17_ext_list.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<properties>
-<target
- path="C:/development/svn_example/svn17_example">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn16/extra1
--r3 file:///C:/development/svn_example/repos/svn16/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn16/extra1@r1 third_party大介
-</property>
-</target>
-<target
- path="C:/development/svn_example/svn17_example/folder">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn17/extra2
--r3 file:///C:/development/svn_example/repos/svn17/extra2 third\ party2
-file:///C:/development/svn_example/repos/svn17/extra2@r1 third_party大介
-</property>
-</target>
-</properties>
diff --git a/setuptools/tests/svn_data/svn17_info.xml b/setuptools/tests/svn_data/svn17_info.xml deleted file mode 100644 index 6cffeffd..00000000 --- a/setuptools/tests/svn_data/svn17_info.xml +++ /dev/null @@ -1,130 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<info>
-<entry
- kind="dir"
- path="svn17_example"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn17/main</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:36.171875Z</date>
-</commit>
-</entry>
-<entry
- path="svn17_example\folder"
- revision="6"
- kind="dir">
-<url>file:///C:/development/svn_example/repos/svn17/main/folder</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:35:34.859375Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn17_example\folder\quest.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn17/main/folder/quest.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:32.812500Z</text-updated>
-<checksum>bc80eba9e7a10c0a571a4678c520bc9683f3bac2</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:35:33.109375Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn17_example\folder\lalala.txt"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn17/main/folder/lalala.txt</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:32.343750Z</text-updated>
-<checksum>da39a3ee5e6b4b0d3255bfef95601890afd80709</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:35:32.687500Z</date>
-</commit>
-</entry>
-<entry
- path="svn17_example\a file"
- revision="6"
- kind="file">
-<url>file:///C:/development/svn_example/repos/svn17/main/a%20file</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:33.187500Z</text-updated>
-<checksum>43785ab4b1816b49f242990883292813cd4f486c</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:35:33.515625Z</date>
-</commit>
-</entry>
-<entry
- path="svn17_example\to_delete"
- revision="6"
- kind="file">
-<url>file:///C:/development/svn_example/repos/svn17/main/to_delete</url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn17/main</root>
-<uuid>5ba45434-5197-164e-afab-81923f4744f5</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn17_example</wcroot-abspath>
-<schedule>delete</schedule>
-<depth>infinity</depth>
-<checksum>da39a3ee5e6b4b0d3255bfef95601890afd80709</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:36.171875Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/svn_data/svn18_example.zip b/setuptools/tests/svn_data/svn18_example.zip Binary files differdeleted file mode 100644 index 4362f8e9..00000000 --- a/setuptools/tests/svn_data/svn18_example.zip +++ /dev/null diff --git a/setuptools/tests/svn_data/svn18_ext_list.txt b/setuptools/tests/svn_data/svn18_ext_list.txt deleted file mode 100644 index c90a5f11..00000000 --- a/setuptools/tests/svn_data/svn18_ext_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -"third party3" file:///C:/development/svn_example/repos/svn18/extra1
-'third party3b' file:///C:/development/svn_example/repos/svn18/extra1
--r3 file:///C:/development/svn_example/repos/svn18/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn18/extra1@r1 third_party
diff --git a/setuptools/tests/svn_data/svn18_ext_list.xml b/setuptools/tests/svn_data/svn18_ext_list.xml deleted file mode 100644 index 9b5e9e96..00000000 --- a/setuptools/tests/svn_data/svn18_ext_list.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<properties>
-<target
- path="C:/development/svn_example/svn18_example">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn16/extra1
--r3 file:///C:/development/svn_example/repos/svn16/extra1 third\ party2
-file:///C:/development/svn_example/repos/svn16/extra1@r1 third_party大介
-</property>
-</target>
-<target
- path="C:/development/svn_example/svn18_example/folder">
-<property
- name="svn:externals">"third party3" file:///C:/development/svn_example/repos/svn18/extra2
--r3 file:///C:/development/svn_example/repos/svn18/extra2 third\ party2
-file:///C:/development/svn_example/repos/svn18/extra2@r1 third_party大介
-</property>
-</target>
-</properties>
diff --git a/setuptools/tests/svn_data/svn18_info.xml b/setuptools/tests/svn_data/svn18_info.xml deleted file mode 100644 index 7ca55995..00000000 --- a/setuptools/tests/svn_data/svn18_info.xml +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<info>
-<entry
- path="svn18_example"
- revision="6"
- kind="dir">
-<url>file:///C:/development/svn_example/repos/svn18/main</url>
-<relative-url>^/</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:57.796875Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn18_example\a file"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn18/main/a%20file</url>
-<relative-url>^/a%20file</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:54.906250Z</text-updated>
-<checksum>43785ab4b1816b49f242990883292813cd4f486c</checksum>
-</wc-info>
-<commit
- revision="3">
-<author>ptt</author>
-<date>2013-07-13T15:35:55.265625Z</date>
-</commit>
-</entry>
-<entry
- kind="file"
- path="svn18_example\to_delete"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn18/main/to_delete</url>
-<relative-url>^/to_delete</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>delete</schedule>
-<depth>infinity</depth>
-<checksum>da39a3ee5e6b4b0d3255bfef95601890afd80709</checksum>
-</wc-info>
-<commit
- revision="6">
-<author>ptt</author>
-<date>2013-07-13T15:35:57.796875Z</date>
-</commit>
-</entry>
-<entry
- kind="dir"
- path="svn18_example\folder"
- revision="6">
-<url>file:///C:/development/svn_example/repos/svn18/main/folder</url>
-<relative-url>^/folder</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-</wc-info>
-<commit
- revision="5">
-<author>ptt</author>
-<date>2013-07-13T15:35:56.750000Z</date>
-</commit>
-</entry>
-<entry
- path="svn18_example\folder\quest.txt"
- revision="6"
- kind="file">
-<url>file:///C:/development/svn_example/repos/svn18/main/folder/quest.txt</url>
-<relative-url>^/folder/quest.txt</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:54.484375Z</text-updated>
-<checksum>bc80eba9e7a10c0a571a4678c520bc9683f3bac2</checksum>
-</wc-info>
-<commit
- revision="2">
-<author>ptt</author>
-<date>2013-07-13T15:35:54.843750Z</date>
-</commit>
-</entry>
-<entry
- path="svn18_example\folder\lalala.txt"
- revision="6"
- kind="file">
-<url>file:///C:/development/svn_example/repos/svn18/main/folder/lalala.txt</url>
-<relative-url>^/folder/lalala.txt</relative-url>
-<repository>
-<root>file:///C:/development/svn_example/repos/svn18/main</root>
-<uuid>3c5e3929-c92b-7045-9ba9-5e65d3dd1ee9</uuid>
-</repository>
-<wc-info>
-<wcroot-abspath>C:/development/svn_example/svn18_example</wcroot-abspath>
-<schedule>normal</schedule>
-<depth>infinity</depth>
-<text-updated>2013-07-13T15:35:54.015625Z</text-updated>
-<checksum>da39a3ee5e6b4b0d3255bfef95601890afd80709</checksum>
-</wc-info>
-<commit
- revision="1">
-<author>ptt</author>
-<date>2013-07-13T15:35:54.375000Z</date>
-</commit>
-</entry>
-</info>
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index e8068420..6b4d917f 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -1,28 +1,16 @@ - -import distutils.core import os -import sys import tempfile import shutil import stat import unittest -import pkg_resources -import warnings -from setuptools.command import egg_info -from setuptools import svn_utils -from setuptools.tests import environment, test_svn -from setuptools.tests.py26compat import skipIf - -ENTRIES_V10 = pkg_resources.resource_string(__name__, 'entries-v10') -"An entries file generated with svn 1.6.17 against the legacy Setuptools repo" +from . import environment class TestEggInfo(unittest.TestCase): def setUp(self): self.test_dir = tempfile.mkdtemp() - os.mkdir(os.path.join(self.test_dir, '.svn')) self.old_cwd = os.getcwd() os.chdir(self.test_dir) @@ -31,12 +19,6 @@ class TestEggInfo(unittest.TestCase): os.chdir(self.old_cwd) shutil.rmtree(self.test_dir) - def _write_entries(self, entries): - fn = os.path.join(self.test_dir, '.svn', 'entries') - entries_f = open(fn, 'wb') - entries_f.write(entries) - entries_f.close() - def _create_project(self): with open('setup.py', 'w') as f: f.write('from setuptools import setup\n') @@ -51,52 +33,6 @@ class TestEggInfo(unittest.TestCase): f.write('def run():\n') f.write(" print('hello')\n") - @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") - def test_version_10_format(self): - """ - """ - #keeping this set for 1.6 is a good check on the get_svn_revision - #to ensure I return using svnversion what would had been returned - version_str = svn_utils.SvnInfo.get_svn_version() - version = [int(x) for x in version_str.split('.')[:2]] - if version != [1, 6]: - if hasattr(self, 'skipTest'): - self.skipTest('') - else: - sys.stderr.write('\n Skipping due to SVN Version\n') - return - - self._write_entries(ENTRIES_V10) - rev = egg_info.egg_info.get_svn_revision() - self.assertEqual(rev, '89000') - - def test_version_10_format_legacy_parser(self): - """ - """ - path_variable = None - for env in os.environ: - if env.lower() == 'path': - path_variable = env - - if path_variable: - old_path = os.environ[path_variable] - os.environ[path_variable] = '' - #catch_warnings not available until py26 - warning_filters = warnings.filters - warnings.filters = warning_filters[:] - try: - warnings.simplefilter("ignore", DeprecationWarning) - self._write_entries(ENTRIES_V10) - rev = egg_info.egg_info.get_svn_revision() - finally: - #restore the warning filters - warnings.filters = warning_filters - #restore the os path - if path_variable: - os.environ[path_variable] = old_path - - self.assertEqual(rev, '89000') - def test_egg_base_installed_egg_info(self): self._create_project() temp_dir = tempfile.mkdtemp(prefix='setuptools-test.') @@ -139,130 +75,5 @@ class TestEggInfo(unittest.TestCase): shutil.rmtree(temp_dir) -DUMMY_SOURCE_TXT = """CHANGES.txt -CONTRIBUTORS.txt -HISTORY.txt -LICENSE -MANIFEST.in -README.txt -setup.py -dummy/__init__.py -dummy/test.txt -dummy.egg-info/PKG-INFO -dummy.egg-info/SOURCES.txt -dummy.egg-info/dependency_links.txt -dummy.egg-info/top_level.txt""" - - -class TestSvnDummy(environment.ZippedEnvironment): - - def setUp(self): - version = svn_utils.SvnInfo.get_svn_version() - if not version: # None or Empty - return None - - self.base_version = tuple([int(x) for x in version.split('.')][:2]) - - if not self.base_version: - raise ValueError('No SVN tools installed') - elif self.base_version < (1, 3): - raise ValueError('Insufficient SVN Version %s' % version) - elif self.base_version >= (1, 9): - #trying the latest version - self.base_version = (1, 8) - - self.dataname = "dummy%i%i" % self.base_version - self.datafile = os.path.join('setuptools', 'tests', - 'svn_data', self.dataname + ".zip") - super(TestSvnDummy, self).setUp() - - @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") - def test_sources(self): - code, data = environment.run_setup_py(["sdist"], - pypath=self.old_cwd, - data_stream=1) - if code: - raise AssertionError(data) - - sources = os.path.join('dummy.egg-info', 'SOURCES.txt') - infile = open(sources, 'r') - try: - read_contents = infile.read() - finally: - infile.close() - del infile - - self.assertEqual(DUMMY_SOURCE_TXT, read_contents) - - return data - - @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") - def test_svn_tags(self): - code, data = environment.run_setup_py(["egg_info", - "--tag-svn-revision"], - pypath=self.old_cwd, - data_stream=1) - if code: - raise AssertionError(data) - - pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') - infile = open(pkginfo, 'r') - try: - read_contents = infile.readlines() - finally: - infile.close() - del infile - - self.assertTrue("Version: 0.1.1.post1\n" in read_contents) - - @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") - def test_no_tags(self): - code, data = environment.run_setup_py(["egg_info"], - pypath=self.old_cwd, - data_stream=1) - if code: - raise AssertionError(data) - - pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') - infile = open(pkginfo, 'r') - try: - read_contents = infile.readlines() - finally: - infile.close() - del infile - - self.assertTrue("Version: 0.1.1\n" in read_contents) - - -class TestSvnDummyLegacy(environment.ZippedEnvironment): - - def setUp(self): - self.base_version = (1, 6) - self.dataname = "dummy%i%i" % self.base_version - self.datafile = os.path.join('setuptools', 'tests', - 'svn_data', self.dataname + ".zip") - super(TestSvnDummyLegacy, self).setUp() - - def test_sources(self): - code, data = environment.run_setup_py(["sdist"], - pypath=self.old_cwd, - path="", - data_stream=1) - if code: - raise AssertionError(data) - - sources = os.path.join('dummy.egg-info', 'SOURCES.txt') - infile = open(sources, 'r') - try: - read_contents = infile.read() - finally: - infile.close() - del infile - - self.assertEqual(DUMMY_SOURCE_TXT, read_contents) - - return data - - def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 5f8a190f..bece76d2 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -8,16 +8,13 @@ import sys import tempfile import unittest import unicodedata -import re import contextlib -from setuptools.tests import environment, test_svn from setuptools.tests.py26compat import skipIf from setuptools.compat import StringIO, unicode, PY3, PY2 -from setuptools.command.sdist import sdist, walk_revctrl +from setuptools.command.sdist import sdist from setuptools.command.egg_info import manifest_maker from setuptools.dist import Distribution -from setuptools import svn_utils SETUP_ATTRS = { 'name': 'sdist_test', @@ -418,135 +415,6 @@ class TestSdistTest(unittest.TestCase): except UnicodeDecodeError: self.assertFalse(filename in cmd.filelist.files) -class TestDummyOutput(environment.ZippedEnvironment): - - def setUp(self): - self.datafile = os.path.join('setuptools', 'tests', - 'svn_data', "dummy.zip") - self.dataname = "dummy" - super(TestDummyOutput, self).setUp() - - def _run(self): - code, data = environment.run_setup_py(["sdist"], - pypath=self.old_cwd, - data_stream=0) - if code: - info = "DIR: " + os.path.abspath('.') - info += "\n SDIST RETURNED: %i\n\n" % code - info += data - raise AssertionError(info) - - datalines = data.splitlines() - - possible = ( - "running sdist", - "running egg_info", - "creating dummy\.egg-info", - "writing dummy\.egg-info", - "writing top-level names to dummy\.egg-info", - "writing dependency_links to dummy\.egg-info", - "writing manifest file 'dummy\.egg-info", - "reading manifest file 'dummy\.egg-info", - "reading manifest template 'MANIFEST\.in'", - "writing manifest file 'dummy\.egg-info", - "creating dummy-0.1.1", - "making hard links in dummy-0\.1\.1", - "copying files to dummy-0\.1\.1", - "copying \S+ -> dummy-0\.1\.1", - "copying dummy", - "copying dummy\.egg-info", - "hard linking \S+ -> dummy-0\.1\.1", - "hard linking dummy", - "hard linking dummy\.egg-info", - "Writing dummy-0\.1\.1", - "creating dist", - "creating 'dist", - "Creating tar archive", - "running check", - "adding 'dummy-0\.1\.1", - "tar .+ dist/dummy-0\.1\.1\.tar dummy-0\.1\.1", - "gzip .+ dist/dummy-0\.1\.1\.tar", - "removing 'dummy-0\.1\.1' \\(and everything under it\\)", - ) - - print(" DIR: " + os.path.abspath('.')) - for line in datalines: - found = False - for pattern in possible: - if re.match(pattern, line): - print(" READ: " + line) - found = True - break - if not found: - raise AssertionError("Unexpexected: %s\n-in-\n%s" - % (line, data)) - - return data - - def test_sources(self): - self._run() - - -class TestSvn(environment.ZippedEnvironment): - - def setUp(self): - version = svn_utils.SvnInfo.get_svn_version() - if not version: # None or Empty - return - - self.base_version = tuple([int(x) for x in version.split('.')][:2]) - - if not self.base_version: - raise ValueError('No SVN tools installed') - elif self.base_version < (1, 3): - raise ValueError('Insufficient SVN Version %s' % version) - elif self.base_version >= (1, 9): - # trying the latest version - self.base_version = (1, 8) - - self.dataname = "svn%i%i_example" % self.base_version - self.datafile = os.path.join('setuptools', 'tests', - 'svn_data', self.dataname + ".zip") - super(TestSvn, self).setUp() - - @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") - def test_walksvn(self): - if self.base_version >= (1, 6): - folder2 = 'third party2' - folder3 = 'third party3' - else: - folder2 = 'third_party2' - folder3 = 'third_party3' - - # TODO is this right - expected = set([ - os.path.join('a file'), - os.path.join(folder2, 'Changes.txt'), - os.path.join(folder2, 'MD5SUMS'), - os.path.join(folder2, 'README.txt'), - os.path.join(folder3, 'Changes.txt'), - os.path.join(folder3, 'MD5SUMS'), - os.path.join(folder3, 'README.txt'), - os.path.join(folder3, 'TODO.txt'), - os.path.join(folder3, 'fin'), - os.path.join('third_party', 'README.txt'), - os.path.join('folder', folder2, 'Changes.txt'), - os.path.join('folder', folder2, 'MD5SUMS'), - os.path.join('folder', folder2, 'WatashiNiYomimasu.txt'), - os.path.join('folder', folder3, 'Changes.txt'), - os.path.join('folder', folder3, 'fin'), - os.path.join('folder', folder3, 'MD5SUMS'), - os.path.join('folder', folder3, 'oops'), - os.path.join('folder', folder3, 'WatashiNiYomimasu.txt'), - os.path.join('folder', folder3, 'ZuMachen.txt'), - os.path.join('folder', 'third_party', 'WatashiNiYomimasu.txt'), - os.path.join('folder', 'lalala.txt'), - os.path.join('folder', 'quest.txt'), - # The example will have a deleted file - # (or should) but shouldn't return it - ]) - self.assertEqual(set(x for x in walk_revctrl()), expected) - def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) diff --git a/setuptools/tests/test_svn.py b/setuptools/tests/test_svn.py deleted file mode 100644 index 33400362..00000000 --- a/setuptools/tests/test_svn.py +++ /dev/null @@ -1,245 +0,0 @@ -# -*- coding: utf-8 -*- -"""svn tests""" - -import io -import os -import subprocess -import sys -import unittest -from setuptools.tests import environment -from setuptools.compat import unicode, unichr - -from setuptools import svn_utils -from setuptools.tests.py26compat import skipIf - - -def _do_svn_check(): - try: - subprocess.check_call(["svn", "--version"], - shell=(sys.platform == 'win32')) - return True - except (OSError, subprocess.CalledProcessError): - return False -_svn_check = _do_svn_check() - - -class TestSvnVersion(unittest.TestCase): - - def test_no_svn_found(self): - path_variable = None - for env in os.environ: - if env.lower() == 'path': - path_variable = env - - if path_variable is None: - try: - self.skipTest('Cannot figure out how to modify path') - except AttributeError: # PY26 doesn't have this - return - - old_path = os.environ[path_variable] - os.environ[path_variable] = '' - try: - version = svn_utils.SvnInfo.get_svn_version() - self.assertEqual(version, '') - finally: - os.environ[path_variable] = old_path - - @skipIf(not _svn_check, "No SVN to text, in the first place") - def test_svn_should_exist(self): - version = svn_utils.SvnInfo.get_svn_version() - self.assertNotEqual(version, '') - -def _read_utf8_file(path): - fileobj = None - try: - fileobj = io.open(path, 'r', encoding='utf-8') - data = fileobj.read() - return data - finally: - if fileobj: - fileobj.close() - - -class ParserInfoXML(unittest.TestCase): - - def parse_tester(self, svn_name, ext_spaces): - path = os.path.join('setuptools', 'tests', - 'svn_data', svn_name + '_info.xml') - #Remember these are pre-generated to test XML parsing - # so these paths might not valid on your system - example_base = "%s_example" % svn_name - - data = _read_utf8_file(path) - - expected = set([ - ("\\".join((example_base, 'a file')), 'file'), - ("\\".join((example_base, 'folder')), 'dir'), - ("\\".join((example_base, 'folder', 'lalala.txt')), 'file'), - ("\\".join((example_base, 'folder', 'quest.txt')), 'file'), - ]) - self.assertEqual(set(x for x in svn_utils.parse_dir_entries(data)), - expected) - - def test_svn13(self): - self.parse_tester('svn13', False) - - def test_svn14(self): - self.parse_tester('svn14', False) - - def test_svn15(self): - self.parse_tester('svn15', False) - - def test_svn16(self): - self.parse_tester('svn16', True) - - def test_svn17(self): - self.parse_tester('svn17', True) - - def test_svn18(self): - self.parse_tester('svn18', True) - -class ParserExternalXML(unittest.TestCase): - - def parse_tester(self, svn_name, ext_spaces): - path = os.path.join('setuptools', 'tests', - 'svn_data', svn_name + '_ext_list.xml') - example_base = svn_name + '_example' - data = _read_utf8_file(path) - - if ext_spaces: - folder2 = 'third party2' - folder3 = 'third party3' - else: - folder2 = 'third_party2' - folder3 = 'third_party3' - - expected = set([ - os.sep.join((example_base, folder2)), - os.sep.join((example_base, folder3)), - # folder is third_party大介 - os.sep.join((example_base, - unicode('third_party') + - unichr(0x5927) + unichr(0x4ecb))), - os.sep.join((example_base, 'folder', folder2)), - os.sep.join((example_base, 'folder', folder3)), - os.sep.join((example_base, 'folder', - unicode('third_party') + - unichr(0x5927) + unichr(0x4ecb))), - ]) - - expected = set(os.path.normpath(x) for x in expected) - dir_base = os.sep.join(('C:', 'development', 'svn_example')) - self.assertEqual(set(x for x - in svn_utils.parse_externals_xml(data, dir_base)), expected) - - def test_svn15(self): - self.parse_tester('svn15', False) - - def test_svn16(self): - self.parse_tester('svn16', True) - - def test_svn17(self): - self.parse_tester('svn17', True) - - def test_svn18(self): - self.parse_tester('svn18', True) - - -class ParseExternal(unittest.TestCase): - - def parse_tester(self, svn_name, ext_spaces): - path = os.path.join('setuptools', 'tests', - 'svn_data', svn_name + '_ext_list.txt') - data = _read_utf8_file(path) - - if ext_spaces: - expected = set(['third party2', 'third party3', - 'third party3b', 'third_party']) - else: - expected = set(['third_party2', 'third_party3', 'third_party']) - - self.assertEqual(set(x for x in svn_utils.parse_external_prop(data)), - expected) - - def test_svn13(self): - self.parse_tester('svn13', False) - - def test_svn14(self): - self.parse_tester('svn14', False) - - def test_svn15(self): - self.parse_tester('svn15', False) - - def test_svn16(self): - self.parse_tester('svn16', True) - - def test_svn17(self): - self.parse_tester('svn17', True) - - def test_svn18(self): - self.parse_tester('svn18', True) - - -class TestSvn(environment.ZippedEnvironment): - - def setUp(self): - version = svn_utils.SvnInfo.get_svn_version() - if not version: # empty or null - self.dataname = None - self.datafile = None - return - - self.base_version = tuple([int(x) for x in version.split('.')[:2]]) - - if self.base_version < (1,3): - raise ValueError('Insufficient SVN Version %s' % version) - elif self.base_version >= (1,9): - #trying the latest version - self.base_version = (1,8) - - self.dataname = "svn%i%i_example" % self.base_version - self.datafile = os.path.join('setuptools', 'tests', - 'svn_data', self.dataname + ".zip") - super(TestSvn, self).setUp() - - @skipIf(not _svn_check, "No SVN to text, in the first place") - def test_revision(self): - rev = svn_utils.SvnInfo.load('.').get_revision() - self.assertEqual(rev, 6) - - @skipIf(not _svn_check, "No SVN to text, in the first place") - def test_entries(self): - expected = set([ - (os.path.join('a file'), 'file'), - (os.path.join('folder'), 'dir'), - (os.path.join('folder', 'lalala.txt'), 'file'), - (os.path.join('folder', 'quest.txt'), 'file'), - #The example will have a deleted file (or should) - #but shouldn't return it - ]) - info = svn_utils.SvnInfo.load('.') - self.assertEqual(set(x for x in info.entries), expected) - - @skipIf(not _svn_check, "No SVN to text, in the first place") - def test_externals(self): - if self.base_version >= (1,6): - folder2 = 'third party2' - folder3 = 'third party3' - else: - folder2 = 'third_party2' - folder3 = 'third_party3' - - expected = set([ - os.path.join(folder2), - os.path.join(folder3), - os.path.join('third_party'), - os.path.join('folder', folder2), - os.path.join('folder', folder3), - os.path.join('folder', 'third_party'), - ]) - info = svn_utils.SvnInfo.load('.') - self.assertEqual(set([x for x in info.externals]), expected) - -def test_suite(): - return unittest.defaultTestLoader.loadTestsFromName(__name__) |