Skip to content

Commit

Permalink
Patch: Avoid deprecation warnings
Browse files Browse the repository at this point in the history
Patch supplied upstream [0] but the maintainer hasn't merged it and there
are signs of the project being abandoned. This is a temporary fix
until the future of the project is resolved.

[0] ktosiek/pytest-freezegun#36
  • Loading branch information
kbevers committed Feb 16, 2022
1 parent ff88b79 commit 0052f16
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions recipe/0001-deprecation-warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- pytest_freegun.py 2022-02-16 18:57:46.000000000 +0100
+++ pytest_freezegun.py 2022-02-16 18:58:29.000000000 +0100
@@ -2,7 +2,7 @@

import pytest

-from distutils.version import LooseVersion
+from packaging.version import parse as parse_version
from freezegun import freeze_time


@@ -14,7 +14,7 @@
"""
Get our marker, regardless of pytest version
"""
- if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
+ if parse_version(pytest.__version__) < parse_version('3.6.0'):
return node.get_marker('freeze_time')
else:
return node.get_closest_marker('freeze_time')
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package:
source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip
sha256: 19c82d5633751bf3ec92caa481fb5cffaac1787bd485f0df6436fd6242176949
patches:
- 0001-deprecation-warning.patch

build:
noarch: python
Expand Down

0 comments on commit 0052f16

Please sign in to comment.