commit python-msk for openSUSE:Factory
Hello community, here is the log from the commit of package python-msk for openSUSE:Factory checked in at 2018-11-29 22:58:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-msk (Old) and /work/SRC/openSUSE:Factory/.python-msk.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-msk" Thu Nov 29 22:58:54 2018 rev:3 rq:651669 version:0.3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/python-msk/python-msk.changes 2018-11-06 14:30:44.849344489 +0100 +++ /work/SRC/openSUSE:Factory/.python-msk.new.19453/python-msk.changes 2018-11-29 22:58:58.535611779 +0100 @@ -1,0 +2,11 @@ +Sun Nov 25 19:04:18 UTC 2018 - Antonio Larrosa <alarrosa@suse.com> + +- Update to msk 0.3.12 + * Support locale folder + * Add upload description from about + * Fix issue with spaces in filenames in add_to_repo + * Add submit action with upload and upgrade aliases +- Drop fix-dependencies.patch and replace it with a sed call since + otherwise the patch has to be fixed for every version update. + +------------------------------------------------------------------- Old: ---- fix-dependencies.patch msk-0.3.11.tar.gz New: ---- msk-0.3.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-msk.spec ++++++ --- /var/tmp/diff_new_pack.Ve0skC/_old 2018-11-29 22:58:59.479610615 +0100 +++ /var/tmp/diff_new_pack.Ve0skC/_new 2018-11-29 22:58:59.479610615 +0100 @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-msk -Version: 0.3.11 +Version: 0.3.12 Release: 0 Summary: Mycroft Skills Kit License: Apache-2.0 @@ -27,7 +27,6 @@ URL: https://github.com/MycroftAI/mycroft-skills-kit Source: https://files.pythonhosted.org/packages/source/m/msk/msk-%{version}.tar.gz Source99: https://raw.githubusercontent.com/MycroftAI/mycroft-skills-kit/master/LICENS... -Patch0: fix-dependencies.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -45,7 +44,7 @@ %prep %setup -q -n msk-%{version} -%patch0 -p1 +sed -i -e "s/\(install_requires.*\)'typing',/\1/" setup.py cp %{SOURCE99} . %build ++++++ msk-0.3.11.tar.gz -> msk-0.3.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/PKG-INFO new/msk-0.3.12/PKG-INFO --- old/msk-0.3.11/PKG-INFO 2018-08-28 15:43:05.000000000 +0200 +++ new/msk-0.3.12/PKG-INFO 2018-11-21 12:15:12.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: msk -Version: 0.3.11 +Version: 0.3.12 Summary: Mycroft Skills Kit Home-page: https://github.com/MycroftAI/mycroft-skills-kit Author: Mycroft AI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/__init__.py new/msk-0.3.12/msk/__init__.py --- old/msk-0.3.11/msk/__init__.py 2018-08-27 08:43:07.000000000 +0200 +++ new/msk-0.3.12/msk/__init__.py 2018-11-21 12:10:51.000000000 +0100 @@ -19,4 +19,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -__version__ = '0.3.10' # Also update in setup.py +__version__ = '0.3.12' # Also update in setup.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/__main__.py new/msk-0.3.12/msk/__main__.py --- old/msk-0.3.11/msk/__main__.py 2018-08-28 13:15:50.000000000 +0200 +++ new/msk-0.3.12/msk/__main__.py 2018-11-21 12:10:51.000000000 +0100 @@ -26,16 +26,14 @@ from msk.actions.create import CreateAction from msk.actions.create_test import CreateTestAction -from msk.actions.upgrade import UpgradeAction -from msk.actions.upload import UploadAction +from msk.actions.submit import SubmitAction from msk.exceptions import MskException from msk.global_context import GlobalContext -console_actions = { - 'upgrade': UpgradeAction, - 'upload': UploadAction, - 'create': CreateAction, - 'create-test': CreateTestAction +action_names = { + SubmitAction: ['submit', 'update', 'upgrade', 'upload'], + CreateAction: ['create'], + CreateTestAction: ['create-test'] } @@ -50,8 +48,10 @@ subparsers = parser.add_subparsers(dest='action') subparsers.required = True - for action, cls in console_actions.items(): - cls.register(subparsers.add_parser(action)) + action_to_cls = {} + for cls, names in action_names.items(): + cls.register(subparsers.add_parser(names[0], aliases=names[1:])) + action_to_cls.update({name: cls for name in names}) args = parser.parse_args(sys.argv[1:]) @@ -64,7 +64,7 @@ context.branch = context.msm.repo.branch try: - return console_actions[args.action](args).perform() + return action_to_cls[args.action](args).perform() except MskException as e: print('{}: {}'.format(e.__class__.__name__, str(e))) except (KeyboardInterrupt, EOFError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/actions/create_test.py new/msk-0.3.12/msk/actions/create_test.py --- old/msk-0.3.11/msk/actions/create_test.py 2018-08-27 08:43:07.000000000 +0200 +++ new/msk-0.3.12/msk/actions/create_test.py 2018-11-21 12:10:51.000000000 +0100 @@ -126,8 +126,8 @@ for i in read_lines(content_file) ))) for content_file in - glob(join(self.folder, 'vocab', self.lang, '*.voc')) + - glob(join(self.folder, 'regex', self.lang, '*.rx')) + glob(join(self.folder, 'vocab', self.lang, '*.voc')) + glob(join(self.folder, 'locale', self.lang, '*.voc')) + + glob(join(self.folder, 'regex', self.lang, '*.rx')) + glob(join(self.folder, 'locale', self.lang, '*.rx')) } @Lazy @@ -188,15 +188,16 @@ class PadatiousTestCreator(TestCreator): - intent_files = Lazy(lambda s: glob(join(s.folder, 'vocab', s.lang, '*.intent'))) + intent_files = Lazy(lambda s: glob(join(s.folder, 'vocab', s.lang, '*.intent')) + glob(join(s.folder, 'locale', s.lang, '*.intent'))) intent_names = Lazy(lambda s: { basename(intent_file): intent_file for intent_file in s.intent_files }) intent_file = Lazy(lambda s: s.intent_names.get(s.intent_name, '')) entities = Lazy(lambda s: { splitext(basename(entity_file))[0]: read_lines(entity_file) - for entity_file in glob(join(s.folder, 'vocab', s.lang, '*.entity')) + for entity_file in glob(join(s.folder, 'vocab', s.lang, '*.entity')) + glob(join(s.folder, 'locale', s.lang, '*.entity')) }) + intent_lines = Lazy(lambda s: read_lines(s.intent_file)) entity_names = Lazy(lambda s: set(re.findall(r'(?<={)[a-z_]+(?=})', '\n'.join(s.intent_lines)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/actions/submit.py new/msk-0.3.12/msk/actions/submit.py --- old/msk-0.3.11/msk/actions/submit.py 1970-01-01 01:00:00.000000000 +0100 +++ new/msk-0.3.12/msk/actions/submit.py 2018-11-21 12:10:51.000000000 +0100 @@ -0,0 +1,21 @@ +from argparse import ArgumentParser + +from msk.actions.upgrade import UpgradeAction +from msk.actions.upload import UploadAction +from msk.console_action import ConsoleAction +from msk.exceptions import NotUploaded + + +class SubmitAction(ConsoleAction): + def __init__(self, args): + try: + self.action = UpgradeAction(args) + except NotUploaded: + self.action = UploadAction(args) + + @staticmethod + def register(parser: ArgumentParser): + parser.add_argument('skill_folder') + + def perform(self): + self.action.perform() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/actions/upgrade.py new/msk-0.3.12/msk/actions/upgrade.py --- old/msk-0.3.11/msk/actions/upgrade.py 2018-08-28 13:15:50.000000000 +0200 +++ new/msk-0.3.12/msk/actions/upgrade.py 2018-11-21 12:10:51.000000000 +0100 @@ -50,10 +50,11 @@ raise NotUploaded('Skill at folder not uploaded to store: {}'.format(args.skill_folder)) self.skill = SkillData(skill_matches[0]) + self.skill.init_existing() # Verifies the skill exists @staticmethod def register(parser: ArgumentParser): - parser.add_argument('skill_folder') + pass # Implemented in SubmitAction def create_pr_message(self, skill_git: Git, skill_repo: Repository) -> tuple: """Reads git commits from skill repo to create a list of changes as the PR content""" @@ -73,7 +74,7 @@ return title, body def perform(self): - self.skill.init_existing() + print('Upgrading an existing skill in the skill repo...') upgrade_branch = self.skill.upgrade() self.repo.push_to_fork(upgrade_branch) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/actions/upload.py new/msk-0.3.12/msk/actions/upload.py --- old/msk-0.3.11/msk/actions/upload.py 2018-08-28 13:15:50.000000000 +0200 +++ new/msk-0.3.12/msk/actions/upload.py 2018-11-21 12:10:51.000000000 +0100 @@ -61,9 +61,10 @@ @staticmethod def register(parser: ArgumentParser): - parser.add_argument('skill_folder') + pass # Implemented in SubmitAction def perform(self): + print('Uploading a new skill to the skill repo...') for i in listdir(self.entry.path): if i.lower() == 'readme.md' and i != 'README.md': shutil.move(join(self.entry.path, i), join(self.entry.path, 'README.md')) @@ -104,13 +105,16 @@ sections[last_section] += '\n' + line del sections[None] - if 'description' in sections: + if 'about' in sections: + description = sections['about'] + elif 'description' in sections: description = sections['description'] else: - description = ask_choice( + choice = ask_choice( 'Which section contains the description?', list(sections), on_empty='Please create a description section in the README' ) + description = sections[choice] branch = SkillData(self.entry).add_to_repo() self.repo.push_to_fork(branch) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk/repo_action.py new/msk-0.3.12/msk/repo_action.py --- old/msk-0.3.11/msk/repo_action.py 2018-08-28 13:15:50.000000000 +0200 +++ new/msk-0.3.12/msk/repo_action.py 2018-11-21 12:10:51.000000000 +0100 @@ -96,8 +96,8 @@ def add_to_repo(self) -> str: self.repo.msminfo.update() - elements = [i.split() for i in self.git.ls_tree('HEAD').split('\n')] - existing_mods = [folder for size, typ, sha, folder in elements] + existing_mods = [i.split('\t')[1] + for i in self.git.ls_tree('HEAD').split('\n')] if self.name not in existing_mods: self.repo.git.submodule('add', self.entry.url, self.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk.egg-info/PKG-INFO new/msk-0.3.12/msk.egg-info/PKG-INFO --- old/msk-0.3.11/msk.egg-info/PKG-INFO 2018-08-28 15:43:04.000000000 +0200 +++ new/msk-0.3.12/msk.egg-info/PKG-INFO 2018-11-21 12:15:12.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: msk -Version: 0.3.11 +Version: 0.3.12 Summary: Mycroft Skills Kit Home-page: https://github.com/MycroftAI/mycroft-skills-kit Author: Mycroft AI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/msk.egg-info/SOURCES.txt new/msk-0.3.12/msk.egg-info/SOURCES.txt --- old/msk-0.3.11/msk.egg-info/SOURCES.txt 2018-08-28 15:43:05.000000000 +0200 +++ new/msk-0.3.12/msk.egg-info/SOURCES.txt 2018-11-21 12:15:12.000000000 +0100 @@ -16,5 +16,6 @@ msk.egg-info/top_level.txt msk/actions/create.py msk/actions/create_test.py +msk/actions/submit.py msk/actions/upgrade.py msk/actions/upload.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/msk-0.3.11/setup.py new/msk-0.3.12/setup.py --- old/msk-0.3.11/setup.py 2018-08-28 13:15:50.000000000 +0200 +++ new/msk-0.3.12/setup.py 2018-11-21 12:10:51.000000000 +0100 @@ -23,7 +23,7 @@ setup( name='msk', - version='0.3.11', # Also update in msk/__init__.py + version='0.3.12', # Also update in msk/__init__.py packages=['msk', 'msk.actions'], install_requires=['GitPython', 'typing', 'msm>=0.5.13', 'pygithub'], url='https://github.com/MycroftAI/mycroft-skills-kit',
participants (1)
-
root