1 |
commit: 90d6d12f1be6f5fe7372c1ba1371d2079cdc0013 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 8 10:41:39 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 8 11:09:49 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90d6d12f |
7 |
|
8 |
dev-python/pytest-freezegun: EAPI 8, PEP517, fix deprecation warning |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../pytest-freezegun-0.4.2-distutils-depr.patch | 61 ++++++++++++++++++++++ |
13 |
.../pytest-freezegun-0.4.2-r1.ebuild | 35 +++++++++++++ |
14 |
2 files changed, 96 insertions(+) |
15 |
|
16 |
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 |
17 |
new file mode 100644 |
18 |
index 000000000000..86b7e32a5c1f |
19 |
--- /dev/null |
20 |
+++ b/dev-python/pytest-freezegun/files/pytest-freezegun-0.4.2-distutils-depr.patch |
21 |
@@ -0,0 +1,61 @@ |
22 |
+From 1ae2e18b8d71c45defe8f695a3dddd5762a611b2 Mon Sep 17 00:00:00 2001 |
23 |
+From: Hugo van Kemenade <hugovk@××××××××××××××××××××.com> |
24 |
+Date: Fri, 8 Apr 2022 13:30:42 +0300 |
25 |
+Subject: [PATCH] Require pytest 3.6 to drop dependency on deprecated distutils |
26 |
+ |
27 |
+--- |
28 |
+ pytest_freezegun.py | 6 +----- |
29 |
+ setup.cfg | 2 +- |
30 |
+ tox.ini | 2 +- |
31 |
+ 3 files changed, 3 insertions(+), 7 deletions(-) |
32 |
+ |
33 |
+diff --git a/pytest_freezegun.py b/pytest_freezegun.py |
34 |
+index a08133f..257c7ca 100644 |
35 |
+--- a/pytest_freezegun.py |
36 |
++++ b/pytest_freezegun.py |
37 |
+@@ -2,7 +2,6 @@ |
38 |
+ |
39 |
+ import pytest |
40 |
+ |
41 |
+-from distutils.version import LooseVersion |
42 |
+ from freezegun import freeze_time |
43 |
+ |
44 |
+ |
45 |
+@@ -14,10 +13,7 @@ def get_closest_marker(node, name): |
46 |
+ """ |
47 |
+ Get our marker, regardless of pytest version |
48 |
+ """ |
49 |
+- if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'): |
50 |
+- return node.get_marker('freeze_time') |
51 |
+- else: |
52 |
+- return node.get_closest_marker('freeze_time') |
53 |
++ return node.get_closest_marker('freeze_time') |
54 |
+ |
55 |
+ |
56 |
+ @pytest.fixture(name=FIXTURE_NAME) |
57 |
+diff --git a/setup.cfg b/setup.cfg |
58 |
+index 069ddf7..da06223 100644 |
59 |
+--- a/setup.cfg |
60 |
++++ b/setup.cfg |
61 |
+@@ -31,7 +31,7 @@ py_modules = |
62 |
+ pytest_freezegun |
63 |
+ install_requires = |
64 |
+ freezegun>0.3 |
65 |
+- pytest>=3.0.0 |
66 |
++ pytest>=3.6 |
67 |
+ |
68 |
+ [options.entry_points] |
69 |
+ pytest11 = |
70 |
+diff --git a/tox.ini b/tox.ini |
71 |
+index 3846fd9..07e916d 100644 |
72 |
+--- a/tox.ini |
73 |
++++ b/tox.ini |
74 |
+@@ -6,7 +6,7 @@ envlist = {py35,py36,py37,py38,pypy3}-{pt3,pt4,pt5},py38-ptNext-fgNext,flake8 |
75 |
+ deps = |
76 |
+ coverage |
77 |
+ pip >= 19 |
78 |
+- pt3: pytest>=3,<4 |
79 |
++ pt3: pytest>=3.6,<4 |
80 |
+ pt4: pytest>=4,<5 |
81 |
+ pt5: pytest>=5,<6 |
82 |
+ ptNext: git+https://github.com/pytest-dev/pytest/ |
83 |
|
84 |
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 |
85 |
new file mode 100644 |
86 |
index 000000000000..01de23365fa4 |
87 |
--- /dev/null |
88 |
+++ b/dev-python/pytest-freezegun/pytest-freezegun-0.4.2-r1.ebuild |
89 |
@@ -0,0 +1,35 @@ |
90 |
+# Copyright 2020-2022 Gentoo Authors |
91 |
+# Distributed under the terms of the GNU General Public License v2 |
92 |
+ |
93 |
+EAPI=8 |
94 |
+ |
95 |
+DISTUTILS_USE_PEP517=setuptools |
96 |
+PYTHON_COMPAT=( pypy3 python3_{8..10} ) |
97 |
+ |
98 |
+inherit distutils-r1 |
99 |
+ |
100 |
+DESCRIPTION="Easily freeze time in pytest test + fixtures" |
101 |
+HOMEPAGE=" |
102 |
+ https://pypi.org/project/pytest-freezegun/ |
103 |
+ https://github.com/ktosiek/pytest-freezegun/ |
104 |
+" |
105 |
+SRC_URI=" |
106 |
+ https://github.com/ktosiek/pytest-freezegun/archive/${PV}.tar.gz |
107 |
+ -> ${P}.gh.tar.gz |
108 |
+" |
109 |
+ |
110 |
+LICENSE="MIT" |
111 |
+SLOT="0" |
112 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos" |
113 |
+ |
114 |
+RDEPEND=" |
115 |
+ dev-python/freezegun[${PYTHON_USEDEP}] |
116 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
117 |
+" |
118 |
+ |
119 |
+distutils_enable_tests pytest |
120 |
+ |
121 |
+PATCHES=( |
122 |
+ # https://github.com/ktosiek/pytest-freezegun/pull/38 |
123 |
+ "${FILESDIR}"/${P}-distutils-depr.patch |
124 |
+) |