summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-04-08 12:41:39 +0200
committerMichał Górny <mgorny@gentoo.org>2022-04-08 13:09:49 +0200
commit90d6d12f1be6f5fe7372c1ba1371d2079cdc0013 (patch)
tree8688b17367ce86840bbb875e5f74fe406f829432 /dev-python/pytest-freezegun
parentdev-python/pydantic: Fix test failures due to pytest plugins (diff)
downloadgentoo-90d6d12f1be6f5fe7372c1ba1371d2079cdc0013.tar.gz
gentoo-90d6d12f1be6f5fe7372c1ba1371d2079cdc0013.tar.bz2
gentoo-90d6d12f1be6f5fe7372c1ba1371d2079cdc0013.zip
dev-python/pytest-freezegun: EAPI 8, PEP517, fix deprecation warning
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pytest-freezegun')
-rw-r--r--dev-python/pytest-freezegun/files/pytest-freezegun-0.4.2-distutils-depr.patch61
-rw-r--r--dev-python/pytest-freezegun/pytest-freezegun-0.4.2-r1.ebuild35
2 files changed, 96 insertions, 0 deletions
diff --git a/dev-python/pytest-freezegun/files/pytest-freezegun-0.4.2-distutils-depr.patch b/dev-python/pytest-freezegun/files/pytest-freezegun-0.4.2-distutils-depr.patch
new file mode 100644
index 000000000000..86b7e32a5c1f
--- /dev/null
+++ b/dev-python/pytest-freezegun/files/pytest-freezegun-0.4.2-distutils-depr.patch
@@ -0,0 +1,61 @@
+From 1ae2e18b8d71c45defe8f695a3dddd5762a611b2 Mon Sep 17 00:00:00 2001
+From: Hugo van Kemenade <hugovk@users.noreply.github.com>
+Date: Fri, 8 Apr 2022 13:30:42 +0300
+Subject: [PATCH] Require pytest 3.6 to drop dependency on deprecated distutils
+
+---
+ pytest_freezegun.py | 6 +-----
+ setup.cfg | 2 +-
+ tox.ini | 2 +-
+ 3 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/pytest_freezegun.py b/pytest_freezegun.py
+index a08133f..257c7ca 100644
+--- a/pytest_freezegun.py
++++ b/pytest_freezegun.py
+@@ -2,7 +2,6 @@
+
+ import pytest
+
+-from distutils.version import LooseVersion
+ from freezegun import freeze_time
+
+
+@@ -14,10 +13,7 @@ def get_closest_marker(node, name):
+ """
+ Get our marker, regardless of pytest version
+ """
+- if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
+- return node.get_marker('freeze_time')
+- else:
+- return node.get_closest_marker('freeze_time')
++ return node.get_closest_marker('freeze_time')
+
+
+ @pytest.fixture(name=FIXTURE_NAME)
+diff --git a/setup.cfg b/setup.cfg
+index 069ddf7..da06223 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -31,7 +31,7 @@ py_modules =
+ pytest_freezegun
+ install_requires =
+ freezegun>0.3
+- pytest>=3.0.0
++ pytest>=3.6
+
+ [options.entry_points]
+ pytest11 =
+diff --git a/tox.ini b/tox.ini
+index 3846fd9..07e916d 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -6,7 +6,7 @@ envlist = {py35,py36,py37,py38,pypy3}-{pt3,pt4,pt5},py38-ptNext-fgNext,flake8
+ deps =
+ coverage
+ pip >= 19
+- pt3: pytest>=3,<4
++ pt3: pytest>=3.6,<4
+ pt4: pytest>=4,<5
+ pt5: pytest>=5,<6
+ ptNext: git+https://github.com/pytest-dev/pytest/
diff --git a/dev-python/pytest-freezegun/pytest-freezegun-0.4.2-r1.ebuild b/dev-python/pytest-freezegun/pytest-freezegun-0.4.2-r1.ebuild
new file mode 100644
index 000000000000..01de23365fa4
--- /dev/null
+++ b/dev-python/pytest-freezegun/pytest-freezegun-0.4.2-r1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( pypy3 python3_{8..10} )
+
+inherit distutils-r1
+
+DESCRIPTION="Easily freeze time in pytest test + fixtures"
+HOMEPAGE="
+ https://pypi.org/project/pytest-freezegun/
+ https://github.com/ktosiek/pytest-freezegun/
+"
+SRC_URI="
+ https://github.com/ktosiek/pytest-freezegun/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+
+RDEPEND="
+ dev-python/freezegun[${PYTHON_USEDEP}]
+ dev-python/pytest[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/ktosiek/pytest-freezegun/pull/38
+ "${FILESDIR}"/${P}-distutils-depr.patch
+)