From 5a3dbe5d5b8cb07a292b8fee2cd83fbc1bcbd16f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 19 Jun 2013 08:38:55 -0500 Subject: Add test capturing failure on Python 3 in egg_info.get_svn_revision (#20). egg_info.get_svn_revision is now a staticmethod. --- MANIFEST.in | 2 +- setuptools/command/egg_info.py | 5 +- setuptools/tests/entries-v10 | 615 ++++++++++++++++++++++++++++++++++++++ setuptools/tests/test_egg_info.py | 40 +++ 4 files changed, 659 insertions(+), 3 deletions(-) create mode 100644 setuptools/tests/entries-v10 create mode 100644 setuptools/tests/test_egg_info.py diff --git a/MANIFEST.in b/MANIFEST.in index 68337800..ff102123 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ recursive-include setuptools *.py *.txt *.exe *.xml recursive-include tests *.py *.c *.pyx *.txt -recursive-include setuptools/tests *.html +recursive-include setuptools/tests *.html entries* recursive-include docs *.py *.txt *.conf *.css *.css_t Makefile indexsidebar.html recursive-include _markerlib *.py include *.py diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index cd3ea198..5863d2d4 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -210,7 +210,8 @@ class egg_info(Command): - def get_svn_revision(self): + @staticmethod + def get_svn_revision(): revision = 0 urlre = re.compile('url="([^"]+)"') revre = re.compile('committed-rev="(\d+)"') @@ -234,7 +235,7 @@ class egg_info(Command): log.warn("unrecognized .svn/entries format; skipping %s", base) dirs[:] = [] continue - + data = map(str.splitlines,data.split('\n\x0c\n')) del data[0][0] # get rid of the '8' or '9' or '10' dirurl = data[0][3] diff --git a/setuptools/tests/entries-v10 b/setuptools/tests/entries-v10 new file mode 100644 index 00000000..4446c501 --- /dev/null +++ b/setuptools/tests/entries-v10 @@ -0,0 +1,615 @@ +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/test_egg_info.py b/setuptools/tests/test_egg_info.py new file mode 100644 index 00000000..f26a1f51 --- /dev/null +++ b/setuptools/tests/test_egg_info.py @@ -0,0 +1,40 @@ +import os +import tempfile +import shutil +import unittest + +import pkg_resources +from setuptools.command import egg_info + +ENTRIES_V10 = pkg_resources.resource_string(__name__, 'entries-v10') +"An entries file generated with svn 1.6.17 against the legacy Setuptools repo" + +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) + + def tearDown(self): + 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 test_version_10_format(self): + """ + """ + self._write_entries(ENTRIES_V10) + rev = egg_info.egg_info.get_svn_revision() + self.assertEqual(rev, '89000') + + +def test_suite(): + return unittest.defaultTestLoader.loadTestsFromName(__name__) -- cgit v1.2.3 From e2b6f95a403f2152dacba8229ea8b91aecc3328e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 19 Jun 2013 08:47:43 -0500 Subject: Reference parsed svn version variable instead of the whole of the data. Fixes #20 --- CHANGES.txt | 6 ++++++ setuptools/command/egg_info.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 77ab44aa..d736ca2c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +----- +0.7.4 +----- + +* Issue #20: Fix comparison of parsed SVN version on Python 3. + ----- 0.7.3 ----- diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 5863d2d4..b283b28a 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -231,7 +231,7 @@ class egg_info(Command): else: try: svnver = int(data.splitlines()[0]) except: svnver=-1 - if data<8: + if svnver<8: log.warn("unrecognized .svn/entries format; skipping %s", base) dirs[:] = [] continue -- cgit v1.2.3 From af8cbefb0b5e07834e80bacc7278350b183ca63d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 19 Jun 2013 08:51:21 -0500 Subject: Added tag 0.7.4 for changeset 85640475dda0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index cc2b4225..1cc2fd48 100644 --- a/.hgtags +++ b/.hgtags @@ -63,3 +63,4 @@ ddca71ae5ceb9b14512dc60ea83802c10e224cf0 0.6.45 024dd30ed702135f5328975042566e48cc479d7d 0.7.1 d04c05f035e3a5636006fc34f4be7e6c77035d17 0.7.2 d212e48e0cef689acba57ed017289c027660b23c 0.7.3 +85640475dda0621f20e11db0995fa07f51744a98 0.7.4 -- cgit v1.2.3 From aa2269f68c8708f6498300f7d0a93a3a5eba562f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 19 Jun 2013 08:51:59 -0500 Subject: Bumped to 0.7.5 in preparation for next release. --- README.txt | 8 ++++---- docs/conf.py | 4 ++-- ez_setup.py | 2 +- release.py | 2 +- setup.py | 2 +- setuptools/__init__.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.txt b/README.txt index 19b7c471..e0329345 100755 --- a/README.txt +++ b/README.txt @@ -29,7 +29,7 @@ The recommended way to install setuptools on Windows is to download `ez_setup.py`_ and run it. The script will download the appropriate .egg file and install it for you. -.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/0.7.4/ez_setup.py +.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/0.7.5/ez_setup.py For best results, uninstall previous versions FIRST (see `Uninstalling`_). @@ -45,7 +45,7 @@ Unix-based Systems including Mac OS X Download `ez_setup.py`_ and run it using the target Python version. The script will download the appropriate version and install it for you:: - > wget https://bitbucket.org/pypa/setuptools/raw/0.7.4/ez_setup.py -O - | python + > wget https://bitbucket.org/pypa/setuptools/raw/0.7.5/ez_setup.py -O - | python Note that you will may need to invoke the command with superuser privileges to install to the system Python. @@ -53,7 +53,7 @@ install to the system Python. Alternatively, on Python 2.6 and later, Setuptools may be installed to a user-local path:: - > wget https://bitbucket.org/pypa/setuptools/raw/0.7.4/ez_setup.py + > wget https://bitbucket.org/pypa/setuptools/raw/0.7.5/ez_setup.py > python ez_setup.py --user @@ -66,7 +66,7 @@ tarball from `Setuptools on PyPI `_ and run setup.py with any supported distutils and Setuptools options. For example:: - setuptools-0.7.4$ python setup.py --prefix=/opt/setuptools + setuptools-0.7.5$ python setup.py --prefix=/opt/setuptools Use ``--help`` to get a full options list, but we recommend consulting the `EasyInstall manual`_ for detailed instructions, especially `the section diff --git a/docs/conf.py b/docs/conf.py index 909a5510..88d9540d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2009-2013, The fellowship of the packaging' # built documents. # # The short X.Y version. -version = '0.7.4' +version = '0.7.5' # The full version, including alpha/beta/rc tags. -release = '0.7.4' +release = '0.7.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/ez_setup.py b/ez_setup.py index 66822493..a0aa1299 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -28,7 +28,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "0.7.4" +DEFAULT_VERSION = "0.7.5" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/release.py b/release.py index c3ed3f45..8d2f0bc7 100644 --- a/release.py +++ b/release.py @@ -22,7 +22,7 @@ try: except Exception: pass -VERSION = '0.7.4' +VERSION = '0.7.5' PACKAGE_INDEX = 'https://pypi.python.org/pypi' def set_versions(): diff --git a/setup.py b/setup.py index ece0370e..8986e949 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ exec(init_file.read(), d) init_file.close() SETUP_COMMANDS = d['__all__'] -VERSION = "0.7.4" +VERSION = "0.7.5" from setuptools import setup, find_packages from setuptools.command.build_py import build_py as _build_py diff --git a/setuptools/__init__.py b/setuptools/__init__.py index f7612bce..6be7006a 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -8,7 +8,7 @@ from distutils.util import convert_path import os import sys -__version__ = '0.7.4' +__version__ = '0.7.5' __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' -- cgit v1.2.3