From 1e32e015586e1de2742f64822174ab8b62d08cf0 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 22:08:32 +0000 Subject: [PATCH 01/13] :bug: eat the module not found error in python. fix #6 --- lml/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lml/utils.py b/lml/utils.py index 647254d..5cba010 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -47,6 +47,8 @@ def do_import(plugin_module_name): plugin_module = getattr(plugin_module, module) log.debug("found " + plugin_module_name) return plugin_module + except ModuleNotFoundError: + log.info("Module %s is missing", plugin_module_name) except ImportError: log.exception("failed to import %s", plugin_module_name) raise From 5f02119bfef4ba95e071641b97b1350a9933a18e Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 22:10:25 +0000 Subject: [PATCH 02/13] :sparkles: better implemenation to accomendate python 3 --- lml/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lml/utils.py b/lml/utils.py index 5cba010..2ac0bf1 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -11,6 +11,11 @@ import sys import logging from json import dumps, JSONEncoder +try: + ModuleNotFoundError +except NameError: + ModuleNotFoundError = ImportError + PY2 = sys.version_info[0] == 2 log = logging.getLogger(__name__) @@ -48,10 +53,7 @@ def do_import(plugin_module_name): log.debug("found " + plugin_module_name) return plugin_module except ModuleNotFoundError: - log.info("Module %s is missing", plugin_module_name) - except ImportError: log.exception("failed to import %s", plugin_module_name) - raise def do_import_class(plugin_class): From 749359aa9b24062228568408e095dd0ce9b52b42 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 22:32:14 +0000 Subject: [PATCH 03/13] :green_heart: pass unit tests. #6 --- lml/utils.py | 35 ++++++++++++++++++++--------------- tests/test_utils.py | 8 +++++--- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lml/utils.py b/lml/utils.py index 2ac0bf1..d2331b8 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -11,11 +11,6 @@ import sys import logging from json import dumps, JSONEncoder -try: - ModuleNotFoundError -except NameError: - ModuleNotFoundError = ImportError - PY2 = sys.version_info[0] == 2 log = logging.getLogger(__name__) @@ -44,16 +39,26 @@ def json_dumps(keywords): def do_import(plugin_module_name): """dynamically import a module""" - try: - plugin_module = __import__(plugin_module_name) - if "." in plugin_module_name: - modules = plugin_module_name.split(".") - for module in modules[1:]: - plugin_module = getattr(plugin_module, module) - log.debug("found " + plugin_module_name) - return plugin_module - except ModuleNotFoundError: - log.exception("failed to import %s", plugin_module_name) + if PY2: + try: + return _do_import(plugin_module_name) + except ImportError: + log.exception("failed to import %s", plugin_module_name) + else: + try: + return _do_import(plugin_module_name) + except (ImportError, ModuleNotFoundError): + log.exception("failed to import %s", plugin_module_name) + + +def _do_import(plugin_module_name): + plugin_module = __import__(plugin_module_name) + if "." in plugin_module_name: + modules = plugin_module_name.split(".") + for module in modules[1:]: + plugin_module = getattr(plugin_module, module) + log.debug("found " + plugin_module_name) + return plugin_module def do_import_class(plugin_class): diff --git a/tests/test_utils.py b/tests/test_utils.py index 4e25539..b54a295 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,6 @@ +from mock import patch from lml.plugin import PluginManager -from nose.tools import eq_, raises +from nose.tools import eq_ from lml.utils import json_dumps from lml.utils import do_import @@ -27,9 +28,10 @@ def test_do_import_2(): eq_(plugin, themodule) -@raises(ImportError) -def test_do_import_error(): +@patch("lml.utils.log.exception") +def test_do_import_error(mock_exception): do_import("non.exist") + mock_exception.assert_called_with('failed to import %s', 'non.exist') def test_do_import_cls(): From 15d55dc8672622575f807a063444515ef0dd9d42 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 22:36:27 +0000 Subject: [PATCH 04/13] :hammer: major automatic code formatting using isort and black --- Makefile | 6 ++ examples/robotchef/docs/source/conf.py | 69 +++++++++++-------- examples/robotchef/robotchef/main.py | 18 ++--- examples/robotchef/robotchef/plugin.py | 1 - .../robotchef/robot_cuisine/__init__.py | 4 +- .../robotchef/robot_cuisine/electrify.py | 1 - examples/robotchef/setup.py | 63 ++++++++--------- examples/robotchef/tests/test_robot_chef.py | 11 +-- .../robotchef_allinone/docs/source/conf.py | 69 +++++++++++-------- .../robotchef_allinone/plugin.py | 6 +- examples/robotchef_allinone/setup.py | 57 +++++++-------- .../tests/test_robot_chef.py | 11 +-- .../docs/source/conf.py | 69 +++++++++++-------- .../robotchef_allinone_lml/plugin.py | 12 ++-- examples/robotchef_allinone_lml/setup.py | 57 ++++++++------- .../tests/test_robot_chef.py | 11 +-- .../docs/source/conf.py | 69 +++++++++++-------- .../robotchef_britishcuisine/__init__.py | 10 +-- .../robotchef_britishcuisine/bake.py | 1 - .../robotchef_britishcuisine/fry.py | 1 - examples/robotchef_britishcuisine/setup.py | 53 +++++++------- .../docs/source/conf.py | 69 +++++++++++-------- .../robotchef_chinesecuisine/__init__.py | 4 +- .../robotchef_chinesecuisine/roast.py | 1 - examples/robotchef_chinesecuisine/setup.py | 53 +++++++------- examples/robotchef_cook/docs/source/conf.py | 69 +++++++++++-------- .../robotchef_cook/robotchef_cook/__init__.py | 6 +- .../robotchef_cook/robotchef_cook/cook.py | 1 - examples/robotchef_cook/setup.py | 53 +++++++------- examples/v2/robotchef_api/docs/source/conf.py | 69 +++++++++++-------- .../robotchef_api/robotchef_api/__init__.py | 7 +- .../v2/robotchef_api/robotchef_api/plugin.py | 1 - .../robotchef_api/robot_cuisine/__init__.py | 4 +- .../robot_cuisine/electricity.py | 1 - examples/v2/robotchef_api/setup.py | 57 +++++++-------- .../docs/source/conf.py | 69 +++++++++++-------- .../robotchef_britishcuisine/__init__.py | 10 +-- .../robotchef_britishcuisine/bake.py | 1 - .../robotchef_britishcuisine/fry.py | 1 - examples/v2/robotchef_britishcuisine/setup.py | 53 +++++++------- examples/v2/robotchef_v2/docs/source/conf.py | 69 +++++++++++-------- examples/v2/robotchef_v2/robotchef_v2/main.py | 2 +- examples/v2/robotchef_v2/setup.py | 59 +++++++--------- .../v2/robotchef_v2/tests/test_robot_chef.py | 11 +-- lml/loader.py | 4 +- lml/plugin.py | 4 +- lml/utils.py | 3 +- setup.py | 4 +- tests/requirements.txt | 2 + tests/test_plugin_info.py | 4 +- tests/test_plugin_manager.py | 11 ++- tests/test_utils.py | 8 +-- 52 files changed, 669 insertions(+), 640 deletions(-) diff --git a/Makefile b/Makefile index 57dc072..f993b37 100644 --- a/Makefile +++ b/Makefile @@ -12,3 +12,9 @@ spelling: uml: plantuml -tsvg -o ../_static/images/ docs/source/uml/*.uml + +format: + isort -y $(find lml -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo) + black -l 79 lml + black -l 79 tests + black -l 79 examples diff --git a/examples/robotchef/docs/source/conf.py b/examples/robotchef/docs/source/conf.py index e6fe842..4a18e32 100644 --- a/examples/robotchef/docs/source/conf.py +++ b/examples/robotchef/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'Sample project to demonstrate load me later plugin system' + - '' -) +DESCRIPTION = "Sample project to demonstrate load me later plugin system" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchefdoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchefdoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef.tex', - 'robotchef Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef.tex", + "robotchef Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef', - 'robotchef Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef", + "robotchef Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef', - 'robotchef Documentation', - 'Onni Software Ltd.', 'robotchef', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef", + "robotchef Documentation", + "Onni Software Ltd.", + "robotchef", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef/robotchef/main.py b/examples/robotchef/robotchef/main.py index 581076b..c6de9bd 100644 --- a/examples/robotchef/robotchef/main.py +++ b/examples/robotchef/robotchef/main.py @@ -1,16 +1,16 @@ import sys - -from lml.loader import scan_plugins - -from robotchef.plugin import CuisineManager, NoChefException import logging import logging.config -logging.basicConfig( - format='%(name)s:%(lineno)d - %(levelname)s - %(message)s', - level=logging.DEBUG) +from lml.loader import scan_plugins +from robotchef.plugin import CuisineManager, NoChefException -BUILTINS = ['robotchef.robot_cuisine'] +logging.basicConfig( + format="%(name)s:%(lineno)d - %(levelname)s - %(message)s", + level=logging.DEBUG, +) + +BUILTINS = ["robotchef.robot_cuisine"] def main(): @@ -18,7 +18,7 @@ def main(): sys.exit(-1) cuisine_manager = CuisineManager() - scan_plugins("robotchef_", 'robotchef', white_list=BUILTINS) + scan_plugins("robotchef_", "robotchef", white_list=BUILTINS) food_name = sys.argv[1] try: diff --git a/examples/robotchef/robotchef/plugin.py b/examples/robotchef/robotchef/plugin.py index 39b1b19..7a08eff 100644 --- a/examples/robotchef/robotchef/plugin.py +++ b/examples/robotchef/robotchef/plugin.py @@ -17,6 +17,5 @@ class CuisineManager(PluginManager): class Chef(object): - def make(self, **params): print("I am a chef") diff --git a/examples/robotchef/robotchef/robot_cuisine/__init__.py b/examples/robotchef/robotchef/robot_cuisine/__init__.py index 5cf1a17..b51a908 100644 --- a/examples/robotchef/robotchef/robot_cuisine/__init__.py +++ b/examples/robotchef/robotchef/robot_cuisine/__init__.py @@ -2,7 +2,5 @@ from lml.plugin import PluginInfoChain PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'electrify.Boost', - tags=['Portable Battery'] + "cuisine", "electrify.Boost", tags=["Portable Battery"] ) diff --git a/examples/robotchef/robotchef/robot_cuisine/electrify.py b/examples/robotchef/robotchef/robot_cuisine/electrify.py index 27f29ee..76be251 100644 --- a/examples/robotchef/robotchef/robot_cuisine/electrify.py +++ b/examples/robotchef/robotchef/robot_cuisine/electrify.py @@ -2,6 +2,5 @@ from robotchef.plugin import Chef class Boost(Chef): - def make(self, food=None, **keywords): print("I can cook %s for robots" % food) diff --git a/examples/robotchef/setup.py b/examples/robotchef/setup.py index f7507f0..52d686d 100644 --- a/examples/robotchef/setup.py +++ b/examples/robotchef/setup.py @@ -2,47 +2,38 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc (c) hotmail.com' -LICENSE = 'MIT' -ENTRY_POINTS = { - 'console_scripts': [ - 'robotchef = robotchef.main:main' - ] -} -DESCRIPTION = ( - 'Sample project to demonstrate load me later plugin system' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc (c) hotmail.com" +LICENSE = "MIT" +ENTRY_POINTS = {"console_scripts": ["robotchef = robotchef.main:main"]} +DESCRIPTION = "Sample project to demonstrate load me later plugin system" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ - 'lml', -] +INSTALL_REQUIRES = ["lml"] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) -EXTRAS_REQUIRE = { -} +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) +EXTRAS_REQUIRE = {} def read_files(*files): @@ -56,7 +47,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -65,11 +56,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -82,22 +73,22 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, entry_points=ENTRY_POINTS, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/robotchef/tests/test_robot_chef.py b/examples/robotchef/tests/test_robot_chef.py index 130b846..a827e02 100644 --- a/examples/robotchef/tests/test_robot_chef.py +++ b/examples/robotchef/tests/test_robot_chef.py @@ -1,6 +1,8 @@ import sys + from mock import patch from nose.tools import eq_ + PY2 = sys.version_info[0] == 2 if PY2: @@ -9,10 +11,11 @@ else: from io import StringIO -@patch('sys.stdout', new_callable=StringIO) +@patch("sys.stdout", new_callable=StringIO) def test_peking_duck(stdout): - arguments = ['robotchef', 'Peking Duck'] + arguments = ["robotchef", "Peking Duck"] from robotchef.main import main - with patch.object(sys, 'argv', arguments): + + with patch.object(sys, "argv", arguments): main() - eq_(stdout.getvalue(), 'I can roast Peking Duck\n') + eq_(stdout.getvalue(), "I can roast Peking Duck\n") diff --git a/examples/robotchef_allinone/docs/source/conf.py b/examples/robotchef_allinone/docs/source/conf.py index 799af2e..d105035 100644 --- a/examples/robotchef_allinone/docs/source/conf.py +++ b/examples/robotchef_allinone/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'It does cooking' + - '' -) +DESCRIPTION = "It does cooking" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_allinone' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_allinone" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_allinonedoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_allinonedoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_allinone.tex', - 'robotchef_allinone Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_allinone.tex", + "robotchef_allinone Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_allinone', - 'robotchef_allinone Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_allinone", + "robotchef_allinone Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_allinone', - 'robotchef_allinone Documentation', - 'Onni Software Ltd.', 'robotchef_allinone', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_allinone", + "robotchef_allinone Documentation", + "Onni Software Ltd.", + "robotchef_allinone", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef_allinone/robotchef_allinone/plugin.py b/examples/robotchef_allinone/robotchef_allinone/plugin.py index 816a032..7c16ca7 100644 --- a/examples/robotchef_allinone/robotchef_allinone/plugin.py +++ b/examples/robotchef_allinone/robotchef_allinone/plugin.py @@ -3,25 +3,21 @@ class NoChefException(Exception): class Chef(object): - def make(self, **params): print("I am a chef") class Boost(Chef): - def make(self, food=None, **keywords): print("I can cook %s for robots" % food) class Fry(Chef): - def make(self, food=None): print("I can fry " + food) class Bake(Chef): - def make(self, food=None): print("I can bake " + food) @@ -30,7 +26,7 @@ PLUGINS = { "Portable Battery": Boost, "Fish and Chips": Fry, "Cornish Scone": Bake, - "Jacket Potato": Bake + "Jacket Potato": Bake, } diff --git a/examples/robotchef_allinone/setup.py b/examples/robotchef_allinone/setup.py index 94125ca..aac45d6 100644 --- a/examples/robotchef_allinone/setup.py +++ b/examples/robotchef_allinone/setup.py @@ -2,44 +2,39 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_allinone' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (at) hotmail.com' -LICENSE = 'MIT' +NAME = "robotchef_allinone" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (at) hotmail.com" +LICENSE = "MIT" ENTRY_POINTS = { - 'console_scripts': [ - 'robotchef_allinone = robotchef_allinone.main:main' - ] + "console_scripts": ["robotchef_allinone = robotchef_allinone.main:main"] } -DESCRIPTION = ( - 'It does cooking' + - '' -) -KEYWORDS = [ -] +DESCRIPTION = "It does cooking" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -54,7 +49,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -63,11 +58,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -80,22 +75,22 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, entry_points=ENTRY_POINTS, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/robotchef_allinone/tests/test_robot_chef.py b/examples/robotchef_allinone/tests/test_robot_chef.py index 063f4c5..b05acf5 100644 --- a/examples/robotchef_allinone/tests/test_robot_chef.py +++ b/examples/robotchef_allinone/tests/test_robot_chef.py @@ -1,6 +1,8 @@ import sys + from mock import patch from nose.tools import eq_ + PY2 = sys.version_info[0] == 2 if PY2: @@ -9,10 +11,11 @@ else: from io import StringIO -@patch('sys.stdout', new_callable=StringIO) +@patch("sys.stdout", new_callable=StringIO) def test_cornish_scone(stdout): - arguments = ['robotchef', 'Cornish Scone'] + arguments = ["robotchef", "Cornish Scone"] from robotchef_allinone.main import main - with patch.object(sys, 'argv', arguments): + + with patch.object(sys, "argv", arguments): main() - eq_(stdout.getvalue(), 'I can bake Cornish Scone\n') + eq_(stdout.getvalue(), "I can bake Cornish Scone\n") diff --git a/examples/robotchef_allinone_lml/docs/source/conf.py b/examples/robotchef_allinone_lml/docs/source/conf.py index 3d6bbcc..84e8000 100644 --- a/examples/robotchef_allinone_lml/docs/source/conf.py +++ b/examples/robotchef_allinone_lml/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'it cook food' + - '' -) +DESCRIPTION = "it cook food" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_allinone_lml' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_allinone_lml" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_allinone_lmldoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_allinone_lmldoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_allinone_lml.tex', - 'robotchef_allinone_lml Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_allinone_lml.tex", + "robotchef_allinone_lml Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_allinone_lml', - 'robotchef_allinone_lml Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_allinone_lml", + "robotchef_allinone_lml Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_allinone_lml', - 'robotchef_allinone_lml Documentation', - 'Onni Software Ltd.', 'robotchef_allinone_lml', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_allinone_lml", + "robotchef_allinone_lml Documentation", + "Onni Software Ltd.", + "robotchef_allinone_lml", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef_allinone_lml/robotchef_allinone_lml/plugin.py b/examples/robotchef_allinone_lml/robotchef_allinone_lml/plugin.py index 08146a8..ad0c43e 100644 --- a/examples/robotchef_allinone_lml/robotchef_allinone_lml/plugin.py +++ b/examples/robotchef_allinone_lml/robotchef_allinone_lml/plugin.py @@ -1,4 +1,4 @@ -from lml.plugin import PluginManager, PluginInfo +from lml.plugin import PluginInfo, PluginManager class NoChefException(Exception): @@ -17,27 +17,23 @@ class CuisineManager(PluginManager): class Chef(object): - def make(self, **params): print("I am a chef") -@PluginInfo('cuisine', tags=['Portable Battery']) +@PluginInfo("cuisine", tags=["Portable Battery"]) class Boost(Chef): - def make(self, food=None, **keywords): print("I can cook %s for robots" % food) -@PluginInfo('cuisine', tags=['Fish and Chips']) +@PluginInfo("cuisine", tags=["Fish and Chips"]) class Fry(Chef): - def make(self, food=None): print("I can fry " + food) -@PluginInfo('cuisine', tags=['Cornish Scone', 'Jacket Potato']) +@PluginInfo("cuisine", tags=["Cornish Scone", "Jacket Potato"]) class Bake(Chef): - def make(self, food=None): print("I can bake " + food) diff --git a/examples/robotchef_allinone_lml/setup.py b/examples/robotchef_allinone_lml/setup.py index 0f3c466..ddf0681 100644 --- a/examples/robotchef_allinone_lml/setup.py +++ b/examples/robotchef_allinone_lml/setup.py @@ -2,44 +2,41 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_allinone_lml' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (at) hotmail.com' -LICENSE = 'MIT' +NAME = "robotchef_allinone_lml" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (at) hotmail.com" +LICENSE = "MIT" ENTRY_POINTS = { - 'console_scripts': [ - 'robotchef_allinone_lml = robotchef_allinone_lml.main:main' + "console_scripts": [ + "robotchef_allinone_lml = robotchef_allinone_lml.main:main" ] } -DESCRIPTION = ( - 'it cook food' + - '' -) -KEYWORDS = [ -] +DESCRIPTION = "it cook food" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -54,7 +51,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -63,11 +60,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -80,22 +77,22 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, entry_points=ENTRY_POINTS, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/robotchef_allinone_lml/tests/test_robot_chef.py b/examples/robotchef_allinone_lml/tests/test_robot_chef.py index 5084090..78e65c5 100644 --- a/examples/robotchef_allinone_lml/tests/test_robot_chef.py +++ b/examples/robotchef_allinone_lml/tests/test_robot_chef.py @@ -1,6 +1,8 @@ import sys + from mock import patch from nose.tools import eq_ + PY2 = sys.version_info[0] == 2 if PY2: @@ -9,10 +11,11 @@ else: from io import StringIO -@patch('sys.stdout', new_callable=StringIO) +@patch("sys.stdout", new_callable=StringIO) def test_cornish_scone(stdout): - arguments = ['robotchef', 'Cornish Scone'] + arguments = ["robotchef", "Cornish Scone"] from robotchef_allinone_lml.main import main - with patch.object(sys, 'argv', arguments): + + with patch.object(sys, "argv", arguments): main() - eq_(stdout.getvalue(), 'I can bake Cornish Scone\n') + eq_(stdout.getvalue(), "I can bake Cornish Scone\n") diff --git a/examples/robotchef_britishcuisine/docs/source/conf.py b/examples/robotchef_britishcuisine/docs/source/conf.py index d68f125..5c635a5 100644 --- a/examples/robotchef_britishcuisine/docs/source/conf.py +++ b/examples/robotchef_britishcuisine/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'Cook food in british cuisine.' + - '' -) +DESCRIPTION = "Cook food in british cuisine." + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_britishcuisine' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_britishcuisine" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_britishcuisinedoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_britishcuisinedoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_britishcuisine.tex', - 'robotchef_britishcuisine Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_britishcuisine.tex", + "robotchef_britishcuisine Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_britishcuisine', - 'robotchef_britishcuisine Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_britishcuisine", + "robotchef_britishcuisine Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_britishcuisine', - 'robotchef_britishcuisine Documentation', - 'Onni Software Ltd.', 'robotchef_britishcuisine', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_britishcuisine", + "robotchef_britishcuisine Documentation", + "Onni Software Ltd.", + "robotchef_britishcuisine", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py b/examples/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py index f2e5b80..1836204 100644 --- a/examples/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py +++ b/examples/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py @@ -2,11 +2,5 @@ from lml.plugin import PluginInfoChain PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'fry.Fry', - tags=['Fish and Chips'] -).add_a_plugin( - 'cuisine', - 'bake.Bake', - tags=['Cornish Scone', 'Jacket Potato'] -) + "cuisine", "fry.Fry", tags=["Fish and Chips"] +).add_a_plugin("cuisine", "bake.Bake", tags=["Cornish Scone", "Jacket Potato"]) diff --git a/examples/robotchef_britishcuisine/robotchef_britishcuisine/bake.py b/examples/robotchef_britishcuisine/robotchef_britishcuisine/bake.py index 07ecbf1..dc92d83 100644 --- a/examples/robotchef_britishcuisine/robotchef_britishcuisine/bake.py +++ b/examples/robotchef_britishcuisine/robotchef_britishcuisine/bake.py @@ -2,6 +2,5 @@ from robotchef.plugin import Chef class Bake(Chef): - def make(self, food=None): print("I can bake " + food) diff --git a/examples/robotchef_britishcuisine/robotchef_britishcuisine/fry.py b/examples/robotchef_britishcuisine/robotchef_britishcuisine/fry.py index 7d668e2..a09232a 100644 --- a/examples/robotchef_britishcuisine/robotchef_britishcuisine/fry.py +++ b/examples/robotchef_britishcuisine/robotchef_britishcuisine/fry.py @@ -2,6 +2,5 @@ from robotchef.plugin import Chef class Fry(Chef): - def make(self, food=None): print("I can fry " + food) diff --git a/examples/robotchef_britishcuisine/setup.py b/examples/robotchef_britishcuisine/setup.py index d43f3f1..20efaf4 100644 --- a/examples/robotchef_britishcuisine/setup.py +++ b/examples/robotchef_britishcuisine/setup.py @@ -2,39 +2,36 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_britishcuisine' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (c) hotmail.com' -LICENSE = 'MIT' -DESCRIPTION = ( - 'Cook food in british cuisine.' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_britishcuisine" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (c) hotmail.com" +LICENSE = "MIT" +DESCRIPTION = "Cook food in british cuisine." + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -49,7 +46,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -58,11 +55,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -75,21 +72,21 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/robotchef_chinesecuisine/docs/source/conf.py b/examples/robotchef_chinesecuisine/docs/source/conf.py index 670483a..c03b8e2 100644 --- a/examples/robotchef_chinesecuisine/docs/source/conf.py +++ b/examples/robotchef_chinesecuisine/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'It cooks Chinese food' + - '' -) +DESCRIPTION = "It cooks Chinese food" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_chinesecuisine' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_chinesecuisine" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_chinesecuisinedoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_chinesecuisinedoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_chinesecuisine.tex', - 'robotchef_chinesecuisine Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_chinesecuisine.tex", + "robotchef_chinesecuisine Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_chinesecuisine', - 'robotchef_chinesecuisine Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_chinesecuisine", + "robotchef_chinesecuisine Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_chinesecuisine', - 'robotchef_chinesecuisine Documentation', - 'Onni Software Ltd.', 'robotchef_chinesecuisine', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_chinesecuisine", + "robotchef_chinesecuisine Documentation", + "Onni Software Ltd.", + "robotchef_chinesecuisine", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/__init__.py b/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/__init__.py index 4a369ea..660ad9f 100644 --- a/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/__init__.py +++ b/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/__init__.py @@ -2,7 +2,5 @@ from lml.plugin import PluginInfoChain PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'roast.Roast', - tags=['Peking Duck'] + "cuisine", "roast.Roast", tags=["Peking Duck"] ) diff --git a/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/roast.py b/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/roast.py index 2b9028b..9edd03c 100644 --- a/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/roast.py +++ b/examples/robotchef_chinesecuisine/robotchef_chinesecuisine/roast.py @@ -2,6 +2,5 @@ from robotchef.plugin import Chef class Roast(Chef): - def make(self, food=None): print("I can roast " + food) diff --git a/examples/robotchef_chinesecuisine/setup.py b/examples/robotchef_chinesecuisine/setup.py index 9efd52c..43fc115 100644 --- a/examples/robotchef_chinesecuisine/setup.py +++ b/examples/robotchef_chinesecuisine/setup.py @@ -2,39 +2,36 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_chinesecuisine' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (c) hotmail.com' -LICENSE = 'MIT' -DESCRIPTION = ( - 'It cooks Chinese food' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_chinesecuisine" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (c) hotmail.com" +LICENSE = "MIT" +DESCRIPTION = "It cooks Chinese food" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -49,7 +46,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -58,11 +55,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -75,21 +72,21 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/robotchef_cook/docs/source/conf.py b/examples/robotchef_cook/docs/source/conf.py index 427b8e1..3403ada 100644 --- a/examples/robotchef_cook/docs/source/conf.py +++ b/examples/robotchef_cook/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'Make robot chef to cook' + - '' -) +DESCRIPTION = "Make robot chef to cook" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_cook' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_cook" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_cookdoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_cookdoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_cook.tex', - 'robotchef_cook Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_cook.tex", + "robotchef_cook Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_cook', - 'robotchef_cook Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_cook", + "robotchef_cook Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_cook', - 'robotchef_cook Documentation', - 'Onni Software Ltd.', 'robotchef_cook', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_cook", + "robotchef_cook Documentation", + "Onni Software Ltd.", + "robotchef_cook", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/robotchef_cook/robotchef_cook/__init__.py b/examples/robotchef_cook/robotchef_cook/__init__.py index 4161ee9..7769e49 100644 --- a/examples/robotchef_cook/robotchef_cook/__init__.py +++ b/examples/robotchef_cook/robotchef_cook/__init__.py @@ -1,8 +1,4 @@ from lml.plugin import PluginInfoChain -PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'cook.Cook', - tags=['bread'] -) +PluginInfoChain(__name__).add_a_plugin("cuisine", "cook.Cook", tags=["bread"]) diff --git a/examples/robotchef_cook/robotchef_cook/cook.py b/examples/robotchef_cook/robotchef_cook/cook.py index 0d97e9b..39324f6 100644 --- a/examples/robotchef_cook/robotchef_cook/cook.py +++ b/examples/robotchef_cook/robotchef_cook/cook.py @@ -2,6 +2,5 @@ from robotchef.plugin import Chef class Cook(Chef): - def make(self, food=None): print("I can cook " + food) diff --git a/examples/robotchef_cook/setup.py b/examples/robotchef_cook/setup.py index bc702ac..7a2fd3b 100644 --- a/examples/robotchef_cook/setup.py +++ b/examples/robotchef_cook/setup.py @@ -2,39 +2,36 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_cook' -AUTHOR = 'C.W' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (at) hotmail.com' -LICENSE = 'MIT' -DESCRIPTION = ( - 'Make robot chef to cook' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_cook" +AUTHOR = "C.W" +VERSION = "0.0.1" +EMAIL = "wangc_2011 (at) hotmail.com" +LICENSE = "MIT" +DESCRIPTION = "Make robot chef to cook" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -49,7 +46,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -58,11 +55,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -75,21 +72,21 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/v2/robotchef_api/docs/source/conf.py b/examples/v2/robotchef_api/docs/source/conf.py index b78c779..da7f94f 100644 --- a/examples/v2/robotchef_api/docs/source/conf.py +++ b/examples/v2/robotchef_api/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'It provide the cusine knowledge to any library' + - '' -) +DESCRIPTION = "It provide the cusine knowledge to any library" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_api' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_api" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_apidoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_apidoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_api.tex', - 'robotchef_api Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_api.tex", + "robotchef_api Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_api', - 'robotchef_api Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_api", + "robotchef_api Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_api', - 'robotchef_api Documentation', - 'Onni Software Ltd.', 'robotchef_api', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_api", + "robotchef_api Documentation", + "Onni Software Ltd.", + "robotchef_api", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/v2/robotchef_api/robotchef_api/__init__.py b/examples/v2/robotchef_api/robotchef_api/__init__.py index 5018f53..8e04579 100644 --- a/examples/v2/robotchef_api/robotchef_api/__init__.py +++ b/examples/v2/robotchef_api/robotchef_api/__init__.py @@ -1,8 +1,11 @@ from lml.loader import scan_plugins -from robotchef_api.plugin import CuisineManager, NoChefException # flake8: noqa +from robotchef_api.plugin import ( + CuisineManager, + NoChefException, +) # flake8: noqa -BUILTINS = ['robotchef_api.robot_cuisine'] +BUILTINS = ["robotchef_api.robot_cuisine"] scan_plugins("robotchef_", __path__, white_list=BUILTINS) diff --git a/examples/v2/robotchef_api/robotchef_api/plugin.py b/examples/v2/robotchef_api/robotchef_api/plugin.py index e23b9a2..5b1b92a 100644 --- a/examples/v2/robotchef_api/robotchef_api/plugin.py +++ b/examples/v2/robotchef_api/robotchef_api/plugin.py @@ -17,6 +17,5 @@ class CuisineManager(PluginManager): class Chef(object): - def make(self, **params): print(self.name) diff --git a/examples/v2/robotchef_api/robotchef_api/robot_cuisine/__init__.py b/examples/v2/robotchef_api/robotchef_api/robot_cuisine/__init__.py index 144707e..ec95a3e 100644 --- a/examples/v2/robotchef_api/robotchef_api/robot_cuisine/__init__.py +++ b/examples/v2/robotchef_api/robotchef_api/robot_cuisine/__init__.py @@ -2,7 +2,5 @@ from lml.plugin import PluginInfoChain PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'electricity.Boost', - tags=['Portable Battery'] + "cuisine", "electricity.Boost", tags=["Portable Battery"] ) diff --git a/examples/v2/robotchef_api/robotchef_api/robot_cuisine/electricity.py b/examples/v2/robotchef_api/robotchef_api/robot_cuisine/electricity.py index f12f115..6e9f7b2 100644 --- a/examples/v2/robotchef_api/robotchef_api/robot_cuisine/electricity.py +++ b/examples/v2/robotchef_api/robotchef_api/robot_cuisine/electricity.py @@ -2,6 +2,5 @@ from robotchef_api.plugin import Chef class Boost(Chef): - def make(self, food=None, **keywords): print("I can cook %s for robots" % food) diff --git a/examples/v2/robotchef_api/setup.py b/examples/v2/robotchef_api/setup.py index 761f46d..949547b 100644 --- a/examples/v2/robotchef_api/setup.py +++ b/examples/v2/robotchef_api/setup.py @@ -2,42 +2,37 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_api' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (at) hotmail.com' -LICENSE = 'MIT' -DESCRIPTION = ( - 'It provide the cusine knowledge to any library' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_api" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (at) hotmail.com" +LICENSE = "MIT" +DESCRIPTION = "It provide the cusine knowledge to any library" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ - 'lml', -] +INSTALL_REQUIRES = ["lml"] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) -EXTRAS_REQUIRE = { -} +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) +EXTRAS_REQUIRE = {} def read_files(*files): @@ -51,7 +46,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -60,11 +55,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -77,21 +72,21 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/v2/robotchef_britishcuisine/docs/source/conf.py b/examples/v2/robotchef_britishcuisine/docs/source/conf.py index d68f125..5c635a5 100644 --- a/examples/v2/robotchef_britishcuisine/docs/source/conf.py +++ b/examples/v2/robotchef_britishcuisine/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'Cook food in british cuisine.' + - '' -) +DESCRIPTION = "Cook food in british cuisine." + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_britishcuisine' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_britishcuisine" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_britishcuisinedoc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_britishcuisinedoc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_britishcuisine.tex', - 'robotchef_britishcuisine Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_britishcuisine.tex", + "robotchef_britishcuisine Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_britishcuisine', - 'robotchef_britishcuisine Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_britishcuisine", + "robotchef_britishcuisine Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_britishcuisine', - 'robotchef_britishcuisine Documentation', - 'Onni Software Ltd.', 'robotchef_britishcuisine', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_britishcuisine", + "robotchef_britishcuisine Documentation", + "Onni Software Ltd.", + "robotchef_britishcuisine", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py index f2e5b80..1836204 100644 --- a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py +++ b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/__init__.py @@ -2,11 +2,5 @@ from lml.plugin import PluginInfoChain PluginInfoChain(__name__).add_a_plugin( - 'cuisine', - 'fry.Fry', - tags=['Fish and Chips'] -).add_a_plugin( - 'cuisine', - 'bake.Bake', - tags=['Cornish Scone', 'Jacket Potato'] -) + "cuisine", "fry.Fry", tags=["Fish and Chips"] +).add_a_plugin("cuisine", "bake.Bake", tags=["Cornish Scone", "Jacket Potato"]) diff --git a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/bake.py b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/bake.py index 40467b7..503a1e2 100644 --- a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/bake.py +++ b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/bake.py @@ -2,6 +2,5 @@ from robotchef_api.plugin import Chef class Bake(Chef): - def make(self, food=None): print("I can bake " + food) diff --git a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/fry.py b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/fry.py index 4ed04e2..2491d6a 100644 --- a/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/fry.py +++ b/examples/v2/robotchef_britishcuisine/robotchef_britishcuisine/fry.py @@ -2,6 +2,5 @@ from robotchef_api.plugin import Chef class Fry(Chef): - def make(self, food=None): print("I can fry " + food) diff --git a/examples/v2/robotchef_britishcuisine/setup.py b/examples/v2/robotchef_britishcuisine/setup.py index d43f3f1..20efaf4 100644 --- a/examples/v2/robotchef_britishcuisine/setup.py +++ b/examples/v2/robotchef_britishcuisine/setup.py @@ -2,39 +2,36 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_britishcuisine' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (c) hotmail.com' -LICENSE = 'MIT' -DESCRIPTION = ( - 'Cook food in british cuisine.' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_britishcuisine" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (c) hotmail.com" +LICENSE = "MIT" +DESCRIPTION = "Cook food in british cuisine." + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -49,7 +46,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -58,11 +55,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -75,21 +72,21 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/v2/robotchef_v2/docs/source/conf.py b/examples/v2/robotchef_v2/docs/source/conf.py index 7dc4232..263c168 100644 --- a/examples/v2/robotchef_v2/docs/source/conf.py +++ b/examples/v2/robotchef_v2/docs/source/conf.py @@ -1,43 +1,52 @@ # -*- coding: utf-8 -*- -DESCRIPTION = ( - 'It understands world cuisine' + - '' -) +DESCRIPTION = "It understands world cuisine" + "" extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", ] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' +templates_path = ["_templates"] +source_suffix = ".rst" +master_doc = "index" -project = u'robotchef_v2' -copyright = u'2017 Onni Software Ltd.' -version = '0.0.1' -release = '0.0.1' +project = u"robotchef_v2" +copyright = u"2017 Onni Software Ltd." +version = "0.0.1" +release = "0.0.1" exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' -html_static_path = ['_static'] -htmlhelp_basename = 'robotchef_v2doc' +pygments_style = "sphinx" +html_theme = "default" +html_static_path = ["_static"] +htmlhelp_basename = "robotchef_v2doc" latex_elements = {} latex_documents = [ - ('index', 'robotchef_v2.tex', - 'robotchef_v2 Documentation', - 'Onni Software Ltd.', 'manual'), + ( + "index", + "robotchef_v2.tex", + "robotchef_v2 Documentation", + "Onni Software Ltd.", + "manual", + ) ] man_pages = [ - ('index', 'robotchef_v2', - 'robotchef_v2 Documentation', - [u'Onni Software Ltd.'], 1) + ( + "index", + "robotchef_v2", + "robotchef_v2 Documentation", + [u"Onni Software Ltd."], + 1, + ) ] texinfo_documents = [ - ('index', 'robotchef_v2', - 'robotchef_v2 Documentation', - 'Onni Software Ltd.', 'robotchef_v2', - DESCRIPTION, - 'Miscellaneous'), + ( + "index", + "robotchef_v2", + "robotchef_v2 Documentation", + "Onni Software Ltd.", + "robotchef_v2", + DESCRIPTION, + "Miscellaneous", + ) ] diff --git a/examples/v2/robotchef_v2/robotchef_v2/main.py b/examples/v2/robotchef_v2/robotchef_v2/main.py index 5e691e7..15e68f5 100644 --- a/examples/v2/robotchef_v2/robotchef_v2/main.py +++ b/examples/v2/robotchef_v2/robotchef_v2/main.py @@ -1,6 +1,6 @@ import sys -from robotchef_api import cuisine_manager, NoChefException +from robotchef_api import NoChefException, cuisine_manager def main(): diff --git a/examples/v2/robotchef_v2/setup.py b/examples/v2/robotchef_v2/setup.py index 3a0a62b..8874abf 100644 --- a/examples/v2/robotchef_v2/setup.py +++ b/examples/v2/robotchef_v2/setup.py @@ -2,44 +2,37 @@ try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools + use_setuptools() from setuptools import setup, find_packages import sys + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 -NAME = 'robotchef_v2' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011 (at) hotmail.com' -LICENSE = 'MIT' -ENTRY_POINTS = { - 'console_scripts': [ - 'robotchef_v2 = robotchef_v2.main:main' - ] -} -DESCRIPTION = ( - 'It understands world cuisine' + - '' -) -KEYWORDS = [ -] +NAME = "robotchef_v2" +AUTHOR = "C.W." +VERSION = "0.0.1" +EMAIL = "wangc_2011 (at) hotmail.com" +LICENSE = "MIT" +ENTRY_POINTS = {"console_scripts": ["robotchef_v2 = robotchef_v2.main:main"]} +DESCRIPTION = "It understands world cuisine" + "" +KEYWORDS = [] CLASSIFIERS = [ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] -INSTALL_REQUIRES = [ -] +INSTALL_REQUIRES = [] -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"]) EXTRAS_REQUIRE = {} @@ -54,7 +47,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with open(afile, "r") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -63,11 +56,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -80,22 +73,22 @@ def filter_out_test_code(file_handle): yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( name=NAME, author=AUTHOR, version=VERSION, author_email=EMAIL, description=DESCRIPTION, - long_description=read_files('README.rst', 'CHANGELOG.rst'), + long_description=read_files("README.rst", "CHANGELOG.rst"), license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, zip_safe=False, entry_points=ENTRY_POINTS, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, ) diff --git a/examples/v2/robotchef_v2/tests/test_robot_chef.py b/examples/v2/robotchef_v2/tests/test_robot_chef.py index 1f2ef57..a69bbcb 100644 --- a/examples/v2/robotchef_v2/tests/test_robot_chef.py +++ b/examples/v2/robotchef_v2/tests/test_robot_chef.py @@ -1,6 +1,8 @@ import sys + from mock import patch from nose.tools import eq_ + PY2 = sys.version_info[0] == 2 if PY2: @@ -9,10 +11,11 @@ else: from io import StringIO -@patch('sys.stdout', new_callable=StringIO) +@patch("sys.stdout", new_callable=StringIO) def test_peking_duck(stdout): - arguments = ['robotchef', 'Jacket Potato'] + arguments = ["robotchef", "Jacket Potato"] from robotchef_v2.main import main - with patch.object(sys, 'argv', arguments): + + with patch.object(sys, "argv", arguments): main() - eq_(stdout.getvalue(), 'I can bake Jacket Potato\n') + eq_(stdout.getvalue(), "I can bake Jacket Potato\n") diff --git a/lml/loader.py b/lml/loader.py index 0a633ec..3574d61 100644 --- a/lml/loader.py +++ b/lml/loader.py @@ -10,11 +10,11 @@ :license: New BSD License, see LICENSE for more details """ import re -import pkgutil import logging +import pkgutil from itertools import chain -from lml.utils import do_import +from lml.utils import do_import log = logging.getLogger(__name__) diff --git a/lml/plugin.py b/lml/plugin.py index 35c6a26..7c36802 100644 --- a/lml/plugin.py +++ b/lml/plugin.py @@ -28,9 +28,7 @@ import logging from collections import defaultdict -from lml.utils import do_import_class -from lml.utils import json_dumps - +from lml.utils import json_dumps, do_import_class PLUG_IN_MANAGERS = {} CACHED_PLUGIN_INFO = defaultdict(list) diff --git a/lml/utils.py b/lml/utils.py index d2331b8..a0d9995 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -9,8 +9,7 @@ """ import sys import logging -from json import dumps, JSONEncoder - +from json import JSONEncoder, dumps PY2 = sys.version_info[0] == 2 log = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index 024eb63..ef65f2f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,9 @@ import os import sys import codecs from shutil import rmtree -from setuptools import setup, find_packages, Command + +from setuptools import Command, setup, find_packages + PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 diff --git a/tests/requirements.txt b/tests/requirements.txt index c371212..1766364 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,3 +4,5 @@ codecov coverage flake8 six +black;python_version>="3.6" +isort;python_version>="3.6" diff --git a/tests/test_plugin_info.py b/tests/test_plugin_info.py index 3efa39a..7a820f2 100644 --- a/tests/test_plugin_info.py +++ b/tests/test_plugin_info.py @@ -1,5 +1,7 @@ -from lml.plugin import PluginInfo import json + +from lml.plugin import PluginInfo + from nose.tools import eq_ diff --git a/tests/test_plugin_manager.py b/tests/test_plugin_manager.py index 0bcd1ce..2c0a86d 100644 --- a/tests/test_plugin_manager.py +++ b/tests/test_plugin_manager.py @@ -1,7 +1,12 @@ +from lml.plugin import ( + PLUG_IN_MANAGERS, + CACHED_PLUGIN_INFO, + PluginInfo, + PluginManager, + _show_me_your_name, +) + from mock import patch -from lml.plugin import PluginManager, PLUG_IN_MANAGERS -from lml.plugin import PluginInfo, _show_me_your_name -from lml.plugin import CACHED_PLUGIN_INFO from nose.tools import eq_, raises diff --git a/tests/test_utils.py b/tests/test_utils.py index b54a295..d79adfe 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,8 +1,8 @@ -from mock import patch +from lml.utils import do_import, json_dumps from lml.plugin import PluginManager + +from mock import patch from nose.tools import eq_ -from lml.utils import json_dumps -from lml.utils import do_import def test_json_dumps(): @@ -31,7 +31,7 @@ def test_do_import_2(): @patch("lml.utils.log.exception") def test_do_import_error(mock_exception): do_import("non.exist") - mock_exception.assert_called_with('failed to import %s', 'non.exist') + mock_exception.assert_called_with("failed to import %s", "non.exist") def test_do_import_cls(): From 2f72151fedbe17d8bee89789516468f566e3babd Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 22:36:58 +0000 Subject: [PATCH 05/13] :newspaper: isort configuration --- .isort.cfg | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..2ca38f2 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,9 @@ +[settings] +line_length=79 +known_first_party= +indent=' ' +multi_line_output=3 +length_sort=1 +default_section=FIRSTPARTY +no_lines_before=LOCALFOLDER +sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER From 0ab0a1a50a9ad4554658c6383b17e4f329c82913 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:07:27 +0000 Subject: [PATCH 06/13] :green_heart: use flake8 3.x syntax to ignore flake8 warnings --- examples/v2/robotchef_api/robotchef_api/__init__.py | 6 +++--- lml/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/v2/robotchef_api/robotchef_api/__init__.py b/examples/v2/robotchef_api/robotchef_api/__init__.py index 8e04579..eaa7c53 100644 --- a/examples/v2/robotchef_api/robotchef_api/__init__.py +++ b/examples/v2/robotchef_api/robotchef_api/__init__.py @@ -1,12 +1,12 @@ from lml.loader import scan_plugins -from robotchef_api.plugin import ( +from robotchef_api.plugin import ( # noqa: F401 CuisineManager, NoChefException, -) # flake8: noqa +) BUILTINS = ["robotchef_api.robot_cuisine"] -scan_plugins("robotchef_", __path__, white_list=BUILTINS) +scan_plugins("robotchef_", __path__, white_list=BUILTINS) # noqa: F821 cuisine_manager = CuisineManager() diff --git a/lml/__init__.py b/lml/__init__.py index 65b2db3..bcdac60 100644 --- a/lml/__init__.py +++ b/lml/__init__.py @@ -8,8 +8,8 @@ :license: New BSD License, see LICENSE for more details """ import logging -from lml._version import __version__ # flake8: noqa -from lml._version import __author__ # flake8: noqa +from lml._version import __version__ # noqa: F401 +from lml._version import __author__ # noqa: F401 try: from logging import NullHandler From 88b2c03899c456f6726649de30d1714ec9545d64 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:14:24 +0000 Subject: [PATCH 07/13] :hammer: code refactoring and :books: update change log --- .isort.cfg | 1 + .moban.yml | 6 ++++- CHANGELOG.rst | 9 +++++++ changelog.yml | 8 +++++- docs/source/conf.py | 27 ++++++++++++++----- examples/robotchef/robotchef/main.py | 3 ++- .../robotchef_api/robotchef_api/__init__.py | 5 +--- setup.py | 2 +- tests/test_plugin_info.py | 1 - tests/test_plugin_manager.py | 3 +-- tests/test_utils.py | 3 +-- 11 files changed, 48 insertions(+), 20 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 2ca38f2..646d29a 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,6 +1,7 @@ [settings] line_length=79 known_first_party= +known_third_party=mock,nose indent=' ' multi_line_output=3 length_sort=1 diff --git a/.moban.yml b/.moban.yml index 5735ebb..a7baa4d 100644 --- a/.moban.yml +++ b/.moban.yml @@ -1,6 +1,10 @@ +requires: + - type: git + url: https://github.com/moremoban/pypi-mobans + submodule: true configuration: template_dir: - - "setupmobans/templates" + - "pypi-mobans:templates" - ".moban.d" configuration: lml.yml targets: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f15661f..8e954ea 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,15 @@ Change log ================================================================================ +0.0.5 - unreleased +-------------------------------------------------------------------------------- + +Fixed +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. `#6 `_: Catch and Ignore + ModuleNotFoundError + 0.0.4 - 07.08.2018 -------------------------------------------------------------------------------- diff --git a/changelog.yml b/changelog.yml index 4c3dd17..466f699 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,11 +1,17 @@ name: lml organisation: chfw releases: +- changes: + - action: Fixed + details: + - "`#6`: Catch and Ignore ModuleNotFoundError" + date: unreleased + version: 0.0.5 - changes: - action: Added details: - "`#4`: to find plugin names with different naming patterns" - date: 07.08.2018 + date: 07.08.2018 version: 0.0.4 - changes: - action: Added diff --git a/docs/source/conf.py b/docs/source/conf.py index 87b3e31..9d3ac4c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,12 +42,7 @@ release = u'0.0.4' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', -] +extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode',] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -74,7 +69,7 @@ language = 'en' exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = None # -- Options for HTML output ------------------------------------------------- @@ -162,6 +157,24 @@ texinfo_documents = [ 'Miscellaneous'), ] + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + # -- Extension configuration ------------------------------------------------- # -- Options for intersphinx extension --------------------------------------- diff --git a/examples/robotchef/robotchef/main.py b/examples/robotchef/robotchef/main.py index c6de9bd..91f5947 100644 --- a/examples/robotchef/robotchef/main.py +++ b/examples/robotchef/robotchef/main.py @@ -2,9 +2,10 @@ import sys import logging import logging.config -from lml.loader import scan_plugins from robotchef.plugin import CuisineManager, NoChefException +from lml.loader import scan_plugins + logging.basicConfig( format="%(name)s:%(lineno)d - %(levelname)s - %(message)s", level=logging.DEBUG, diff --git a/examples/v2/robotchef_api/robotchef_api/__init__.py b/examples/v2/robotchef_api/robotchef_api/__init__.py index eaa7c53..1d83905 100644 --- a/examples/v2/robotchef_api/robotchef_api/__init__.py +++ b/examples/v2/robotchef_api/robotchef_api/__init__.py @@ -1,8 +1,5 @@ from lml.loader import scan_plugins -from robotchef_api.plugin import ( # noqa: F401 - CuisineManager, - NoChefException, -) +from robotchef_api.plugin import CuisineManager, NoChefException # noqa: F401 BUILTINS = ["robotchef_api.robot_cuisine"] diff --git a/setup.py b/setup.py index ef65f2f..997e3ad 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ URL = 'https://github.com/chfw/lml' DOWNLOAD_URL = '%s/archive/0.0.4.tar.gz' % URL FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ - 'python' + 'python', ] CLASSIFIERS = [ diff --git a/tests/test_plugin_info.py b/tests/test_plugin_info.py index 7a820f2..c81f4c7 100644 --- a/tests/test_plugin_info.py +++ b/tests/test_plugin_info.py @@ -1,7 +1,6 @@ import json from lml.plugin import PluginInfo - from nose.tools import eq_ diff --git a/tests/test_plugin_manager.py b/tests/test_plugin_manager.py index 2c0a86d..5b447c6 100644 --- a/tests/test_plugin_manager.py +++ b/tests/test_plugin_manager.py @@ -1,3 +1,4 @@ +from mock import patch from lml.plugin import ( PLUG_IN_MANAGERS, CACHED_PLUGIN_INFO, @@ -5,8 +6,6 @@ from lml.plugin import ( PluginManager, _show_me_your_name, ) - -from mock import patch from nose.tools import eq_, raises diff --git a/tests/test_utils.py b/tests/test_utils.py index d79adfe..e64211a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,7 +1,6 @@ +from mock import patch from lml.utils import do_import, json_dumps from lml.plugin import PluginManager - -from mock import patch from nose.tools import eq_ From 311b696f1a3ebca8dbce2fab9d24beba747fe5bc Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:16:51 +0000 Subject: [PATCH 08/13] :fire: ignore docs folder for style checking --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 100b35e..b8b24a3 100644 --- a/test.sh +++ b/test.sh @@ -1,2 +1,2 @@ pip freeze -nosetests --with-cov --cover-package lml --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source lml && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long +nosetests --with-cov --cover-package lml --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source lml && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long From a7a9f348806e168a6a946a9ba0ab6ec5475e5689 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:22:16 +0000 Subject: [PATCH 09/13] :bug: fix NameError: name 'ModuleNotFoundError' is not defined --- lml/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lml/utils.py b/lml/utils.py index a0d9995..d64c04b 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -12,6 +12,7 @@ import logging from json import JSONEncoder, dumps PY2 = sys.version_info[0] == 2 +PY36 = sys.version_info[0] == 3 and sys.version_info[1] >= 6 log = logging.getLogger(__name__) @@ -38,15 +39,15 @@ def json_dumps(keywords): def do_import(plugin_module_name): """dynamically import a module""" - if PY2: + if PY36: try: return _do_import(plugin_module_name) - except ImportError: + except (ImportError, ModuleNotFoundError): log.exception("failed to import %s", plugin_module_name) else: try: return _do_import(plugin_module_name) - except (ImportError, ModuleNotFoundError): + except ImportError: log.exception("failed to import %s", plugin_module_name) From 4cdfdd3b997aa1bc72f0d574d1d1b85f2fed73c7 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:25:15 +0000 Subject: [PATCH 10/13] :art: fix style warning, sigh --- lml/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lml/utils.py b/lml/utils.py index d64c04b..e9fc8b5 100644 --- a/lml/utils.py +++ b/lml/utils.py @@ -42,7 +42,7 @@ def do_import(plugin_module_name): if PY36: try: return _do_import(plugin_module_name) - except (ImportError, ModuleNotFoundError): + except (ImportError, ModuleNotFoundError): # noqa: F821 log.exception("failed to import %s", plugin_module_name) else: try: From 11f1919bee438275511555e310529153e427e0e3 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:27:52 +0000 Subject: [PATCH 11/13] :fire: getting rid of python 3.3 and :newspaper: include python 3.7 in test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e10065..972d9c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ language: python notifications: email: false python: + - 3.7-dev - 3.6 - 3.5 - 3.4 - - 3.3 - 2.7 - pypy before_install: From c90ac0b4b882179602c4ceda2ca176e6afe67903 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:31:45 +0000 Subject: [PATCH 12/13] :eggs: :ferris_wheel: release 0.0.5 --- .moban.d/test.sh.jj2 | 2 +- docs/source/conf.py | 4 ++-- lml.yml | 6 +++--- lml/_version.py | 2 +- setup.py | 12 +++++------- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.moban.d/test.sh.jj2 b/.moban.d/test.sh.jj2 index 7a2305e..708c9ca 100644 --- a/.moban.d/test.sh.jj2 +++ b/.moban.d/test.sh.jj2 @@ -10,7 +10,7 @@ {%endif%} {%endif%} pip freeze -nosetests --with-cov --cover-package {{package|lower}} --cover-package tests {%if not exclude_doctest%}--with-doctest --doctest-extension=.rst README.rst{%endif%} tests {%if not nodocs%}docs/source{%endif%} {%if not external_module_library%}{{package|lower}}{%endif%} && flake8 . --exclude=.moban.d {%block flake8_options%}--builtins=unicode,xrange,long{%endblock%} +nosetests --with-cov --cover-package {{package|lower}} --cover-package tests {%if not exclude_doctest%}--with-doctest --doctest-extension=.rst README.rst{%endif%} tests {%if not nodocs%}docs/source{%endif%} {%if not external_module_library%}{{package|lower}}{%endif%} && flake8 . --exclude=.moban.d,docs {%block flake8_options%}--builtins=unicode,xrange,long{%endblock%} {%block posttest%} {%endblock%} diff --git a/docs/source/conf.py b/docs/source/conf.py index 9d3ac4c..0ec7a42 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,9 +28,9 @@ copyright = u'2017-2018 Onni Software Ltd.' author = u'C.W.' # The short X.Y version -version = u'0.0.4' +version = u'0.0.5' # The full version, including alpha/beta/rc tags -release = u'0.0.4' +release = u'0.0.5' # -- General configuration --------------------------------------------------- diff --git a/lml.yml b/lml.yml index cc0368f..49373c6 100644 --- a/lml.yml +++ b/lml.yml @@ -4,9 +4,9 @@ organisation: "chfw" author: "C.W." contact: "wangc_2011@hotmail.com" company: "Onni Software Ltd." -version: "0.0.4" -current_version: "0.0.4" -release: "0.0.4" +version: "0.0.5" +current_version: "0.0.5" +release: "0.0.5" copyright_year: 2017-2018 license: New BSD dependencies: [] diff --git a/lml/_version.py b/lml/_version.py index b5e9002..21b9c1f 100644 --- a/lml/_version.py +++ b/lml/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.0.4" +__version__ = "0.0.5" __author__ = "C.W." diff --git a/setup.py b/setup.py index 997e3ad..72f8f68 100644 --- a/setup.py +++ b/setup.py @@ -5,22 +5,20 @@ import os import sys import codecs from shutil import rmtree - -from setuptools import Command, setup, find_packages - +from setuptools import setup, find_packages, Command PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 NAME = 'lml' AUTHOR = 'C.W.' -VERSION = '0.0.4' +VERSION = '0.0.5' EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'New BSD' DESCRIPTION = ( 'Load me later. A lazy plugin management system.' ) URL = 'https://github.com/chfw/lml' -DOWNLOAD_URL = '%s/archive/0.0.4.tar.gz' % URL +DOWNLOAD_URL = '%s/archive/0.0.5.tar.gz' % URL FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ 'python', @@ -48,8 +46,8 @@ EXTRAS_REQUIRE = {} # You do not need to read beyond this line PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( sys.executable) -GS_COMMAND = ('gs lml v0.0.4 ' + - "Find 0.0.4 in changelog for more details") +GS_COMMAND = ('gs lml v0.0.5 ' + + "Find 0.0.5 in changelog for more details") NO_GS_MESSAGE = ('Automatic github release is disabled. ' + 'Please install gease to enable it.') UPLOAD_FAILED_MSG = ( From 38f25dbd6ba4bb6817df1b28a4dbc00fb2469bdb Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 18:33:29 +0000 Subject: [PATCH 13/13] :books: update release date --- CHANGELOG.rst | 2 +- changelog.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8e954ea..8493832 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,7 +1,7 @@ Change log ================================================================================ -0.0.5 - unreleased +0.0.5 - 06/11/2018 -------------------------------------------------------------------------------- Fixed diff --git a/changelog.yml b/changelog.yml index 466f699..2b41253 100644 --- a/changelog.yml +++ b/changelog.yml @@ -5,7 +5,7 @@ releases: - action: Fixed details: - "`#6`: Catch and Ignore ModuleNotFoundError" - date: unreleased + date: 06/11/2018 version: 0.0.5 - changes: - action: Added