diff --git a/plugins/python-codecs/.vscode/settings.json b/plugins/python-codecs/.vscode/settings.json index 12a19c4a1..bb391aee8 100644 --- a/plugins/python-codecs/.vscode/settings.json +++ b/plugins/python-codecs/.vscode/settings.json @@ -5,8 +5,8 @@ // "scrypted.serverRoot": "/server", // lxc installation - "scrypted.debugHost": "scrypted-server", - "scrypted.serverRoot": "/root/.scrypted", + // "scrypted.debugHost": "scrypted-server", + // "scrypted.serverRoot": "/root/.scrypted", // windows installation // "scrypted.debugHost": "koushik-windows", @@ -17,8 +17,8 @@ // "scrypted.serverRoot": "/home/pi/.scrypted", // local checkout - // "scrypted.debugHost": "127.0.0.1", - // "scrypted.serverRoot": "/Users/koush/.scrypted", + "scrypted.debugHost": "127.0.0.1", + "scrypted.serverRoot": "/Users/koush/.scrypted", "scrypted.pythonRemoteRoot": "${config:scrypted.serverRoot}/volume/plugin.zip", "python.analysis.extraPaths": [ diff --git a/plugins/python-codecs/src/requirements.optional.txt b/plugins/python-codecs/src/requirements.optional.txt new file mode 100644 index 000000000..812d5c80a --- /dev/null +++ b/plugins/python-codecs/src/requirements.optional.txt @@ -0,0 +1,6 @@ +# gobject instrospection for gstreamer. +PyGObject>=3.30.4; sys_platform != 'win32' + +# pyvips is not available on windows, and is preinstalled as part of the installer scripts on +# mac and linux. +pyvips; sys_platform != 'win32' diff --git a/plugins/python-codecs/src/requirements.txt b/plugins/python-codecs/src/requirements.txt index 5ea5256b2..00ba2aeaf 100644 --- a/plugins/python-codecs/src/requirements.txt +++ b/plugins/python-codecs/src/requirements.txt @@ -1,15 +1,7 @@ # needed by libav to_ndarray numpy>=1.16.2 -# gobject instrospection for gstreamer. -PyGObject>=3.30.4; sys_platform != 'win32' - -# libav doesnt work on arm7 -av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64' - -# pyvips is not available on windows, and is preinstalled as part of the installer scripts on -# mac and linux. -pyvips; sys_platform != 'win32' +av>=10.0.0 # in case pyvips fails to load, use a pillow fallback. # pillow for anything not intel linux, pillow-simd is available on x64 linux diff --git a/server/package-lock.json b/server/package-lock.json index 62062461b..f0e5717d7 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/server", - "version": "0.94.5", + "version": "0.94.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/server", - "version": "0.94.5", + "version": "0.94.6", "license": "ISC", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.11", diff --git a/server/python/plugin_remote.py b/server/python/plugin_remote.py index dc6d77390..89b08ace6 100644 --- a/server/python/plugin_remote.py +++ b/server/python/plugin_remote.py @@ -41,7 +41,7 @@ import rpc import rpc_reader -OPTIONAL_REQUIREMENTS = """ +SCRYPTED_REQUIREMENTS = """ ptpython """.strip() @@ -574,25 +574,33 @@ class PluginRemote: if not os.path.exists(python_prefix): os.makedirs(python_prefix) - str_requirements = "" - if 'requirements.txt' in zip.namelist(): - str_requirements = zip.open('requirements.txt').read().decode('utf8') - optional_requirements_basename = os.path.join( - python_prefix, 'requirements.optional') + def read_requirements(filename: str) -> str: + if filename in zip.namelist(): + return zip.open(filename).read().decode('utf8') + return '' + + str_requirements = read_requirements('requirements.txt') + str_optional_requirements = read_requirements('requirements.optional.txt') + + scrypted_requirements_basename = os.path.join( + python_prefix, 'requirements.scrypted') requirements_basename = os.path.join( python_prefix, 'requirements') + optional_requirements_basename = os.path.join( + python_prefix, 'requirements.optional') need_pip = True if str_requirements: need_pip = need_requirements(requirements_basename, str_requirements) if not need_pip: - need_pip = need_requirements(optional_requirements_basename, OPTIONAL_REQUIREMENTS) + need_pip = need_requirements(scrypted_requirements_basename, SCRYPTED_REQUIREMENTS) if need_pip: remove_pip_dirs(plugin_volume) - install_with_pip(python_prefix, packageJson, OPTIONAL_REQUIREMENTS, optional_requirements_basename, ignore_error=True) + install_with_pip(python_prefix, packageJson, SCRYPTED_REQUIREMENTS, scrypted_requirements_basename, ignore_error=True) install_with_pip(python_prefix, packageJson, str_requirements, requirements_basename, ignore_error=False) + install_with_pip(python_prefix, packageJson, str_optional_requirements, optional_requirements_basename, ignore_error=True) else: print('requirements.txt (up to date)') print(str_requirements)