willowgarage/catkin — Issue #100: Add and start using catkin_setuptools
Author: gerkey
Created: 2012-03-05 18:34:12+00:00
State: open

We're starting to have some (poorly) duplicated code blocks in manually maintained `setup.py` files, e.g.:

if 'CATKIN_BINARY_DIR' in os.environ:
build_d = os.environ['CATKIN_BINARY_DIR']
for t in gen:
p = os.path.join(build_d, 'gen', 'py', PKG, t)
if os.path.isdir(p):
# e.g. std_msgs.msg = build/gen/py/std_msgs/msg
package_dir["%s.%s"%(PKG, t)] = p
packages.append("%s.%s"%(PKG, t))

Also:

version = '0.0.0'
try:
import yaml
d = yaml.load(open('stack.yaml'))
version = d['Version']
except:
pass

That stuff should be wrapped up in a little Python module supplied by catkin, e.g., `catkin_setuptools`.