Skip to content

Fix not implemented error #204

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 3 commits into from
Jun 15, 2020
Merged

Fix not implemented error #204

merged 3 commits into from
Jun 15, 2020

Conversation

Inveracity
Copy link
Contributor

Reason for the change
closes #201

Description
Dynamically importing using the imp library causes setuptools and/or pyinstaller to not find the async libraries.

I also could not get the pyinstaller --hidden-import "rethinkdb.net_asyncio" to work, probably for the same reason.

With these changes the behavior is exactly the same, except now the async libraries are recognised as packages and pyinstaller can create a binary that works.

I appreciate that this change makes the code less dynamic whenever a new async library gets implemented. Maybe there's a better fix? Or maybe pyinstaller will eventually support your way of structuring the rethinkdb package, but this definitely made it work for me.

Tested with

  • OS: Windows 10
  • Python version: 3.8.2

Checklist

@gabor-boros
Copy link
Member

For first review this seems good. Let me check it tomorrow ☺️😇

Copy link
Member

@gabor-boros gabor-boros left a comment

Choose a reason for hiding this comment

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

I like that this is a bit more explicit. Also it is easier to see what’s happening. @lsabi would you like to have a second look on this PR? If not I’d merge this and cherry-pick to the python 2-3 branch with the other merged PR

@lsabi
Copy link
Contributor

lsabi commented May 23, 2020

I would capture the possibility that a library name passed as parameter is not valid.

Basically, I would move the first if statement down and add a second check.
It would become something like

`if library is None or self.connection_type is None:

self.connection_type = self.net.DefaultConnection`

Better safe than sorry

@gabor-boros
Copy link
Member

Yep, that’s true tho

Copy link
Member

@gabor-boros gabor-boros left a comment

Choose a reason for hiding this comment

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

@Inveracity Could you please adjust the code accordingly? 😇🙏

Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 1
           

Complexity increasing per file
==============================
- rethinkdb/__init__.py  5
         

See the complete overview on Codacy

@Inveracity
Copy link
Contributor Author

Thanks for the review!

I hope I made the correct change requested by lsabi 😄

@lsabi
Copy link
Contributor

lsabi commented May 24, 2020

Looks good to me

@gabor-boros
Copy link
Member

LGTM too. I'll check the changes with some more tests and merge this PR 😊
In case the tests are passing I'll make sure this change got released.

@Inveracity
Copy link
Contributor Author

Thank you so much!

@gabor-boros gabor-boros merged commit 7ba97e9 into rethinkdb:master Jun 15, 2020
@Inveracity Inveracity deleted the fix-NotImplementedError branch June 15, 2020 09:37
@McSinyx
Copy link

McSinyx commented Nov 30, 2020

@gabor-boros, could you please cut a release with this included? import pkg_resources in 2.4.7 is breaking isolated build using flit.

@gabor-boros
Copy link
Member

@McSinyx Sure, I'll cut a new release today.

@McSinyx
Copy link

McSinyx commented Dec 5, 2020

Thanks!

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.

Pyinstaller compiled binary causes NotImplementedError on r.set_loop_type()
4 participants