Use Bazaar to list files for setup.py installation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import setuptools
import os
def bzr_find_files(dirname):
"""Find versioned files using bzr, for use in 'setuptools.file_finders'
entry point in setup.py."""
cmd = 'bzr ls --versioned ' + dirname
proc = subprocess.Popen(
cmd.split(), stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _stderr = proc.communicate()
return stdout.splitlines() # pylint: disable=E1103
setuptools.setup(
name='example',
entry_points={
'setuptools.file_finders': [
'bzr = bzr_find_files',
],
},
)
|
Tags: bazaar, setuptools