mirror of
https://github.com/clearml/clearml-agent
synced 2025-01-31 09:06:52 +00:00
Fix optional priority packaged always compare lower case package name
This commit is contained in:
parent
d9856d5de5
commit
f66e42ddb1
@ -16,10 +16,10 @@ class PriorityPackageRequirement(SimpleSubstitution):
|
|||||||
# check if we need to replace the packages:
|
# check if we need to replace the packages:
|
||||||
priority_packages = self.config.get('agent.package_manager.priority_packages', None)
|
priority_packages = self.config.get('agent.package_manager.priority_packages', None)
|
||||||
if priority_packages:
|
if priority_packages:
|
||||||
self.__class__.name = priority_packages
|
self.__class__.name = [p.lower() for p in priority_packages]
|
||||||
priority_optional_packages = self.config.get('agent.package_manager.priority_optional_packages', None)
|
priority_optional_packages = self.config.get('agent.package_manager.priority_optional_packages', None)
|
||||||
if priority_optional_packages:
|
if priority_optional_packages:
|
||||||
self.__class__.optional_package_names = priority_optional_packages
|
self.__class__.optional_package_names = [p.lower() for p in priority_optional_packages]
|
||||||
|
|
||||||
def match(self, req):
|
def match(self, req):
|
||||||
# match both Cython & cython
|
# match both Cython & cython
|
||||||
@ -32,7 +32,7 @@ class PriorityPackageRequirement(SimpleSubstitution):
|
|||||||
"""
|
"""
|
||||||
self._replaced_packages[req.name] = req.line
|
self._replaced_packages[req.name] = req.line
|
||||||
|
|
||||||
if req.name in self.optional_package_names:
|
if req.name.lower() in self.optional_package_names:
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
if PackageManager.out_of_scope_install_package(str(req)):
|
if PackageManager.out_of_scope_install_package(str(req)):
|
||||||
|
Loading…
Reference in New Issue
Block a user