$ jsonschema --version shows 0.0.0 instead of actual version which makes matrix-synapse impossible to start --- $ service synapse start Starting synapse. ERROR:root:Needed jsonschema>=3.0.0, got jsonschema==0.0.0 Missing Requirements: "jsonschema>=3.0.0" To install run: pip install --upgrade --force "jsonschema>=3.0.0" /usr/local/etc/rc.d/synapse: WARNING: failed to start synapse
Thank you for the report Tom. Can you isolate / attach the 'version check' code.
File = /usr/local/lib/python3.8/site-packages/synapse/python_dependencies.py Code Line 50 REQUIREMENTS = [ # we use the TYPE_CHECKER.redefine method added in jsonschema 3.0.0 "jsonschema>=3.0.0", .... I changed the Code to "jsonschema>=0.0.0" and matrix-synapse starts now, so it seems to be the only check. Regards Tom
I can confirm this on my system. Seems like something is weirdly wrong with the version of the FreeBSD package and *only* the distributed package: * It appears as jsonschema==0.0.0 in pip freeze too, suggesting that something is wrong with the package metadata per se. * I quickly built and installed the package directly from ports, which does *not* result in such a broken package for me (i.e. both pip freeze and jsonschema --version report the correct version number). Similarly, installing the package directly via pip works fine too. * Building the package in poudriere however yields a package with version 0.0.0 in pip which is consequently also reported back by the package It would appear that something goes wrong when building the package with poudriere, but I'm currently not sure what exactly goes wrong here and I'm a bit uncertain how to proceed. The way the package obtains the version appears to have changed and relies on importlib's metadata.version() function, which *should* work, I suppose, but I'm not sure how that version is formed before the package is installed and would need to dig deeper into this to properly find the cause. In the meantime, should we patch synapse to remove the version check? It would be a hack and I'd prefer to resolve this issue right here, but it *should* be fine for the time being to ensure things keep running moderately smoothly.
Created attachment 229227 [details] devel/py-jsonschema: Fix missing dependency Apparently py-jsonschema uses py-setuptools_scm to filter the version from scm directly. This is reflected in the project's pyproject.toml, see [1]. Our port is missing this dependency, which causes the version to be set to 0.0.0. I've attached a patch that bumps the port's revision and adds the missing dependency. Tested building this in poudriere and it works fine. :-) Credits for this go to David Tucker in the #python room on matrix.org for pointing pointing me in the right direction. :D Cheers, Sascha [1] https://github.com/Julian/jsonschema/blob/272b4f24437d9cba1127058dc3479f9bc6d8c4b9/pyproject.toml#L6
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9913762ef61e311938e87a588aa427bbee65a74d commit 9913762ef61e311938e87a588aa427bbee65a74d Author: Sascha Biberhofer <ports@skyforge.at> AuthorDate: 2021-11-04 02:02:56 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2021-11-04 02:11:16 +0000 devel/py-jsonschema: Fix missing dependency PR: 259567 Reported by: tom@leben-auf-see.de MFH: 2021Q4 (fix build) devel/py-jsonschema/Makefile | 2 ++ 1 file changed, 2 insertions(+)
Unfortunately MFH is not required as 4.X is not on 2021Q4.
*** Bug 259659 has been marked as a duplicate of this bug. ***