python3Packages.mautrix: 0.3.11 -> 0.4.0

Previously known as `mautrix-appservice`. For backwards-compatibility, I
added an alias in `python-packages.nix`.

Additionally a small patch was needed which I already filed upstream[1].

Please note that the package switched from a MIT license to the Mozilla
Public License[2].

[1] https://github.com/tulir/mautrix-python/pull/13
[2] https://github.com/tulir/mautrix-python/blob/v0.4.0/LICENSE
This commit is contained in:
Maximilian Bosch 2019-12-28 13:09:02 +01:00 committed by Jon
parent ea4da9b5fa
commit 298b3fb0a5
4 changed files with 45 additions and 86 deletions

View File

@ -1,53 +0,0 @@
From 6750cda26821f703b120ba5c925cc696200570d3 Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
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

View File

@ -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 ];
};
}

View File

@ -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 ];
};
}

View File

@ -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 { };