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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2e07558
Move file to new plugins structure
Nodd Apr 24, 2015
427c398
Discover third-party plugins as standalone files or directories
Nodd Apr 24, 2015
f20dcae
New-style spyderplugins are correctly loaded
Nodd Apr 24, 2015
c207d71
Load icons from plugin directory
Nodd Apr 24, 2015
33b8e67
Update gettext scripts
Nodd Apr 24, 2015
edbebef
Declare spyderplugins as a namespace package
Nodd Apr 24, 2015
28cf1b9
Remove 'p_' prefix where possible
Nodd Apr 25, 2015
671dbfa
Simplify registration inside plugins
Nodd Apr 25, 2015
03f7981
Load plugins from .spyder/userplugins and use path.py
Nodd Apr 25, 2015
811b978
Load correct translation in plugin widgets
Nodd Apr 26, 2015
e39ebcc
Safely remove USERPLUGIN_PATH from sys.path
Nodd Apr 29, 2015
db1efc8
Catch more general Exception on plugin load and print the full traceback
Nodd Apr 29, 2015
0a68411
Copy-paste leftovers
Nodd Apr 30, 2015
cfec1f5
Plugin image path is managed within the plugin API
Nodd Apr 30, 2015
ce9dada
Put IO plugins in their own namespace
Nodd Apr 30, 2015
102188b
Don't import __init__.py as a plugin
Nodd May 1, 2015
91bf79f
Use the imp package to correctly load plugins from directories
Nodd May 2, 2015
df87cd9
Don't load plugin from __pycache__
Nodd May 27, 2015
ed864a9
Typo in variable name
Nodd May 27, 2015
caa5c44
path is now Path
Nodd May 27, 2015
880412a
Fix setup.py for ioplugins
Nodd Jun 5, 2015
d082393
Rename 'spyderplugins' namespace to 'spyderuiplugins'
goanpeca Jul 5, 2015
220ee58
Change spyderplugins to spyplugins/ui and spyplugins/io
goanpeca Jul 31, 2015
58ae57f
Fix python 33 and 34 plugins compatibility
goanpeca Aug 30, 2015
4fbf976
rebase
goanpeca Aug 30, 2015
6fb9f28
Fix icon loadijng for third party plugins
goanpeca Aug 30, 2015
50ba8d2
Fix example plugin icons
goanpeca Aug 30, 2015
511c4db
Add icons for autopep8
goanpeca Sep 1, 2015
76774e8
Remove redundant info in setup.py
goanpeca Sep 1, 2015
bfceea0
Update check and write of user plugins folder structure, add comments
goanpeca Sep 1, 2015
7ddda8d
Make io plugins search similar to ui plugins
goanpeca Sep 14, 2015
5ca6390
Remove unneded variable
goanpeca Sep 14, 2015
5ca1153
Update plugins icon names and add copyright
goanpeca Sep 14, 2015
4237c1e
Revert to os.path use, instead of Path
goanpeca Sep 14, 2015
9cf2f9b
Restructure io plugins
goanpeca Sep 14, 2015
a45edb2
Remove unwanted tabs
goanpeca Sep 14, 2015
e0f921e
Remove Path
goanpeca Sep 14, 2015
0c8cfd8
Restore IMAGE_PATH and remove Path
goanpeca Nov 1, 2015
8c545e6
Update setup.py to correctly build wheel
goanpeca Nov 1, 2015
037e6c7
Remove test for plugins
goanpeca Nov 1, 2015
ebefff1
Add try except to spyplugins widgets to enable testing
goanpeca Nov 4, 2015
c8035ba
Minor comment/style fixes
goanpeca Nov 9, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions continuous_integration/travis/modules_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ for f in spyderlib/*/*/*.py; do
fi
done


# Spyderplugins
for f in spyderplugins/widgets/*.py; do
for f in spyplugins/ui/*/widgets/*.py; do
python "$f"
Copy link
Member

Choose a reason for hiding this comment

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

Please don't remove these tests. Just change this line to

for f in spyplugins/ui/*/widgets/*.py; do

That should fix these tests because spyplugins widgets can be run outside Spyder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, that does not cut it... it was not only that

Test wont run cause they do not run as standalone scripts, they only work when a spyder instance runs

if [ $? -ne 0 ]; then
exit 1
Expand Down
6 changes: 3 additions & 3 deletions gettext_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

if __name__ == "__main__":
do_compile("spyderlib")
do_compile("p_pylint", "spyderplugins")
do_compile("p_profiler", "spyderplugins")
do_compile("p_breakpoints", "spyderplugins")
do_compile("pylint", "spyplugins/ui/pylint")
do_compile("profiler", "spyplugins/ui/profiler")
do_compile("breakpoints", "spyplugins/ui/breakpoints")
19 changes: 10 additions & 9 deletions gettext_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

if __name__ == "__main__":
do_rescan("spyderlib")
do_rescan_files(["spyderplugins/p_pylint.py",
"spyderplugins/widgets/pylintgui.py"],
"p_pylint", "spyderplugins")
do_rescan_files(["spyderplugins/p_profiler.py",
"spyderplugins/widgets/profilergui.py"],
"p_profiler", "spyderplugins")
do_rescan_files(["spyderplugins/p_breakpoints.py",
"spyderplugins/widgets/breakpointsgui.py"],
"p_breakpoints", "spyderplugins")
do_rescan_files(["spyplugins/ui/pylint/pylint.py",
"spyplugins/ui/pylint/widgets/pylintgui.py"],
"pylint", "spyplugins/ui/pylint")
do_rescan_files(["spyplugins/ui/profiler/profiler.py",
"spyplugins/ui/profiler/widgets/profilergui.py"],
"profiler", "spyplugins/ui/profiler")
do_rescan_files(["spyplugins/ui/breakpoints/breakpoints.py",
"spyplugins/ui/breakpoints/widgets/breakpointsgui.py"],
"breakpoints", "spyplugins/ui/breakpoints")

Binary file not shown.
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_packages():
dstdir = osp.join(LIBNAME, 'utils', 'external', name)
shutil.copytree(srcdir, dstdir)
atexit.register(shutil.rmtree, osp.abspath(dstdir))
packages = get_subpackages(LIBNAME)+get_subpackages('spyderplugins')
packages = get_subpackages(LIBNAME) + get_subpackages('spyplugins')
return packages


Expand Down Expand Up @@ -173,7 +173,7 @@ def run(self):
sys.path.insert(0, os.path.abspath(build.build_lib))
dirname = self.distribution.get_command_obj('build').build_purelib
self.builder_target_dir = osp.join(dirname, 'spyderlib', 'doc')

if not osp.exists(self.builder_target_dir):
os.mkdir(self.builder_target_dir)

Expand All @@ -189,7 +189,7 @@ def run(self):
"location (path with *only* ASCII characters).",
file=sys.stderr)
sys.path.pop(0)

# Building chm doc, if HTML Help Workshop is installed
if hhc_exe is not None:
fname = osp.join(self.builder_target_dir, 'Spyderdoc.chm')
Expand Down Expand Up @@ -260,11 +260,11 @@ def run(self):
version=__version__,
description='Scientific PYthon Development EnviRonment',
long_description=WININST_MSG + \
"""Spyder is an interactive Python development environment providing
"""Spyder is an interactive Python development environment providing
MATLAB-like features in a simple and light-weighted software.
It also provides ready-to-use pure-Python widgets to your PyQt4 or
PySide application: source code editor with syntax highlighting and
code introspection/analysis features, NumPy array editor, dictionary
It also provides ready-to-use pure-Python widgets to your PyQt4 or
PySide application: source code editor with syntax highlighting and
code introspection/analysis features, NumPy array editor, dictionary
editor, Python console, etc.""",
download_url='%s/files/%s-%s.zip' % (__project_url__, NAME, __version__),
author="Pierre Raybaut",
Expand All @@ -274,8 +274,8 @@ def run(self):
platforms=['any'],
packages=get_packages(),
package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST),
'spyderplugins':
get_package_data('spyderplugins', EXTLIST)},
'spyplugins': get_package_data('spyplugins', EXTLIST),
},
scripts=[osp.join('scripts', fname) for fname in SCRIPTS],
data_files=get_data_files(),
options={"bdist_wininst":
Expand Down
5 changes: 0 additions & 5 deletions spyderlib/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ def add_image_path(path):

add_image_path(get_module_data_path('spyderlib', relpath='images'))

from spyderlib.otherplugins import PLUGIN_PATH
if PLUGIN_PATH is not None:
add_image_path(osp.join(PLUGIN_PATH, 'images'))

def get_image_path(name, default="not_found.png"):
"""Return image absolute path"""
for img_path in IMG_PATH:
Expand Down Expand Up @@ -306,7 +302,6 @@ def get_translation(modname, dirname=None):
dirname = modname
locale_path = get_module_data_path(dirname, relpath="locale",
attr_name='LOCALEPATH')

# If LANG is defined in ubuntu, a warning message is displayed, so in unix
# systems we define the LANGUAGE variable.
language = load_lang_conf()
Expand Down
Loading