def create_cmdclass(prerelease_cmd=None, package_data_spec=None,<EOL>data_files_spec=None):
wrapped = [prerelease_cmd] if prerelease_cmd else []<EOL>if package_data_spec or data_files_spec:<EOL><INDENT>wrapped.append('<STR_LIT>')<EOL><DEDENT>wrapper = functools.partial(_wrap_command, wrapped)<EOL>handle_files = _get_file_handler(package_data_spec, data_files_spec)<EOL>if '<STR_LIT>' in sys.argv:<EOL><INDENT>egg = wrapper(bdist_egg, strict=True)<EOL><DEDENT>else:<EOL><INDENT>egg = bdist_egg_disabled<EOL><DEDENT>cmdclass = dict(<EOL>build_py=wrapper(build_py, strict=is_repo),<EOL>bdist_egg=egg,<EOL>sdist=wrapper(sdist, strict=True),<EOL>handle_files=handle_files,<EOL>)<EOL>if bdist_wheel:<EOL><INDENT>cmdclass['<STR_LIT>'] = wrapper(bdist_wheel, strict=True)<EOL><DEDENT>cmdclass['<STR_LIT>'] = wrapper(develop, strict=True)<EOL>return cmdclass<EOL>
Create a command class with the given optional prerelease class.

    Parameters
    ----------
    prerelease_cmd: (name, Command) tuple, optional
        The command to run before releasing.
    package_data_spec: dict, optional
        A dictionary whose keys are the dotted package names and
        whose values are a list of glob patterns.
    data_files_spec: list, optional
        A list of (path, dname, pattern) tuples where the path is the
        `data_files` install path, dname is the source directory, and the
        pattern is a glob pattern.

    Notes
    -----
    We use specs so that we can find the files *after* the build
    command has run.

    The package data glob patterns should be relative paths from the package
    folder containing the __init__.py file, which is given as the package
    name.
    e.g. `dict(foo=['./bar/*', './baz/**'])`

    The data files directories should be absolute paths or relative paths
    from the root directory of the repository.  Data files are specified
    differently from `package_data` because we need a separate path entry
    for each nested folder in `data_files`, and this makes it easier to
    parse.
    e.g. `('share/foo/bar', 'pkgname/bizz, '*')`