diff --git a/pkgs/development/python-modules/mautrix-appservice/0001-Remove-coding-annotations.patch b/pkgs/development/python-modules/mautrix-appservice/0001-Remove-coding-annotations.patch deleted file mode 100644 index d00264efe8c..00000000000 --- a/pkgs/development/python-modules/mautrix-appservice/0001-Remove-coding-annotations.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6750cda26821f703b120ba5c925cc696200570d3 Mon Sep 17 00:00:00 2001 -From: Maximilian Bosch -Date: Sat, 26 Oct 2019 10:31:02 +0200 -Subject: [PATCH] Remove coding annotations - -Those used to be needed for Python <=3.5. With `pluggy` 0.13.0 this breaks -tests on newer python3 versions. ---- - mautrix_appservice/appservice.py | 1 - - mautrix_appservice/errors.py | 1 - - mautrix_appservice/intent_api.py | 1 - - mautrix_appservice/state_store.py | 1 - - 4 files changed, 4 deletions(-) - -diff --git a/mautrix_appservice/appservice.py b/mautrix_appservice/appservice.py -index 3a141b1..47e37fe 100644 ---- a/mautrix_appservice/appservice.py -+++ b/mautrix_appservice/appservice.py -@@ -1,4 +1,3 @@ --# -*- coding: future_fstrings -*- - # Partly based on github.com/Cadair/python-appservice-framework (MIT license) - from contextlib import contextmanager - from typing import Optional, Callable, Awaitable, Union -diff --git a/mautrix_appservice/errors.py b/mautrix_appservice/errors.py -index 90d040f..702f541 100644 ---- a/mautrix_appservice/errors.py -+++ b/mautrix_appservice/errors.py -@@ -1,4 +1,3 @@ --# -*- coding: future_fstrings -*- - from typing import Optional - - -diff --git a/mautrix_appservice/intent_api.py b/mautrix_appservice/intent_api.py -index 4021bf8..7236cbb 100644 ---- a/mautrix_appservice/intent_api.py -+++ b/mautrix_appservice/intent_api.py -@@ -1,4 +1,3 @@ --# -*- coding: future_fstrings -*- - from urllib.parse import quote as urllib_quote - from time import time - from json.decoder import JSONDecodeError -diff --git a/mautrix_appservice/state_store.py b/mautrix_appservice/state_store.py -index 47bb970..6ebec2a 100644 ---- a/mautrix_appservice/state_store.py -+++ b/mautrix_appservice/state_store.py -@@ -1,4 +1,3 @@ --# -*- coding: future_fstrings -*- - from typing import Optional - from abc import ABC, abstractmethod - import json --- -2.23.0 - diff --git a/pkgs/development/python-modules/mautrix-appservice/default.nix b/pkgs/development/python-modules/mautrix-appservice/default.nix deleted file mode 100644 index 41ad167929a..00000000000 --- a/pkgs/development/python-modules/mautrix-appservice/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi, aiohttp, future-fstrings, pythonOlder }: - -buildPythonPackage rec { - pname = "mautrix-appservice"; - version = "0.3.11"; - - src = fetchPypi { - inherit pname version; - sha256 = "60192920cff75afdd096eea3a43276e33ec15f4f00bd04d2d1dda616c84f22a5"; - }; - - patches = lib.optional (!(pythonOlder "3.6")) [ - ./0001-Remove-coding-annotations.patch - ]; - - propagatedBuildInputs = [ - aiohttp - future-fstrings - ]; - - # No tests available - doCheck = false; - - disabled = pythonOlder "3.5"; - - meta = with lib; { - homepage = https://github.com/tulir/mautrix-appservice-python; - description = "A Python 3 asyncio-based Matrix application service framework"; - license = licenses.mit; - maintainers = with maintainers; [ nyanloutre ]; - }; -} diff --git a/pkgs/development/python-modules/mautrix/default.nix b/pkgs/development/python-modules/mautrix/default.nix new file mode 100644 index 00000000000..d3b12d5ab60 --- /dev/null +++ b/pkgs/development/python-modules/mautrix/default.nix @@ -0,0 +1,43 @@ +{ lib, buildPythonPackage, fetchPypi, aiohttp, future-fstrings, pythonOlder +, sqlalchemy, ruamel_yaml, CommonMark, lxml, fetchpatch +}: + +buildPythonPackage rec { + pname = "mautrix"; + version = "0.4.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "03m59d683nr547v5xr80wc3j07das2d2sc3i4bf03dpbkfg0h17w"; + }; + + patches = [ + (fetchpatch { + url = "https://github.com/tulir/mautrix-python/commit/ac46f3bb1bea11d22d8a486cc4821604c844da5e.patch"; + sha256 = "198g63s0iv8g1w22g4g5hb54y41ws82wraglibz33qhrwsfn8axn"; + }) + ]; + + propagatedBuildInputs = [ + aiohttp + future-fstrings + + # defined in optional-requirements.txt + sqlalchemy + ruamel_yaml + CommonMark + lxml + ]; + + disabled = pythonOlder "3.5"; + + # no tests available + doCheck = false; + + meta = with lib; { + homepage = https://github.com/tulir/mautrix-python; + description = "A Python 3 asyncio Matrix framework."; + license = licenses.mpl20; + maintainers = with maintainers; [ nyanloutre ma27 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 256cb6ce534..0eb38f09802 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3982,7 +3982,8 @@ in { matrix-nio = callPackage ../development/python-modules/matrix-nio { }; - mautrix-appservice = callPackage ../development/python-modules/mautrix-appservice { }; + mautrix = callPackage ../development/python-modules/mautrix { }; + mautrix-appservice = self.mautrix; # alias 2019-12-28 maya = callPackage ../development/python-modules/maya { };