Skip to content

Commit 71cde51

Browse files
authored
Merge pull request #449 from seperman/dev
7.0.0
2 parents 89c5cc2 + c6ae868 commit 71cde51

31 files changed

+1546
-347
lines changed

.github/workflows/main.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
15+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
1616
architecture: ["x64"]
1717
include:
1818
- python-version: "3.10"
@@ -34,11 +34,12 @@ jobs:
3434
restore-keys: |
3535
${{ runner.os }}-pip-
3636
${{ runner.os }}-
37-
- name: Install dependencies py3.7
38-
if: matrix.python-version == 3.7
39-
run: pip install -r requirements-dev-3.7.txt
37+
- name: Upgrade setuptools
38+
if: matrix.python-version == 3.12
39+
run: |
40+
# workaround for 3.12, SEE: https://github.com/pypa/setuptools/issues/3661#issuecomment-1813845177
41+
pip install --upgrade setuptools
4042
- name: Install dependencies
41-
if: matrix.python-version != 3.7
4243
run: pip install -r requirements-dev.txt
4344
- name: Install Numpy Dev
4445
if: ${{ matrix.numpy-version }}
@@ -63,5 +64,6 @@ jobs:
6364
if: matrix.python-version == 3.11
6465
with:
6566
file: ./coverage.xml
67+
token: ${{ secrets.CODECOV_TOKEN }}
6668
env_vars: OS,PYTHON
6769
fail_ci_if_error: true

CITATION.cff

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: "Dehpour"
5+
given-names: "Sep"
6+
orcid: "https://orcid.org/0009-0009-5828-4345"
7+
title: "DeepDiff"
8+
version: 7.0.0
9+
date-released: 2024
10+
url: "https://github.com/seperman/deepdiff"

README.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DeepDiff v 6.7.1
1+
# DeepDiff v 7.0.0
22

33
![Downloads](https://img.shields.io/pypi/dm/deepdiff.svg?style=flat)
44
![Python Versions](https://img.shields.io/pypi/pyversions/deepdiff.svg?style=flat)
@@ -15,9 +15,9 @@
1515
- [Extract](https://zepworks.com/deepdiff/current/extract.html): Extract an item from a nested Python object using its path.
1616
- [commandline](https://zepworks.com/deepdiff/current/commandline.html): Use DeepDiff from commandline.
1717

18-
Tested on Python 3.7+ and PyPy3.
18+
Tested on Python 3.8+ and PyPy3.
1919

20-
- **[Documentation](https://zepworks.com/deepdiff/6.7.1/)**
20+
- **[Documentation](https://zepworks.com/deepdiff/7.0.0/)**
2121

2222
## What is new?
2323

@@ -101,16 +101,6 @@ Or to see a more user friendly version, please run: `pytest --cov=deepdiff --cov
101101

102102
Thank you!
103103

104-
# Citing
105-
106-
How to cite this library (APA style):
107-
108-
Dehpour, S. (2023). DeepDiff (Version 6.7.1) [Software]. Available from https://github.com/seperman/deepdiff.
109-
110-
How to cite this library (Chicago style):
111-
112-
Dehpour, Sep. 2023. DeepDiff (version 6.7.1).
113-
114104
# Authors
115105

116106
Please take a look at the [AUTHORS](AUTHORS.md) file.

deepdiff/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""This module offers the DeepDiff, DeepSearch, grep, Delta and DeepHash classes."""
22
# flake8: noqa
3-
__version__ = '6.7.1'
3+
__version__ = '7.0.0'
44
import logging
55

66
if __name__ == '__main__':

deepdiff/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_ignore_types_in_groups(self, ignore_type_in_groups,
4444
if ignore_numeric_type_changes and self.numbers not in ignore_type_in_groups:
4545
ignore_type_in_groups.append(OrderedSet(self.numbers))
4646

47-
if ignore_type_subclasses:
47+
if not ignore_type_subclasses:
48+
# is_instance method needs tuples. When we look for subclasses, we need them to be tuples
4849
ignore_type_in_groups = list(map(tuple, ignore_type_in_groups))
4950

5051
return ignore_type_in_groups

deepdiff/deephash.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import inspect
33
import logging
4+
import datetime
45
from collections.abc import Iterable, MutableMapping
56
from collections import defaultdict
67
from hashlib import sha1, sha256
@@ -186,7 +187,8 @@ def __init__(self,
186187
# the only time it should be set to False is when
187188
# testing the individual hash functions for different types of objects.
188189
self.apply_hash = apply_hash
189-
self.type_check_func = type_is_subclass_of_type_group if ignore_type_subclasses else type_in_type_group
190+
self.type_check_func = type_in_type_group if ignore_type_subclasses else type_is_subclass_of_type_group
191+
# self.type_check_func = type_is_subclass_of_type_group if ignore_type_subclasses else type_in_type_group
190192
self.number_to_string = number_to_string_func or number_to_string
191193
self.ignore_private_variables = ignore_private_variables
192194
self.encodings = encodings
@@ -455,6 +457,10 @@ def _prep_datetime(self, obj):
455457
obj = datetime_normalize(self.truncate_datetime, obj)
456458
return KEY_TO_VAL_STR.format(type_, obj)
457459

460+
def _prep_date(self, obj):
461+
type_ = 'datetime' # yes still datetime but it doesn't need normalization
462+
return KEY_TO_VAL_STR.format(type_, obj)
463+
458464
def _prep_tuple(self, obj, parent, parents_ids):
459465
# Checking to see if it has _fields. Which probably means it is a named
460466
# tuple.
@@ -505,6 +511,9 @@ def _hash(self, obj, parent, parents_ids=EMPTY_FROZENSET):
505511
elif isinstance(obj, times):
506512
result = self._prep_datetime(obj)
507513

514+
elif isinstance(obj, datetime.date):
515+
result = self._prep_date(obj)
516+
508517
elif isinstance(obj, numbers):
509518
result = self._prep_number(obj)
510519

0 commit comments

Comments
 (0)