<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setuptools_entry(dist, keyword, value):
 """Setuptools entry point for setting version and baking it into package."""

    # If 'use_katversion' is False, ignore the rest
    if not value:
        return
    # Enforce the version obtained by katversion, overriding user setting
    version = get_version()
    if dist.metadata.version is not None:
        s = "Ignoring explicit version='{0}' in setup.py, using '{1}' instead"
        warnings.warn(s.format(dist.metadata.version, version))
    dist.metadata.version = version
    # Extend build_py command to bake version string into installed package
    ExistingCustomBuildPy = dist.cmdclass.get('build_py', object)
    class KatVersionBuildPy(AddVersionToInitBuildPy, ExistingCustomBuildPy):
        """First perform existing build_py and then bake in version string."""
    dist.cmdclass['build_py'] = KatVersionBuildPy
    # Extend sdist command to bake version string into source package
    ExistingCustomSdist = dist.cmdclass.get('sdist', object)
    class KatVersionSdist(AddVersionToInitSdist, ExistingCustomSdist):
        """First perform existing sdist and then bake in version string."""
    dist.cmdclass['sdist'] = KatVersionSdist