From: Zooko O'Whielacronx Date: Tue, 18 Jan 2011 06:25:21 +0000 (-0800) Subject: setup: bundle a copy of setuptools_darcs-1.2.12 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/frontends/install.html?a=commitdiff_plain;h=0fb49375c0365e0ab247534cf6bb5d62191f7d13;p=tahoe-lafs%2Ftahoe-lafs.git setup: bundle a copy of setuptools_darcs-1.2.12 This is to work-around https://bitbucket.org/tarek/distribute/issue/55/revision-control-plugin-automatically-installed-as-a-build-dependency-is-not-present-when-another-build-dependency-is-being . refs #1054. --- diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/PKG-INFO b/setuptools_darcs-1.2.12.egg/EGG-INFO/PKG-INFO new file mode 100644 index 00000000..8e032517 --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/PKG-INFO @@ -0,0 +1,32 @@ +Metadata-Version: 1.0 +Name: setuptools-darcs +Version: 1.2.12 +Summary: setuptools plugin for darcs +Home-page: http://tahoe-lafs.org/trac/setuptools_darcs +Author: Zooko O'Whielacronx +Author-email: zooko@zooko.com +License: BSD +Description: UNKNOWN +Keywords: distutils setuptools setup darcs +Platform: UNKNOWN +Classifier: Framework :: Setuptools Plugin +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: BSD License +Classifier: License :: DFSG approved +Classifier: Intended Audience :: Developers +Classifier: Operating System :: Microsoft +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: Unix +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: POSIX +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows :: Windows NT/2000 +Classifier: Operating System :: OS Independent +Classifier: Natural Language :: English +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.4 +Classifier: Programming Language :: Python :: 2.5 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Topic :: Utilities +Classifier: Topic :: Software Development :: Libraries diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/SOURCES.txt b/setuptools_darcs-1.2.12.egg/EGG-INFO/SOURCES.txt new file mode 100644 index 00000000..f3d9ab9a --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/SOURCES.txt @@ -0,0 +1,13 @@ + +README.txt +setup.cfg +setup.py +setuptools_darcs/__init__.py +setuptools_darcs/_version.py +setuptools_darcs/setuptools_darcs.py +setuptools_darcs.egg-info/PKG-INFO +setuptools_darcs.egg-info/SOURCES.txt +setuptools_darcs.egg-info/dependency_links.txt +setuptools_darcs.egg-info/entry_points.txt +setuptools_darcs.egg-info/not-zip-safe +setuptools_darcs.egg-info/top_level.txt \ No newline at end of file diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/dependency_links.txt b/setuptools_darcs-1.2.12.egg/EGG-INFO/dependency_links.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/entry_points.txt b/setuptools_darcs-1.2.12.egg/EGG-INFO/entry_points.txt new file mode 100644 index 00000000..51f2125b --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/entry_points.txt @@ -0,0 +1,3 @@ +[setuptools.file_finders] +darcs = setuptools_darcs.setuptools_darcs:find_files_for_darcs + diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/not-zip-safe b/setuptools_darcs-1.2.12.egg/EGG-INFO/not-zip-safe new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/not-zip-safe @@ -0,0 +1 @@ + diff --git a/setuptools_darcs-1.2.12.egg/EGG-INFO/top_level.txt b/setuptools_darcs-1.2.12.egg/EGG-INFO/top_level.txt new file mode 100644 index 00000000..de954827 --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/EGG-INFO/top_level.txt @@ -0,0 +1 @@ +setuptools_darcs diff --git a/setuptools_darcs-1.2.12.egg/setuptools_darcs/__init__.py b/setuptools_darcs-1.2.12.egg/setuptools_darcs/__init__.py new file mode 100644 index 00000000..03549d3e --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/setuptools_darcs/__init__.py @@ -0,0 +1,8 @@ +__version__ = "unknown" +try: + from _version import __version__ +except ImportError: + # We're running in a tree that hasn't run darcsver from the pyutil library, + # and didn't come with a _version.py, so we don't know what our version + # is. This should not happen very often. + pass diff --git a/setuptools_darcs-1.2.12.egg/setuptools_darcs/_version.py b/setuptools_darcs-1.2.12.egg/setuptools_darcs/_version.py new file mode 100644 index 00000000..78d58b29 --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/setuptools_darcs/_version.py @@ -0,0 +1,16 @@ + +# This is the version of this tree, as created by setup.py darcsver from the Darcs patch +# information: the main version number is taken from the most recent release +# tag. If some patches have been added since the last release, this will have a +# -NN "build number" suffix, or else a -rNN "revision number" suffix. Please see +# pyutil.version_class for a description of what the different fields mean. + +verstr = "1.2.12" +try: + from pyutil.version_class import Version as pyutil_Version + __version__ = pyutil_Version(verstr) +except (ImportError, ValueError): + # Maybe there is no pyutil installed, or this may be an older version of + # pyutil.version_class which does not support SVN-alike revision numbers. + from distutils.version import LooseVersion as distutils_Version + __version__ = distutils_Version(verstr) diff --git a/setuptools_darcs-1.2.12.egg/setuptools_darcs/setuptools_darcs.py b/setuptools_darcs-1.2.12.egg/setuptools_darcs/setuptools_darcs.py new file mode 100644 index 00000000..627265fa --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/setuptools_darcs/setuptools_darcs.py @@ -0,0 +1,79 @@ +import os, re + +from subprocess import Popen, PIPE + +THISDIR_RE=re.compile("What's new in \"(.*)\"") + +def exec_darcs(darcscmd): + cmd = ['darcs'] + darcscmd + try: + p = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) + except EnvironmentError: + cmd = ['realdarcs.exe'] + darcscmd + p = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) + + output = p.communicate()[0] + return (p.returncode, output) + +def run_darcs_query_manifest(): + return exec_darcs(['query', 'manifest']) + +def run_darcs_whatsnew_dot(): + return exec_darcs(['whatsnew', '.']) + +def find_files_for_darcs(dirname): + try: + unused, whatsnewoutput = run_darcs_whatsnew_dot() + queryretcode, queryoutput = run_darcs_query_manifest() + except EnvironmentError: + if not os.path.exists('PKG-INFO'): + from distutils import log + log.info("Unable to execute darcs -- if you are building a package with 'setup.py sdist', 'setup.py bdist_egg', or other package-building commands, then the resulting package might be missing some files. If you are not building a package then you can ignore this warning.") + # Oh well -- just return None. + return + + if queryretcode != 0: + if not os.path.exists('PKG-INFO'): + from distutils import log + log.warn("Failure to get the list of managed files from darcs -- if you are building a package with 'setup.py sdist', 'setup.py bdist_egg', or other package-building commands, then the resulting package might be missing some files. If you are not building a package then you can ignore this warning.") + # Oh well -- just return None. + return + + # We got output. + mo = THISDIR_RE.search(whatsnewoutput) + if mo: + curdirname = mo.group(1) + while curdirname.endswith('/'): + curdirname = curdirname[:-1] + curdirname += "/" + else: + curdirname = "" + + # Prepend this directory. + rel_to_repo_dirname = curdirname + dirname + + # Normalize rel_to_repo_dirname from local form to the form that setuptools uses to the form that "darcs query manifest" outputs (unix form). + rel_to_repo_dirname = rel_to_repo_dirname.replace('\\', '/') + while rel_to_repo_dirname.endswith('/'): + rel_to_repo_dirname = rel_to_repo_dirname[:-1] + + # Append a '/' to make sure we don't match "foobar" when rel_to_repo_dirname is "foo". + if rel_to_repo_dirname: + rel_to_repo_dirname += '/' + + warn = True + for fn in queryoutput.split('\n'): + if fn == ".": + continue + if fn.startswith('./'): + fn = fn[2:] + if fn.startswith(rel_to_repo_dirname): + fn = fn[len(rel_to_repo_dirname):] + warn = False + # We need to replace "/" by "\\" because setuptools can't includes web/*.xhtml files on Windows, due of path separator + # This correct ticket #1033 + yield fn.replace('/', os.sep) + + if warn and not os.path.exists('PKG-INFO'): + from distutils import log + log.warn("Didn't find any files in directory \"%s\" (full path: \"%s\") that were managed by darcs revision control -- if you are building a package with 'setup.py sdist', 'setup.py bdist_egg', or other package-building commands, then the resulting package might be missing some files. If you are not building a package then you can ignore this warning." % (dirname, os.path.abspath(rel_to_repo_dirname),)) diff --git a/setuptools_darcs-1.2.12.egg/share/doc/python-setuptools_darcs/README.txt b/setuptools_darcs-1.2.12.egg/share/doc/python-setuptools_darcs/README.txt new file mode 100644 index 00000000..b881110c --- /dev/null +++ b/setuptools_darcs-1.2.12.egg/share/doc/python-setuptools_darcs/README.txt @@ -0,0 +1,143 @@ + +setuptools_darcs Manual +======================= + +About +----- + +This is a plugin for setuptools that integrates darcs. Once +installed, Setuptools can be told to include in a package distribution +all the files tracked by darcs. This is an alternative to explicit +inclusion specifications with `MANIFEST.in`. + +A distribution here refers to a package that you create using +setup.py, ex: + + python setup.py sdist + python setup.py bdist_egg + python setup.py bdist_rpm + +This package was formerly known as setuptools_darcs_plugin. The name +change is the result of an agreement by the setuptools plugin +developers to provide a uniform naming convention. + + +Installation +------------ + +With easy_install: + + easy_install setuptools_darcs + +Alternative manual installation: + + tar -zxvf setuptools_darcs-X.Y.Z.tar.gz + cd setuptools_darcs-X.Y.Z + python setup.py install + +Where X.Y.Z is a version number. + +Alternative to make a specific package use setuptools_darcs without +installing setuptools_darcs into the system: + + Put "setup_requires=['setuptools_darcs']" in the call to setup() in + the package's setup.py file. + + +Usage +----- + +To use this plugin, you must first package your python module with +`setup.py` and use setuptools. The former is well documented in the +distutils manual: + + http://docs.python.org/dist/dist.html + +To use setuptools instead of distutils, just edit `setup.py` and +change + + from distutils.core import setup + +to + + from setuptools import setup + +When setuptools builds a source package, it always includes all files +tracked by your revision control system, if it knows how to learn what +those files are. + +When setuptools builds a binary package, you can ask it to include all +files tracked by your revision control system, by adding this argument +to your invocation of `setup()`: + + setup(..., + include_package_data=True, + ...) + +This plugin lets setuptools know what files are tracked by your darcs +revision control tool. setuptools ships with support for cvs and +subversion. Other plugins like this one are available for bzr, git, +monotone, and mercurial, at least. + +It might happen that you track files with your revision control system +that you don't want to include in your packages. In that case, you +can prevent setuptools from packaging those files with a directive in +your `MANIFEST.in`, ex: + + exclude .darcs-boringfile + recursive-exclude images *.xcf *.blend + +In this example, we prevent setuptools from packaging +`.darcs-boringfile` and the Gimp and Blender source files found under +the `images` directory. + +Alternatively, files to exclude from the package can be listed in the +`setup()` directive: + + setup(..., + exclude_package_data = {'': ['.darcs-boringfile'], + 'images': ['*.xcf', '*.blend']}, + ...) + + +Gotchas +------- + +If someone clones your darcs repository using darcs but does not +install this plugin, then when they run a package building command +they will not get all the right files. On the other hand if someone +gets a source distribution that was created by "./setup.py sdist", +then it will come with a list of all files, so they will not need +darcs in order to build a distribution themselves. + +You can make sure that anyone who uses your setup.py file has this +plugin by adding a `setup_requires` argument. + + setup_requires=[] + # setuptools_darcs is required to produce complete distributions (such as with + # "sdist" or "bdist_egg"), unless there is a ${PKG}.egg-info/SOURCES.txt file + # present which contains a complete list of files that should be included in + # distributions. + # http://pypi.python.org/pypi/setuptools_darcs + setup_requires.append('setuptools_darcs >= 1.1.0') + + setup(..., + setup_requires = setup_requires, + ...) + + +References +---------- + +How to distribute Python modules with Distutils: + + http://docs.python.org/dist/dist.html + + +Setuptools complete manual: + + http://peak.telecommunity.com/DevCenter/setuptools + + +Thanks to Yannick Gingras for providing the prototype for this +README.txt.