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

Change plugins directory to spyplugins and make it a namespace package #2565

Merged
merged 42 commits into from
Nov 16, 2015
Merged

Change plugins directory to spyplugins and make it a namespace package #2565

merged 42 commits into from
Nov 16, 2015

Conversation

goanpeca
Copy link
Member

This works builds on top of the work made by @Nodd (dont worry, your commits are all there ;-) )

I still have an issue when running the translation scripts

Todo

  • Change plugins folder from spyderplugins to spyplugins/ui
  • Change plugins folder from spyderplugins to spyplugins/io
  • Fix translations
  • Remove p_ prefix from plugins
  • Fix image display in preferences for plugins (pylint and profiler)

@goanpeca
Copy link
Member Author

@ccordoba12 when running python gettext_scan I am getting this:

Updating... spyderlib/locale/fr/LC_MESSAGES/spyderlib.po
merge...
spyderlib/locale/spyderlib.pot:2690: duplicate message definition...
spyderlib/locale/spyderlib.pot:6: ...this is the location of the first definition
msgmerge: found 1 fatal error
Updating... spyderlib/locale/es/LC_MESSAGES/spyderlib.po
merge...
spyderlib/locale/spyderlib.pot:2690: duplicate message definition...
spyderlib/locale/spyderlib.pot:6: ...this is the location of the first definition
msgmerge: found 1 fatal error
Updating... spyderlib/locale/pt_BR/LC_MESSAGES/spyderlib.po
merge...
spyderlib/locale/spyderlib.pot:2690: duplicate message definition...
spyderlib/locale/spyderlib.pot:6: ...this is the location of the first definition
msgmerge: found 1 fatal error

@goanpeca goanpeca added this to the v3.0 milestone Jul 27, 2015
@goanpeca goanpeca self-assigned this Jul 27, 2015
@ccordoba12
Copy link
Member

No idea, I'll check this out after beta1

@goanpeca goanpeca changed the title Change Plugin directories to spyderuiplugins Change Plugin directories to spyplugins/ui and spyplugins/io Jul 31, 2015
@goanpeca
Copy link
Member Author

@ccordoba12 ... ok this was a bit longer than expected but I think it is now working. I need some testers...

@ccordoba12
Copy link
Member

I'll test this weekend :-)

@goanpeca
Copy link
Member Author

goanpeca commented Aug 1, 2015

@SylvainCorlay how should we handle icons in external plugins? I mean, we need to define some sane/easy way for people to define both a fontawesome icon and a normal image icon...

@ccordoba12
Copy link
Member

This needs a rebase too.

Also, I'm getting this traceback in Python 3 (Python 2 works just fine ;-):

ERROR: 3rd party plugin import failed for `spyplugins.io.hdf5`
Traceback (most recent call last):
  File "/home/carlos/Projects/spyder/github-repo/spyderlib/otherplugins.py", line 53, in _import_plugin
    submodule = imp.load_module(submodule_name, *info)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1444, in exec_module
  File "<frozen importlib._bootstrap>", line 1554, in get_code
  File "<frozen importlib._bootstrap>", line 672, in _code_to_bytecode
ValueError: unmarshallable object
ERROR: 3rd party plugin import failed for `spyplugins.io.dicom`
Traceback (most recent call last):
  File "/home/carlos/Projects/spyder/github-repo/spyderlib/otherplugins.py", line 53, in _import_plugin
    submodule = imp.load_module(submodule_name, *info)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1444, in exec_module
  File "<frozen importlib._bootstrap>", line 1554, in get_code
  File "<frozen importlib._bootstrap>", line 672, in _code_to_bytecode
ValueError: unmarshallable object
ERROR: 3rd party plugin import failed for `spyplugins.io.hdf5`
Traceback (most recent call last):
  File "/home/carlos/Projects/spyder/github-repo/spyderlib/otherplugins.py", line 53, in _import_plugin
    submodule = imp.load_module(submodule_name, *info)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1444, in exec_module
  File "<frozen importlib._bootstrap>", line 1554, in get_code
  File "<frozen importlib._bootstrap>", line 672, in _code_to_bytecode
ValueError: unmarshallable object
ERROR: 3rd party plugin import failed for `spyplugins.io.dicom`
Traceback (most recent call last):
  File "/home/carlos/Projects/spyder/github-repo/spyderlib/otherplugins.py", line 53, in _import_plugin
    submodule = imp.load_module(submodule_name, *info)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/carlos/.virtualenvs/test-ipy3-stable/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1444, in exec_module
  File "<frozen importlib._bootstrap>", line 1554, in get_code
  File "<frozen importlib._bootstrap>", line 672, in _code_to_bytecode
ValueError: unmarshallable object

This is printed in both the internal console and also the terminal from which Spyder was started.

@goanpeca, can you reproduce it?

@goanpeca goanpeca changed the title Change Plugin directories to spyplugins/ui and spyplugins/io [WIP] Change Plugin directories to spyplugins/ui and spyplugins/io Aug 16, 2015
@goanpeca
Copy link
Member Author

@ccordoba12 will try to work on this tomorrow

@goanpeca
Copy link
Member Author

@ccordoba12 so I think this one is fixed now and should be working on Py2.7 3.3 and 3.4

Can you test it ?

@goanpeca goanpeca changed the title [WIP] Change Plugin directories to spyplugins/ui and spyplugins/io Change Plugin directories to spyplugins/ui and spyplugins/io Aug 30, 2015
@goanpeca
Copy link
Member Author

@ccordoba12 this will not work unless we use setuptools.... distutils cannot handle namespace packages...

@goanpeca
Copy link
Member Author

@ccordoba12 now it is ready, can you test?

'spyderplugins':
get_package_data('spyderplugins', EXTLIST)},
'spyplugins':
get_package_data('spyplugins', EXTLIST+['.py']),
Copy link
Member

Choose a reason for hiding this comment

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

Isn't .py part of EXTLIST?

Copy link
Member

Choose a reason for hiding this comment

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

Another thing: doesn't get_package_data works recursively? It would seem like that given that before it was only necessary to pass spyderplugins to it :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably :-)

Copy link
Member

Choose a reason for hiding this comment

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

Ok, please check that out before merging

@ccordoba12
Copy link
Member

Ok, first review done. It's working without errors on Python 3, but I still have to:

  1. Test this on Windows.
  2. Run pylint and profiler with example files to see if they are working as before :-)

Thanks a lot for this @goanpeca and @Nodd. It seems a lot of work, I mean, from the design and implementation point of view.

@goanpeca
Copy link
Member Author

goanpeca commented Sep 1, 2015

@ccordoba12 I organized the code a bit better and addressed your questions.

@ccordoba12
Copy link
Member

Ok, thanks. I'll give another review later today, and also test this on Windows.

@goanpeca
Copy link
Member Author

@ccordoba12 have you had time to review and test this?

@ccordoba12
Copy link
Member

Ok, it seems the time has come (finally!) to press the green button on this one :-)

Thanks a lot @Nodd and @goanpeca for your work. It's a really great improvement!

ccordoba12 added a commit that referenced this pull request Nov 16, 2015
Change plugins directory to spyplugins and make it a namespace package
@ccordoba12 ccordoba12 merged commit fdd86f5 into spyder-ide:master Nov 16, 2015
@goanpeca
Copy link
Member Author

👍, now I will push the plugin manager PR :-)

@goanpeca
Copy link
Member Author

Side note: conda-manager plugin is a bit broken right now....

@ccordoba12
Copy link
Member

Ok, no biggie. There are the other plugins to test :-)

@Nodd
Copy link
Contributor

Nodd commented Nov 17, 2015

Cool, thanks to @goanpeca for finishing the work and @ccordoba12 for the review !

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

Successfully merging this pull request may close these issues.

3 participants