Skip to content

Bundle decorator.py and fix decorators - #91

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
hynek:decorators
Jul 20, 2016
Merged

Bundle decorator.py and fix decorators#91
brian-brazil merged 1 commit into
prometheus:masterfrom
hynek:decorators

Conversation

@hynek

@hynek hynek commented Jul 20, 2016

Copy link
Copy Markdown
Contributor

As discussed in #77, this PR bundles (to avoid dependencies) the decorator.py module and uses it to fix the behavior of prometheus_client's decorators.

The efficacy can be verified by using example view from the README and then doing a:

>>> from inspect import getargspec
>>> getargspec(process_request)
ArgSpec(args=['t'], varargs=None, keywords=None, defaults=None)

Without this patch, you get:

ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)

instead.

Let me now what you think.

Also pinging @micheles out of courtesy and to ensure he doesn’t feel we violate his copyright.

@brian-brazil

Copy link
Copy Markdown
Contributor

That looks good, could you add a quick unittest so we don't accidentally regress?

@micheles

Copy link
Copy Markdown

Yes, no problems on my part, the decorator module is a single file just to
help people that wants to include it and have less dependencies.

On Wed, Jul 20, 2016 at 3:17 PM, Hynek Schlawack notifications@github.com
wrote:

As discussed in #77
#77, this PR bundles
(to avoid dependencies) the decorator.py module and uses it to fix the
behavior of prometheus_client's decorators.

The efficacy can be verified by using example view from the README and
then doing a:

from inspect import getargspec
getargspec(process_request)
ArgSpec(args=['t'], varargs=None, keywords=None, defaults=None)

Without this patch, you get:

ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)

instead.

Let me now what you think.

Also pinging @micheles https://github.com/micheles out of courtesy and

to ensure he doesn’t feel we violate his copyright.

You can view, comment on, or merge this pull request online at:

#91
Commit Summary

  • Bundle decorator.py and fix decorators

File Changes

Patch Links:


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#91, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWYcHT25T7oA9sc3uu03o9FP98mtKYiks5qXh_rgaJpZM4JQw7E
.

@hynek

hynek commented Jul 20, 2016

Copy link
Copy Markdown
Contributor Author

I’ve added unit tests for hopefully all decorators and the tests still pass.

@brian-brazil
brian-brazil merged commit cba7100 into prometheus:master Jul 20, 2016
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants