Switch python-msm sitemethod to git

This commit is contained in:
j1nx 2021-04-04 17:40:29 +02:00
parent e8b0bacf5f
commit ce7edd1827
5 changed files with 12 additions and 216 deletions

View File

@ -1,6 +1,6 @@
From 61a1116fc464df46bd934d45fc4a22dcfee52607 Mon Sep 17 00:00:00 2001
From: Peter Steenbergen <info@j1nx.nl>
Date: Sat, 21 Sep 2019 12:18:38 +0200
From b5bcb5856b858d9b359b87cd335606ba769e097c Mon Sep 17 00:00:00 2001
From: j1nx <p.steenbergen@j1nx.nl>
Date: Sun, 4 Apr 2021 17:35:47 +0200
Subject: [PATCH 1/1] Add OpenVoiceOS enclosure tag to SKILL_GROUPS
---
@ -8,19 +8,19 @@ Subject: [PATCH 1/1] Add OpenVoiceOS enclosure tag to SKILL_GROUPS
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/msm/mycroft_skills_manager.py b/msm/mycroft_skills_manager.py
index b36540e..327f1fc 100644
index 82500b4..e94e5e0 100644
--- a/msm/mycroft_skills_manager.py
+++ b/msm/mycroft_skills_manager.py
@@ -86,7 +86,8 @@ def save_device_skill_state(func):
@@ -88,7 +88,8 @@ def save_device_skill_state(func):
class MycroftSkillsManager(object):
SKILL_GROUPS = {'default', 'mycroft_mark_1', 'picroft', 'kde',
- 'respeaker', 'mycroft_mark_2', 'mycroft_mark_2pi'}
+ 'respeaker', 'mycroft_mark_2', 'mycroft_mark_2pi',
+ 'OpenVoiceOS'}
DEFAULT_SKILLS_DIR = "/opt/mycroft/skills"
+ 'OpenVoiceOS'}
def __init__(self, platform='default', skills_dir=None, repo=None,
def __init__(self, platform='default', old_skills_dir=None,
skills_dir=None, repo=None, versioned=True):
--
2.11.0
2.20.1

View File

@ -1,168 +0,0 @@
From ed8c1bae5f26f7327090ac56a6522c78a914e78c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85ke=20Forslund?= <ake.forslund@gmail.com>
Date: Mon, 28 Sep 2020 17:53:40 +0200
Subject: [PATCH 1/2] Only show the pako warning if it's used
---
msm/skill_entry.py | 44 ++++++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/msm/skill_entry.py b/msm/skill_entry.py
index 3170656..c64e666 100644
--- a/msm/skill_entry.py
+++ b/msm/skill_entry.py
@@ -327,6 +327,7 @@ def run_pip(self, constraints=None):
return True
def install_system_deps(self):
+ success = True
self.run_requirements_sh()
system_packages = {
exe: (packages or '').split()
@@ -334,26 +335,29 @@ def install_system_deps(self):
}
LOG.info('Installing system requirements...')
all_deps = system_packages.pop('all', [])
- try:
- manager = PakoManager()
- success = manager.install(all_deps, overrides=system_packages)
- except RuntimeError as e:
- LOG.warning('Failed to launch package manager: {}'.format(e))
- success = False
- missing_exes = [
- exe for exe in self.dependencies.get('exes') or []
- if not shutil.which(exe)
- ]
- if missing_exes:
- if not success:
- LOG.warning('Failed to install dependencies.')
- if all_deps:
- LOG.warning('Please install manually: {}'.format(
- ' '.join(all_deps)
- ))
- raise SkillRequirementsException('Could not find exes: {}'.format(
- ', '.join(missing_exes)
- ))
+ use_pako = bool(all_deps)
+ if use_pako: # Only try to install if there are packages to install
+ try:
+ manager = PakoManager()
+ success = manager.install(all_deps, overrides=system_packages)
+ except RuntimeError as e:
+ LOG.warning('Failed to launch package manager: {}'.format(e))
+ success = False
+ missing_exes = [
+ exe for exe in self.dependencies.get('exes') or []
+ if not shutil.which(exe)
+ ]
+ if missing_exes:
+ if use_pako:
+ # Pako was used and apparently failed.
+ LOG.warning('Failed to install dependencies.')
+ if all_deps:
+ LOG.warning('Please install manually: {}'.format(
+ ' '.join(all_deps)
+ ))
+ raise SkillRequirementsException(
+ 'Could not find exes: {}'.format(', '.join(missing_exes))
+ )
return success
def run_requirements_sh(self):
From d1cdbb40ed09f067f9fa9295ab6fca654f5f0fe1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85ke=20Forslund?= <ake.forslund@gmail.com>
Date: Tue, 29 Sep 2020 19:57:35 +0200
Subject: [PATCH 2/2] Move pako handling into function
---
msm/skill_entry.py | 63 ++++++++++++++++++++++++++++------------------
1 file changed, 38 insertions(+), 25 deletions(-)
diff --git a/msm/skill_entry.py b/msm/skill_entry.py
index c64e666..9268d41 100644
--- a/msm/skill_entry.py
+++ b/msm/skill_entry.py
@@ -57,6 +57,23 @@
FIVE_MINUTES = 300
+def _perform_pako_install(packages):
+ """Install the list of packagess using Pako.
+
+ Arguments:
+ packages (list): list of packages to install.
+ Returns:
+ (bool) True if install completed successfully, else False
+ """
+ try:
+ manager = PakoManager()
+ success = manager.install(packages, overrides=system_packages)
+ except RuntimeError as e:
+ LOG.warning('Failed to launch package manager: {}'.format(e))
+ success = False
+ return success
+
+
@contextmanager
def work_dir(directory):
old_dir = os.getcwd()
@@ -327,37 +344,33 @@ def run_pip(self, constraints=None):
return True
def install_system_deps(self):
- success = True
self.run_requirements_sh()
system_packages = {
exe: (packages or '').split()
for exe, packages in self.dependent_system_packages.items()
}
LOG.info('Installing system requirements...')
- all_deps = system_packages.pop('all', [])
- use_pako = bool(all_deps)
- if use_pako: # Only try to install if there are packages to install
- try:
- manager = PakoManager()
- success = manager.install(all_deps, overrides=system_packages)
- except RuntimeError as e:
- LOG.warning('Failed to launch package manager: {}'.format(e))
- success = False
- missing_exes = [
- exe for exe in self.dependencies.get('exes') or []
- if not shutil.which(exe)
- ]
- if missing_exes:
- if use_pako:
- # Pako was used and apparently failed.
- LOG.warning('Failed to install dependencies.')
- if all_deps:
- LOG.warning('Please install manually: {}'.format(
- ' '.join(all_deps)
- ))
- raise SkillRequirementsException(
- 'Could not find exes: {}'.format(', '.join(missing_exes))
- )
+ packages = system_packages.pop('all', [])
+ if packages: # Only try to install if there are packages to install
+ success = _perform_pako_install(packages)
+ else:
+ success = True # No packages to install
+
+ missing_exes = [
+ exe for exe in self.dependencies.get('exes') or []
+ if not shutil.which(exe)
+ ]
+ # If executables are missing on the system inform of the issue.
+ if missing_exes:
+ # Pako was used and apparently failed.
+ LOG.warning('Failed to install dependencies.')
+ if packages:
+ LOG.warning('Please install manually: {}'.format(
+ ' '.join(all_deps)
+ ))
+ raise SkillRequirementsException(
+ 'Could not find exes: {}'.format(', '.join(missing_exes))
+ )
return success
def run_requirements_sh(self):

View File

@ -1,32 +0,0 @@
From 89782d56ed0fa1b63fef350520abea59c79bf283 Mon Sep 17 00:00:00 2001
From: j1nx <p.steenbergen@j1nx.nl>
Date: Mon, 14 Sep 2020 16:38:58 +0200
Subject: [PATCH 1/1] Remove "sudo" pip logic and change to --user by default
---
msm/skill_entry.py | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/msm/skill_entry.py b/msm/skill_entry.py
index 3170656..ec78609 100644
--- a/msm/skill_entry.py
+++ b/msm/skill_entry.py
@@ -295,14 +295,10 @@ class SkillEntry(object):
constraints = DEFAULT_CONSTRAINTS
LOG.info('Installing requirements.txt for ' + self.name)
- can_pip = os.access(dirname(sys.executable), os.W_OK | os.X_OK)
- pip_args = [sys.executable, '-m', 'pip', 'install']
+ pip_args = [sys.executable, '-m', 'pip', 'install', '--user']
if constraints:
pip_args += ['-c', constraints]
- if not can_pip:
- pip_args = ['sudo', '-n'] + pip_args
-
with self.pip_lock:
"""
Iterate over the individual Python packages and
--
2.20.1

View File

@ -1,5 +1,2 @@
# md5, sha256 from https://pypi.org/pypi/msm/json
md5 fe54a2aecd6751bef66fdcd27ffd3cdc msm-0.5.19.tar.gz
sha256 a502aee54917cd394217b31c977a1ba3d9541a0120e0a045c49fd77b328e4a29 msm-0.8.8.tar.gz
# Locally computed sha256 checksums
sha256 a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9 LICENSE
sha256 e477db375f85a1431a0cde4d2f5696a77e7a2aecfdbae4b2b2b57083f1190698 python-msm-825e910a555e1882999647d226a56734a7b75ea4.tar.gz

View File

@ -4,9 +4,8 @@
#
################################################################################
PYTHON_MSM_VERSION = 0.8.8
PYTHON_MSM_SOURCE = msm-$(PYTHON_MSM_VERSION).tar.gz
PYTHON_MSM_SITE = https://files.pythonhosted.org/packages/7e/42/66f2d39be2767b064d0c384b764ef18aae11344e618287f40fea5c84c866
PYTHON_MSM_VERSION = 825e910a555e1882999647d226a56734a7b75ea4
PYTHON_MSM_SITE = $(call github,MycroftAI,mycroft-skills-manager,$(PYTHON_MSM_VERSION))
PYTHON_MSM_SETUP_TYPE = setuptools
PYTHON_MSM_LICENSE = Apache-2.0
PYTHON_MSM_LICENSE_FILES = LICENSE