Skip to content

Commit 16cdee3

Browse files
committed
Refactor to use pip installation function from neon-utils
1 parent 35b7abb commit 16cdee3

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

neon_core/util/skill_utils.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434
from typing import List
3535

3636
from ovos_utils.xdg_utils import xdg_data_home
37-
from ovos_utils.log import LOG
37+
from ovos_utils.log import LOG, deprecated
3838

3939
from ovos_config.config import Configuration
4040

4141

42+
@deprecated("Internal function is deprecated", "25.09.01")
4243
def _write_pip_constraints_to_file(output_file: str):
4344
"""
4445
Writes out a constraints file for OSM to use to prevent broken dependencies
@@ -67,6 +68,7 @@ def _write_pip_constraints_to_file(output_file: str):
6768
LOG.info(f"Wrote core constraints to file: {output_file}")
6869

6970

71+
@deprecated("Internal function is deprecated", "25.09.01")
7072
def _install_skill_pip(skill_package: str, constraints_file: str) -> bool:
7173
"""
7274
Pip install the specified package
@@ -92,15 +94,8 @@ def install_skills_from_list(skills_to_install: list, config: dict = None):
9294
:param skills_to_install: list of skills to install
9395
:param config: optional dict configuration
9496
"""
95-
constraints_file = join(xdg_data_home(), "neon", "constraints.txt")
96-
_write_pip_constraints_to_file(constraints_file)
97-
98-
for spec in skills_to_install:
99-
if "://" in spec and "git+" not in spec:
100-
LOG.error(f"Got an invalid package spec to install: {spec}")
101-
elif not _install_skill_pip(spec, constraints_file):
102-
LOG.error(f"Pip installation failed for: {spec}")
103-
97+
from neon_utils.packaging_utils import install_packages_from_pip
98+
install_packages_from_pip("neon-core", skills_to_install, True)
10499
LOG.info(f"Installed {len(skills_to_install)} skills")
105100

106101

requirements/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
ovos-core[lgpl]~=0.1
33

44

5-
neon-utils[network]~=1.13,>=1.13.1a1
5+
#neon-utils[network]~=1.13,>=1.13.1a1
6+
neon-utils[network] @ git+https://github.com/neongeckocom/neon-utils@FEAT_PipInstallGitForce#egg=neon-utils
67
ovos-utils~=0.0,>=0.0.38
78
ovos-bus-client~=0.0,>=0.0.10
89
neon-transformers~=1.0

0 commit comments

Comments
 (0)