mila-iqia / blocks-extras

A collection of extensions to the Blocks framework
MIT License
27 stars 40 forks source link

Installation instructions with pip result in shadowing of blocks modules for autocomplete #21

Open ASalvail opened 9 years ago

ASalvail commented 9 years ago

Installing blocks and blocks-extras in editable mode

$ pip install -e /path/to/blocks
$ pip install -e /path/to/blocks-extras

results in the shadowing of blocks modules for autocomplete purposes.

$ ipython
In [1] : import blocks.[TAB]

will invariably result in blocks.extras.

http://stackoverflow.com/questions/18830713/ipython-code-completion-does-not-support-namespace-package references this issue, without any definite fixes.

If there is a hack to make it work, maybe adding a note to the readme file.

dwf commented 9 years ago

Obligatory namespace packages joke

Truth be told I don't know if this is even supposed to work. @takluyver's comments on the Stack Overflow thread do not sound promising.

ASalvail commented 9 years ago

I mostly wondered if you had any workaround.

dwf commented 9 years ago

There isn't a workaround that I'm aware of. Namespace packages are hell-spawned. You could manually import all the blocks subpackages from the main blocks distribution in your ipython config, then you'd be able to autocomplete the subpackage names and also within subpackages. Don't know if that would work but I can't see why it wouldn't.

ASalvail commented 9 years ago

Why bother with namespace packages if they're such a headache. If their main goal is user friendliness, it might make more sense to rename the package blocks-extra. I know changing the package name at this point would be difficult, but it'd still be better to be done now than later.

rizar commented 9 years ago

+1

You can try to restart the discussion in https://github.com/mila-udem/blocks/issues/696