Skip to content

Remove absolute imports to support vendoring #142

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

Merged
merged 2 commits into from
Jun 23, 2017

Conversation

mottosso
Copy link
Contributor

Hi folks,

Thanks for this amazing project! I'm looking to bundle tinydb with another software library but couldn't due to the global references to tinydb in import statements.

This PR makes all imports relative, so that you can now do this.

from my_library.vendor import tinydb

Let me know if there are any issues.

>>> from tinydb import TinyDB, where
>>> from tinydb.storages import MemoryStorage
>>> from . import TinyDB, where
>>> from .storages import MemoryStorage
Copy link
Owner

Choose a reason for hiding this comment

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

I think we should keep the absolute import here as that's what users will usually continue to use. Or am I mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes you are right. Sorry about that.

@msiemens
Copy link
Owner

One small nit with the docstring, otherwise looks good to me!

@msiemens msiemens merged commit b2039b7 into msiemens:master Jun 23, 2017
@msiemens
Copy link
Owner

Merged, thanks! I'll try to find to release a new version of TinyDB next week :)

@msiemens
Copy link
Owner

BTW, I've just released v3.3.1 which includes this pull request :)

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