2023.11.0: it doesn't detect zm-py installed (via emerge) package #2363

Closed
opened 2023-11-03 09:32:24 +01:00 by CyberGuerro · 4 comments

After I had to recompile zm-py package (rebuild, no upgrade/downgrade) and restarted homeassistant, it seems that HA doesen't detect installed package (via emerge) and accordingly it try to install via pip which inform to install package via emerge (as it is).

Below compilation output:

 emerge -1 zm-py
Calculating dependencies... done!
Dependency resolution took 1.41 s.


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository
 * zm-py-0.5.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                             [ ok ]
>>> Unpacking source...
>>> Unpacking zm-py-0.5.2.tar.gz to /var/tmp/portage/dev-python/zm-py-0.5.2/work
>>> Source unpacked in /var/tmp/portage/dev-python/zm-py-0.5.2/work
>>> Preparing source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ...
 * ==================================================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying run_state_active.patch ...                                                                                                                                        [ ok ]
 * User patches applied.
 * ==================================================================================================================================================================================
 * Build system packages:
 *   dev-python/gpep517            : 15
 *   dev-python/installer          : 0.7.0
 *   dev-python/poetry-core        : 1.7.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 * poetry.masonry.api backend is deprecated.  Please see:
 * https://projects.gentoo.org/python/guide/qawarn.html#deprecated-pep-517-backends
 * The eclass will be using poetry.core.masonry.api instead.
 *   Building the wheel for zm-py-0.5.2 via poetry.core.masonry.api
gpep517 build-wheel --prefix=/usr --backend poetry.core.masonry.api --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel
2023-11-03 09:43:22,966 gpep517 INFO Building wheel via backend poetry.core.masonry.api
2023-11-03 09:43:23,101 poetry.core.masonry.builders.wheel INFO Building wheel
fatal: not a git repository (or any of the parent directories): .git
2023-11-03 09:43:23,112 poetry.core.masonry.builders.wheel INFO Built zm_py-0.1.0-py3-none-any.whl
2023-11-03 09:43:23,112 gpep517 INFO The backend produced /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl
 *   Installing zm_py-0.1.0-py3-none-any.whl to /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install
gpep517 install-wheel --destdir=/var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install --interpreter=/usr/bin/python3.11 --prefix=/usr --optimize=all /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl
2023-11-03 09:43:23,200 gpep517 INFO Installing /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl into /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install
2023-11-03 09:43:23,213 gpep517 INFO Installation complete
>>> Source compiled.
 * Skipping make test/check due to ebuild restriction.
>>> Test phase [disabled because of RESTRICT=test]: dev-python/zm-py-0.5.2

>>> Install dev-python/zm-py-0.5.2 into /var/tmp/portage/dev-python/zm-py-0.5.2/image
 * python3_11: running distutils-r1_run_phase distutils-r1_python_install
 * Using python3.11 in global scope
 * python3_11: running distutils-r1_run_phase distutils-r1_python_install_all
>>> Completed installing dev-python/zm-py-0.5.2 into /var/tmp/portage/dev-python/zm-py-0.5.2/image

 * Final size of build directory: 172 KiB
 * Final size of installed tree:  216 KiB


>>> Installing (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository

>>> Completed (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository

 * GNU info directory index is up-to-date.

Excluding patch applying (I created it some month ago to fix an issue on run-state) I noticed this line:

* python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 * poetry.masonry.api backend is deprecated.  Please see:
 * https://projects.gentoo.org/python/guide/qawarn.html#deprecated-pep-517-backends
 * The eclass will be using poetry.core.masonry.api instead.
 *   Building the wheel for zm-py-0.5.2 via poetry.core.masonry.api
gpep517 build-wheel --prefix=/usr --backend poetry.core.masonry.api --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel
2023-11-03 09:43:22,966 gpep517 INFO Building wheel via backend poetry.core.masonry.api
2023-11-03 09:43:23,101 poetry.core.masonry.builders.wheel INFO Building wheel
fatal: not a git repository (or any of the parent directories): .git
2023-11-03 09:43:23,112 poetry.core.masonry.builders.wheel INFO Built zm_py-0.1.0-py3-none-any.whl
2023-11-03 09:43:23,112 gpep517 INFO The backend produced /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl

in particular

fatal: not a git repository (or any of the parent directories): .git

I don't know if it is the problem. What is strange is that package seems to be installed correctly, but HA doesn't detect and try to install it by itself through pip (which return error because require to install through "emerge"

After I had to recompile **zm-py** package (rebuild, no upgrade/downgrade) and restarted homeassistant, it seems that HA doesen't detect installed package (via emerge) and accordingly it try to install via pip which inform to install package via emerge (as it is). Below compilation output: ``` emerge -1 zm-py Calculating dependencies... done! Dependency resolution took 1.41 s. >>> Verifying ebuild manifests >>> Emerging (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository * zm-py-0.5.2.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking zm-py-0.5.2.tar.gz to /var/tmp/portage/dev-python/zm-py-0.5.2/work >>> Source unpacked in /var/tmp/portage/dev-python/zm-py-0.5.2/work >>> Preparing source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ... * ================================================================================================================================================================================== * Applying user patches from /etc/portage/patches ... * Applying run_state_active.patch ... [ ok ] * User patches applied. * ================================================================================================================================================================================== * Build system packages: * dev-python/gpep517 : 15 * dev-python/installer : 0.7.0 * dev-python/poetry-core : 1.7.0 >>> Source prepared. >>> Configuring source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2 ... * python3_11: running distutils-r1_run_phase distutils-r1_python_compile * poetry.masonry.api backend is deprecated. Please see: * https://projects.gentoo.org/python/guide/qawarn.html#deprecated-pep-517-backends * The eclass will be using poetry.core.masonry.api instead. * Building the wheel for zm-py-0.5.2 via poetry.core.masonry.api gpep517 build-wheel --prefix=/usr --backend poetry.core.masonry.api --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel 2023-11-03 09:43:22,966 gpep517 INFO Building wheel via backend poetry.core.masonry.api 2023-11-03 09:43:23,101 poetry.core.masonry.builders.wheel INFO Building wheel fatal: not a git repository (or any of the parent directories): .git 2023-11-03 09:43:23,112 poetry.core.masonry.builders.wheel INFO Built zm_py-0.1.0-py3-none-any.whl 2023-11-03 09:43:23,112 gpep517 INFO The backend produced /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl * Installing zm_py-0.1.0-py3-none-any.whl to /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install gpep517 install-wheel --destdir=/var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install --interpreter=/usr/bin/python3.11 --prefix=/usr --optimize=all /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl 2023-11-03 09:43:23,200 gpep517 INFO Installing /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl into /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/install 2023-11-03 09:43:23,213 gpep517 INFO Installation complete >>> Source compiled. * Skipping make test/check due to ebuild restriction. >>> Test phase [disabled because of RESTRICT=test]: dev-python/zm-py-0.5.2 >>> Install dev-python/zm-py-0.5.2 into /var/tmp/portage/dev-python/zm-py-0.5.2/image * python3_11: running distutils-r1_run_phase distutils-r1_python_install * Using python3.11 in global scope * python3_11: running distutils-r1_run_phase distutils-r1_python_install_all >>> Completed installing dev-python/zm-py-0.5.2 into /var/tmp/portage/dev-python/zm-py-0.5.2/image * Final size of build directory: 172 KiB * Final size of installed tree: 216 KiB >>> Installing (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository >>> Completed (1 of 1) dev-python/zm-py-0.5.2::HomeAssistantRepository * GNU info directory index is up-to-date. ``` Excluding patch applying (I created it some month ago to fix an issue on run-state) I noticed this line: ``` * python3_11: running distutils-r1_run_phase distutils-r1_python_compile * poetry.masonry.api backend is deprecated. Please see: * https://projects.gentoo.org/python/guide/qawarn.html#deprecated-pep-517-backends * The eclass will be using poetry.core.masonry.api instead. * Building the wheel for zm-py-0.5.2 via poetry.core.masonry.api gpep517 build-wheel --prefix=/usr --backend poetry.core.masonry.api --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel 2023-11-03 09:43:22,966 gpep517 INFO Building wheel via backend poetry.core.masonry.api 2023-11-03 09:43:23,101 poetry.core.masonry.builders.wheel INFO Building wheel fatal: not a git repository (or any of the parent directories): .git 2023-11-03 09:43:23,112 poetry.core.masonry.builders.wheel INFO Built zm_py-0.1.0-py3-none-any.whl 2023-11-03 09:43:23,112 gpep517 INFO The backend produced /var/tmp/portage/dev-python/zm-py-0.5.2/work/zm-py-0.5.2-python3_11/wheel/zm_py-0.1.0-py3-none-any.whl ``` in particular `fatal: not a git repository (or any of the parent directories): .git` I don't know if it is the problem. What is strange is that package seems to be installed correctly, but HA doesn't detect and try to install it by itself through pip (which return error because require to install through "emerge"
Owner

can you do a
ls -la /usr/lib/python3.11/site-packages/ | grep zm

can you do a `ls -la /usr/lib/python3.11/site-packages/ | grep zm`
onkelbeh added the Bug label 2023-11-03 09:37:26 +01:00
Owner

THis is another viction of dynamic versioning, unnoticed because this one used "0.1.0" as placeholder.

THis is another viction of dynamic versioning, unnoticed because this one used "0.1.0" as placeholder.
Author

Ok, thank you, meanwhile I've create a patch to fix the issue without modify package:

--- zm-py-0.5.2.original/pyproject.toml	2023-11-03 14:12:53.791713062 +0100
+++ zm-py-0.5.2/pyproject.toml	2023-11-03 14:13:21.706711486 +0100
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "zm-py"
-version = "0.1.0"
+version = "0.5.2"
 description = ""
 authors = ["Rohan Kapoor <rohan@rohankapoor.com>"]
 license = "Apache-2.0"

BUT I THINK THAT YOUR FIX IS BETTER :-)

There is another patch to apply to get it working the code (issue about the run state) here is the code:

--- zm-py-0.5.2.original/zoneminder/run_state.py	2020-10-04 04:09:07.000000000 +0200
+++ zm-py-0.5.2/zoneminder/run_state.py	2023-09-17 12:02:48.117665957 +0200
@@ -29,8 +29,7 @@
         for state in states:
             state = state["State"]
             if int(state["Id"]) == self._state_id:
-                # yes, the ZM API uses the *string* "1" for this...
-                return state["IsActive"] == "1"
+                return state["IsActive"] == 1
         return False
 
     def activate(self):

If you want to create r2 and insert the last one patch, feel free to use the above code :-)

thank you

Ok, thank you, meanwhile I've create a patch to fix the issue without modify package: ``` --- zm-py-0.5.2.original/pyproject.toml 2023-11-03 14:12:53.791713062 +0100 +++ zm-py-0.5.2/pyproject.toml 2023-11-03 14:13:21.706711486 +0100 @@ -1,6 +1,6 @@ [tool.poetry] name = "zm-py" -version = "0.1.0" +version = "0.5.2" description = "" authors = ["Rohan Kapoor <rohan@rohankapoor.com>"] license = "Apache-2.0" ``` **BUT I THINK THAT YOUR FIX IS BETTER :-)** There is another patch to apply to get it working the code (issue about the run state) here is the code: ``` --- zm-py-0.5.2.original/zoneminder/run_state.py 2020-10-04 04:09:07.000000000 +0200 +++ zm-py-0.5.2/zoneminder/run_state.py 2023-09-17 12:02:48.117665957 +0200 @@ -29,8 +29,7 @@ for state in states: state = state["State"] if int(state["Id"]) == self._state_id: - # yes, the ZM API uses the *string* "1" for this... - return state["IsActive"] == "1" + return state["IsActive"] == 1 return False def activate(self): ``` If you want to create **r2** and insert the last one patch, feel free to use the above code :-) thank you
Owner

Thanks, the second patch should be reported upstream.

Thanks, the second patch should be reported upstream.
Sign in to join this conversation.
No labels Bug
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onkelbeh/HomeAssistantRepository#2363