Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial package

  • Loading branch information...
commit 654f44c39381a653949c4389594581536e1c5fcb 0 parents
@mjpieters authored
1  .gitignore
@@ -0,0 +1 @@
+dist/
9 LICENSE.txt
@@ -0,0 +1,9 @@
+Copyright (c) 2011, Martijn Pieters
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 README.rst
@@ -0,0 +1,36 @@
+Subversion support for setuptools
+=================================
+
+Setuptools has built-in support for subversion repositories; it'll find all
+files tracked by subversion and include them when building a distribution.
+
+However, this support directly reads the private subversion repository
+metadata files, and these have been know to change from version to version.
+For example, subversion 1.7 switched to one top-level `.svn` directory with
+a sqlite database, instead of separate directories throughout the working
+copy with XML files in 1.6, or proprietary text files in versions before that.
+As of the time of this package development, setuptools does not yet support
+working copies using the subversion 1.7 sqlite database format.
+
+This package uses the `svn list` command instead to list files in a repository,
+avoiding having to know about every version of subversion and it's particular
+metadata formats.
+
+License
+-------
+
+BSD (simplified), see: LICENSE.txt
+
+Author
+------
+
+Martijn Pieters <mj@zopatista.com>
+
+
+Changelog
+=========
+
+1.0 (unreleased)
+----------------
+
+* Initial release.
23 setup.py
@@ -0,0 +1,23 @@
+from setuptools import setup, find_packages
+
+version = '1.0'
+
+setup(
+ name='setuptools_subversion',
+ version=version,
+ description="Setuptools revision control system plugin for Subversion",
+ long_description=open("README.rst").read(),
+ keywords='',
+ author='Martijn Pieters',
+ author_email='mj@zopatista.com',
+ url='http://pypi.python.org/pypi/setuptools_subversion',
+ license='BSD',
+ include_package_data=True,
+ zip_safe=True,
+ install_requires=[],
+ py_modules=['setuptools_svn'],
+ entry_points='''
+ [setuptools.file_finders]
+ svn=setuptools_subversion:listfiles
+ ''',
+)
45 setuptools_subversion.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+import os
+from subprocess import CalledProcessError
+from subprocess import PIPE
+from distutils.log import warn
+
+
+try:
+ from subprocess import check_output
+except ImportError:
+ # Python 2.6 and before
+ def check_output(*popenargs, **kwargs):
+ from subprocess import Popen
+ if 'stdout' in kwargs:
+ raise ValueError(
+ 'stdout argument not allowed, it will be overridden.')
+ process = Popen(stdout=PIPE, *popenargs, **kwargs)
+ output, unused_err = process.communicate()
+ retcode = process.poll()
+ if retcode:
+ cmd = kwargs.get("args")
+ if cmd is None:
+ cmd = popenargs[0]
+ raise CalledProcessError(retcode, cmd)
+ return output
+
+
+def listfiles(directory):
+ try:
+ files = check_output(['svn', 'list', '-R', directory],
+ stderr=PIPE)
+ except (CalledProcessError, OSError):
+ warn('Error running "svn list"')
+ return []
+ return [f.strip() for f in files.splitlines()]
+
+
+if __name__ == '__main__':
+ import sys
+ if len(sys.argv) != 2:
+ print('%s directory' % sys.argv[0])
+ sys.exit(1)
+ for name in listfiles(sys.argv[1]):
+ print name
Please sign in to comment.
Something went wrong with that request. Please try again.