mautrix-telegram: fix application

* In 0.9 the entrypoint got removed as it's recommended to use
`python -m`[1]. However, our build layer for python relies on
that, so I added a patch to re-add this.

* The tests in the upstream sources appear abandoned, so those are
skipped. Therefore it's also pointless to add `pytest-runner` to the
`nativeBuildInputs` as it's not used and only blows up the build
closure.

A second patch modifies the requirements, so ow `pytest-runner` isn't
needed anymore.

[1] https://github.com/tulir/mautrix-telegram/commit/a565853c5e57a5671ebe4da178a5ac3d02a5005c

+29
pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch
···
+
From f4a612e1c8501d2a1683003bb121daa6d46155ca Mon Sep 17 00:00:00 2001
+
From: Maximilian Bosch <maximilian@mbosch.me>
+
Date: Sun, 29 Nov 2020 20:45:16 +0100
+
Subject: [PATCH 1/2] Re-add entrypoint
+
+
---
+
setup.py | 6 ++++++
+
1 file changed, 6 insertions(+)
+
+
diff --git a/setup.py b/setup.py
+
index 068c351..95dbf89 100644
+
--- a/setup.py
+
+++ b/setup.py
+
@@ -51,6 +51,12 @@ setuptools.setup(
+
extras_require=extras_require,
+
python_requires="~=3.6",
+
+
+ entry_points={
+
+ 'console_scripts': [
+
+ 'mautrix-telegram=mautrix_telegram.__main__:main'
+
+ ]
+
+ },
+
+
+
setup_requires=["pytest-runner"],
+
tests_require=["pytest", "pytest-asyncio", "pytest-mock"],
+
+
--
+
2.28.0
+
+24
pkgs/servers/mautrix-telegram/0002-Don-t-depend-on-pytest-runner.patch
···
+
From eb39954acf73096d65ba1e9575cbeb3d4307d5df Mon Sep 17 00:00:00 2001
+
From: Maximilian Bosch <maximilian@mbosch.me>
+
Date: Sun, 29 Nov 2020 20:55:17 +0100
+
Subject: [PATCH 2/2] Don't depend on pytest-runner
+
+
---
+
setup.py | 1 -
+
1 file changed, 1 deletion(-)
+
+
diff --git a/setup.py b/setup.py
+
index 95dbf89..89ea2a7 100644
+
--- a/setup.py
+
+++ b/setup.py
+
@@ -57,7 +57,6 @@ setuptools.setup(
+
]
+
},
+
+
- setup_requires=["pytest-runner"],
+
tests_require=["pytest", "pytest-asyncio", "pytest-mock"],
+
+
classifiers=[
+
--
+
2.28.0
+
+4 -5
pkgs/servers/mautrix-telegram/default.nix
···
sha256 = "1543ljjl3jg3ayid7ifi4bamqh4gq85pmlbs3m8i7phjbbm7g9dn";
};
+
patches = [ ./0001-Re-add-entrypoint.patch ./0002-Don-t-depend-on-pytest-runner.patch ];
postPatch = ''
sed -i -e '/alembic>/d' requirements.txt
'';
-
-
nativeBuildInputs = [
-
pytestrunner
-
];
propagatedBuildInputs = [
Mako
···
# Tests are broken and throw the following for every test:
# TypeError: 'Mock' object is not subscriptable
+
#
+
# The tests were touched the last time in 2019 and upstream CI doesn't even build
+
# those, so it's safe to assume that this part of the software is abandoned.
doCheck = false;
-
checkInputs = [
pytest
pytest-mock