Motivated by this comment
<https://github.com/astropy/astropy/pull/2835#discussion_r15990257>
this adds the make_func_with_sig function to astropy.utils.misc.
Taking advantage of this, a new astropy.utils.compat.misc.wraps
function is provided as a replacement for functools.wraps, which
provides the same functionality but while also preserving the original
wrapped function's signature (so that it displays properly in help())
Turns out there are fewer usages of functools.wraps in Astropy than I thought. And most of them are in utilties/backwards compatibility features that aren't terribly important.  But I found this one case where the new wraps implementation is useful. And there could be others in the future.
Allow specifying the name of the function generated by make_func_with_sig, rather than only allowing the name of the wrapped function to be used
Take advantage of the new name-specification feature in the wraps() replacement, such that the new function gets the same *name* as the function being wrapped as well
Ensure that the filename for the code object is not a .pyc file
Trick the compiled code object into also pointing to the correct line number into the module make_func_with_sig was called from, and a test to prove that it works.
Following discussion in #2849, decided to make the new wraps implementation available on Python 3.4 as well.  As such I moved it out of astropy.utils.compat since it's really providing a new function rather than some backward/forward compatibility.
Added a changelog entry for #2849 [skip ci]
Merge pull request #2849 from embray/utils/wraps

Replacement for functools.wraps that preserves signature