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 5256d30 commit 8814ae8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
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')
4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ package:
source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip
sha256: 19c82d5633751bf3ec92caa481fb5cffaac1787bd485f0df6436fd6242176949
patches:
- 0001-deprecation-warning.patch

build:
noarch: python
number: 0
number: 1
script: '{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv '

requirements:
Expand Down

0 comments on commit 8814ae8

Please sign in to comment.