Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

gvalkov
Copy link
Contributor

@gvalkov gvalkov commented Jun 28, 2016

Hello @borntyping,

First of all, thank you for putting all the effort into this project - it's the best Riemann Python client out there.

This PR includes several small fixes, that make it easier for me and my colleagues to use the project (plus an unrelated fix to the readme):

  • Using relative imports lets the user decide how the module is named (comes handy when you're vendoring the package).
  • Adding all public classes to init takes away some of the repetitiveness in the imports (e.g. from riemann_client.client import Client). If need be, this also lets you refactor the package structure more easily, as it all appears flat to the caller.
from riemann import Client as RiemannClient

with RiemannClient() as client:
    event = {...}
    client.send(**event)
  • Make the command-line program executable with python -m riemann_client. This is also necessary for riemann_client to work as a zipapp.

Kind regards,
Georgi

import riemann_client.riemann_pb2
import riemann_client.transport
from . import riemann_pb2
from .transport import UDPTransport, TCPTransport
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially wanted to keep it as from . import transport, but that would then conflict with the transport variable in Client.__init__(). I hope you can look past the small namespace pollution I'm introducing.

@borntyping
Copy link
Owner

Hi @gvalkov - this PR looks great!

I've only a couple minor requests - would you have any objection to explicitly listing imports in __init__.py (instead of using from .transport import * # noqa), and could you include a version bump to 6.2.0?

I'd also love to hear about how you're using it, if you have the time 😃

Thanks,
Sam

@borntyping borntyping merged commit 198f514 into borntyping:master Oct 27, 2022
@borntyping
Copy link
Owner

With my apologies for missing this for six(!) years, I've merged this and released it in a final release for this package.

https://pypi.org/project/riemann-client/7.0.0rc1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants