Open sleeptightAnsiC opened 6 months ago
Potential fix for 1. This already makes it work on Windows and Linux
diff --git a/ue4cli/PluginManager.py b/ue4cli/PluginManager.py
index e157394..8df7b13 100644
--- a/ue4cli/PluginManager.py
+++ b/ue4cli/PluginManager.py
@@ -1,5 +1,14 @@
from inspect import signature
-import pkg_resources
+from .Utility import Utility
+
+# HACK: dummy iter_entry_points in case package 'setuptools' hasn't been provided
+try:
+ from pkg_resources import iter_entry_points
+except ModuleNotFoundError as e:
+ Utility.printStderr(f'Warning: ue4cli plugins are unavailable due to: {str(e)}')
+ def iter_entry_points(unused):
+ return {}
+
class PluginManager:
"""
@@ -16,7 +25,7 @@ class PluginManager:
plugins = {
entry_point.name: entry_point.load()
for entry_point
- in pkg_resources.iter_entry_points('ue4cli.plugins')
+ in iter_entry_points('ue4cli.plugins')
}
# Filter out any invalid plugins
Looks like I missed this one during https://github.com/adamrehn/ue4cli/pull/59
ue4cli still depends on package outside of vanilla python and cannot be run directly from source without it:
For now, I only spotted
pkg_resources
(provided bysetuptools
) which is used in two places:pkg_resources.iter_entry_points
https://github.com/adamrehn/ue4cli/blob/fed71c1af4cffe3fed9358b08430068ad9454b77/ue4cli/PluginManager.py#L15-L20pkg_resources.parse_version
https://github.com/adamrehn/ue4cli/blob/fed71c1af4cffe3fed9358b08430068ad9454b77/ue4cli/UnrealManagerDarwin.py#L35-L47First one is tricky, we have to use it for loading ue4cli-plugins which is invoked in
ue4cli/cli.py
. Second one should be fairly easy to replace (I hope).TODO: I gotta make sure there is no more dependencies like this one and find good workaround for this. Perhaps we can
try; import pkg_resources:
and load ue4cli-plugins only if said dependency is resolved.Either way, I'll probably take this one :)