summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-29 16:11:02 +0200
committerMichał Górny <mgorny@gentoo.org>2020-05-30 09:40:19 +0200
commit46b5dffed4d5d8fff2592c4e9f9a731b8235ff03 (patch)
treeec08e10a55e350a1a2cf05cc6f31c0884afea45d /dev-python/deprecated
parentdev-python/vcrpy: Port to py39 (diff)
downloadgentoo-46b5dffed4d5d8fff2592c4e9f9a731b8235ff03.tar.gz
gentoo-46b5dffed4d5d8fff2592c4e9f9a731b8235ff03.tar.bz2
gentoo-46b5dffed4d5d8fff2592c4e9f9a731b8235ff03.zip
dev-python/deprecated: Port to py39
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/deprecated')
-rw-r--r--dev-python/deprecated/deprecated-1.2.10.ebuild7
-rw-r--r--dev-python/deprecated/deprecated-1.2.9.ebuild1
-rw-r--r--dev-python/deprecated/files/deprecated-1.2.10-py39.patch57
3 files changed, 62 insertions, 3 deletions
diff --git a/dev-python/deprecated/deprecated-1.2.10.ebuild b/dev-python/deprecated/deprecated-1.2.10.ebuild
index a5088d2c205c..b2b1fcd65d1d 100644
--- a/dev-python/deprecated/deprecated-1.2.10.ebuild
+++ b/dev-python/deprecated/deprecated-1.2.10.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} pypy3 )
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
inherit distutils-r1
DESCRIPTION="Python @deprecated decorator to deprecate old API"
@@ -15,6 +15,9 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="dev-python/wrapt[${PYTHON_USEDEP}]"
-BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-py39.patch
+)
diff --git a/dev-python/deprecated/deprecated-1.2.9.ebuild b/dev-python/deprecated/deprecated-1.2.9.ebuild
index a6bed5059a0d..cf3f9570dd6a 100644
--- a/dev-python/deprecated/deprecated-1.2.9.ebuild
+++ b/dev-python/deprecated/deprecated-1.2.9.ebuild
@@ -15,6 +15,5 @@ SLOT="0"
KEYWORDS="amd64 x86"
RDEPEND="dev-python/wrapt[${PYTHON_USEDEP}]"
-BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
distutils_enable_tests pytest
diff --git a/dev-python/deprecated/files/deprecated-1.2.10-py39.patch b/dev-python/deprecated/files/deprecated-1.2.10-py39.patch
new file mode 100644
index 000000000000..42ab81445b7a
--- /dev/null
+++ b/dev-python/deprecated/files/deprecated-1.2.10-py39.patch
@@ -0,0 +1,57 @@
+From 629e7b702ede03262afeb86cd7a6d42d739504d2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 30 May 2020 09:30:58 +0200
+Subject: [PATCH] Update expected class method deprecation msgs in tests for
+ py3.9
+
+Python 3.9 has fixed @classmethod combining with other decorators,
+making deprecated correctly report 'class method' (instead of function
+or static method). Update the tests to account for that.
+
+Fixes #29
+---
+ tests/test_deprecated.py | 6 +++++-
+ tests/test_sphinx.py | 5 ++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py
+index 3796640..e4c00ef 100644
+--- a/tests/test_deprecated.py
++++ b/tests/test_deprecated.py
+@@ -1,4 +1,5 @@
+ # -*- coding: utf-8 -*-
++import sys
+ import warnings
+
+ import pytest
+@@ -184,7 +185,10 @@ def test_classic_deprecated_class_method__warns(classic_deprecated_class_method)
+ assert len(warns) == 1
+ warn = warns[0]
+ assert issubclass(warn.category, DeprecationWarning)
+- assert "deprecated function (or staticmethod)" in str(warn.message)
++ if sys.version_info >= (3, 9):
++ assert "deprecated class method" in str(warn.message)
++ else:
++ assert "deprecated function (or staticmethod)" in str(warn.message)
+ assert warn.filename == __file__, 'Incorrect warning stackLevel'
+
+
+diff --git a/tests/test_sphinx.py b/tests/test_sphinx.py
+index 42f2460..efc8628 100644
+--- a/tests/test_sphinx.py
++++ b/tests/test_sphinx.py
+@@ -334,7 +334,10 @@ def test_sphinx_deprecated_class_method__warns(sphinx_deprecated_class_method):
+ assert len(warns) == 1
+ warn = warns[0]
+ assert issubclass(warn.category, DeprecationWarning)
+- assert "deprecated function (or staticmethod)" in str(warn.message)
++ if sys.version_info >= (3, 9):
++ assert "deprecated class method" in str(warn.message)
++ else:
++ assert "deprecated function (or staticmethod)" in str(warn.message)
+
+
+ def test_should_raise_type_error():
+--
+2.26.2
+