def render_source(output_dir, package_spec):
path, name = package_spec.filepath<EOL>destination_filename = "<STR_LIT>" % (output_dir, name)<EOL>py_template = JENV.get_template(TEST_TEMPLATE_NAME)<EOL>with open(destination_filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(py_template.render(s=package_spec,<EOL>description=package_spec.description,<EOL>pkg_name=package_spec.package,<EOL>include=package_spec.package.split('<STR_LIT:.>')[<NUM_LIT:1>],<EOL>filepath="<STR_LIT:/>".join(package_spec.filepath) + "<STR_LIT>"))<EOL><DEDENT>
Render and output to a directory given a package specification.