Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose some functions from _base in top-level init #42

Open
stevenheidel opened this issue Mar 24, 2019 · 2 comments
Open

Expose some functions from _base in top-level init #42

stevenheidel opened this issue Mar 24, 2019 · 2 comments
Labels
good first issue Good for newcomers

Comments

@stevenheidel
Copy link
Contributor

from rpcq._base import from_yaml_file is really useful so it shouldn't come from a private import

@ecpeterson ecpeterson added the good first issue Good for newcomers label Mar 25, 2019
@xgallom
Copy link

xgallom commented Mar 29, 2019

Hi, if you are interested, I've done as you've requested:

diff --git a/rpcq/__init__.py b/rpcq/__init__.py
index 9781258..c968910 100644
--- a/rpcq/__init__.py
+++ b/rpcq/__init__.py
@@ -1,3 +1,4 @@
 from rpcq._client import Client
 from rpcq._server import Server
+from rpcq._base import to_msgpack, from_msgpack, to_json, from_json, to_yaml_file, from_yaml_file
 from rpcq.version import __version__
diff --git a/rpcq/_client.py b/rpcq/_client.py
index abf7403..f656a9a 100644
--- a/rpcq/_client.py
+++ b/rpcq/_client.py
@@ -21,7 +21,7 @@ from typing import Dict, Union
 import zmq
 import zmq.asyncio
 
-from rpcq._base import to_msgpack, from_msgpack
+from rpcq import to_msgpack, from_msgpack
 import rpcq._utils as utils
 from rpcq.messages import RPCError, RPCReply
 
diff --git a/rpcq/_server.py b/rpcq/_server.py
index 2b23d4f..f2ae058 100644
--- a/rpcq/_server.py
+++ b/rpcq/_server.py
@@ -24,7 +24,7 @@ from datetime import datetime
 
 import zmq.asyncio
 
-from rpcq._base import to_msgpack, from_msgpack
+from rpcq import to_msgpack, from_msgpack
 from rpcq._spec import RPCSpec
 from rpcq.messages import RPCRequest
 
diff --git a/rpcq/test/test_base.py b/rpcq/test/test_base.py
index 3737cf7..cc5d386 100644
--- a/rpcq/test/test_base.py
+++ b/rpcq/test/test_base.py
@@ -19,7 +19,7 @@ import logging
 import numpy as np
 import pytest
 
-from rpcq._base import to_msgpack, from_msgpack
+from rpcq import to_msgpack, from_msgpack
 from rpcq.messages import (RPCError)
 
 log = logging.getLogger(__file__)
diff --git a/rpcq/test/test_rpc.py b/rpcq/test/test_rpc.py
index 50ee19b..898df4b 100644
--- a/rpcq/test/test_rpc.py
+++ b/rpcq/test/test_rpc.py
@@ -23,7 +23,7 @@ from multiprocessing import Process
 import pytest
 import zmq
 
-from rpcq._base import to_msgpack, from_msgpack
+from rpcq import to_msgpack, from_msgpack
 from rpcq._server import Server
 from rpcq._client import Client
 from rpcq._utils import rpc_request, RPCErrorError, RPCError

@stevenheidel
Copy link
Contributor Author

Awesome - can you open a pull request?

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

No branches or pull requests

3 participants