Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Commandline Interface #213

Merged
merged 41 commits into from
Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7cfbd37
adding commandline
seperman Sep 28, 2020
797b989
adding fixtures for the commandline
seperman Sep 28, 2020
29a5202
adding tests for the commands
seperman Sep 28, 2020
14b3886
ending py3.5 support
seperman Sep 28, 2020
d8dd378
adding more tests
seperman Sep 28, 2020
2e59739
adding more test coverage
seperman Sep 28, 2020
d8282e4
adding deeppatch command
seperman Sep 29, 2020
ff867bb
fixing tests
seperman Sep 29, 2020
c310b94
adding deepgrep command
seperman Sep 29, 2020
dd46061
adding deep extract
seperman Sep 29, 2020
75f9a17
Improve ignoring of NoneType in diff
stianjensen Sep 29, 2020
73ab169
always make it dict
seperman Sep 29, 2020
a5b3567
switching back to deep command
seperman Sep 29, 2020
01c429b
Merge pull request #214 from HyreAS/diff-none
seperman Sep 29, 2020
72393b8
wip
seperman Oct 23, 2020
daf58c0
WIP compare numbers with math.isclose()
flowolf Sep 28, 2020
917570d
add debug message
flowolf Sep 28, 2020
42059f4
Revert "add debug message"
flowolf Sep 28, 2020
9eb3707
fix order of vars in diff.py
flowolf Dec 4, 2020
ab92fbe
add tests for math_close
flowolf Dec 4, 2020
86e552f
changed math_close parameters
flowolf Dec 6, 2020
4a5af21
remove caplog test as it keeps failing when run with other tests
flowolf Dec 6, 2020
556dde7
Merge pull request #221 from flowolf/math_close_diff_numbers
seperman Dec 8, 2020
0108889
bye bye travis
seperman Dec 30, 2020
a8c2bc2
no ppc64le arch on github actions
seperman Dec 30, 2020
f17257d
does codecov work?
seperman Dec 30, 2020
26c7e4a
come on
seperman Dec 30, 2020
8020b87
readme badges
seperman Dec 30, 2020
9ab3a45
bye bye coveralls
seperman Dec 30, 2020
ab894ba
updating comments
seperman Dec 30, 2020
0bcf4e9
fixing group by
seperman Dec 31, 2020
8d2f4ae
make private functions use one underline
seperman Dec 31, 2020
777cce6
adding more tests for commands
seperman Dec 31, 2020
51c7124
adding epsilon test for commands
seperman Dec 31, 2020
eb39945
adding more tests
seperman Dec 31, 2020
51b5c43
updating authors and changelog
seperman Dec 31, 2020
37b9611
updating docs
seperman Dec 31, 2020
01a02ba
Bump version: 5.0.2 → 5.1.0
seperman Dec 31, 2020
a36282a
Bump version: 5.1.0 → 5.2.0
seperman Dec 31, 2020
a47c799
adding docs for math epsilon and group by
seperman Dec 31, 2020
d04af64
adding the commandline docs
seperman Jan 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@ assignees: ''
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Steps to reproduce the behavior

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OS, DeepDiff version and Python version (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]
- OS: [e.g. Ubuntu]
- Version [e.g. 20LTS]

**Additional context**
Add any other context about the problem here.
52 changes: 52 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Unit Tests

on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
architecture: ["x64"]

steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 deepdiff --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 deepdiff --count --exit-zero --max-complexity=26 --max-line-lengt=250 --statistics
- name: Test with pytest
run: |
pytest --cov-report=xml --cov=deepdiff tests/ --runslow
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: matrix.python-version == 3.8
with:
file: ./coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ Authors in order of the contributions:
- [Timothy](https://github.com/timson) for truncate_datetime
- [d0b3rm4n](https://github.com/d0b3rm4n) for bugfix to not apply format to non numbers.
- [MyrikLD](https://github.com/MyrikLD) for Bug Fix NoneType in ignore type groups
- Stian Jensen [stianjensen](https://github.com/stianjensen) for improving ignoring of NoneType in diff
- Florian Klien [flowolf](https://github.com/flowolf) for adding math_epsilon
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DeepDiff Change log

- v5-2-0: Removed Murmur3 as the preferred hashing method. Using SHA256 by default now. Added commandline for deepdiff. Added group_by. Added math_epsilon. Improved ignoring of NoneType.
- v5-0-2: Bug Fix NoneType in ignore type groups https://github.com/seperman/deepdiff/issues/207
- v5-0-1: Bug fix to not apply format to non numbers.
- v5-0-0: Introducing the Delta object, Improving Numpy support, Fixing tuples comparison when ignore_order=True, Dramatically improving the results when ignore_order=True by running in passes, Introducing pretty print view, deep_distance, purge, progress logging, cache and truncate_datetime.
Expand Down
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# DeepDiff v 5.0.2
# DeepDiff v 5.2.0

![Downloads](https://img.shields.io/pypi/dm/deepdiff.svg?style=flat)
![Python Versions](https://img.shields.io/pypi/pyversions/deepdiff.svg?style=flat)
![License](https://img.shields.io/pypi/l/deepdiff.svg?version=latest)
[![Build Status](https://travis-ci.org/seperman/deepdiff.svg?branch=master)](https://travis-ci.org/seperman/deepdiff)
[![Coverage Status](https://coveralls.io/repos/github/seperman/deepdiff/badge.svg?branch=master)](https://coveralls.io/github/seperman/deepdiff?branch=master)
[![Build Status](https://github.com/seperman/deepdiff/workflows/Unit%20Tests/badge.svg)](https://github.com/seperman/deepdiff/actions)
[![codecov](https://codecov.io/gh/seperman/deepdiff/branch/master/graph/badge.svg?token=KkHZ3siA3m)](https://codecov.io/gh/seperman/deepdiff)

## DeepDiff Overview

- DeepDiff: Deep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all the changes.
- DeepSearch: Search for objects within other objects.
- DeepHash: Hash any object based on their content.

Tested on Python 3.5+ and PyPy3.
Tested on Python 3.6+ and PyPy3.

**NOTE: Python 2 is not supported any more. DeepDiff v3.3.0 was the last version to support Python 2**

**NOTE: The last version of DeepDiff to work on Python 3.5 was DeepDiff 5-0-2**

- [Documentation](https://zepworks.com/deepdiff/5.0.2/)
- [Documentation](https://zepworks.com/deepdiff/5.2.0/)


## Installation
Expand Down Expand Up @@ -46,13 +47,13 @@ If you are running into trouble installing Murmur3, please take a look at the [T

DeepDiff gets the difference of 2 objects.

> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.2/diff.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.2.0/diff.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.2.0/>
> - Tutorials can be found on <https://zepworks.com/tags/deepdiff/>
## A few Examples

> Note: This is just a brief overview of what DeepDiff can do. Please visit <https://zepworks.com/deepdiff/5.0.2/> for full documentation.
> Note: This is just a brief overview of what DeepDiff can do. Please visit <https://zepworks.com/deepdiff/5.2.0/> for full documentation.
### List difference ignoring order or duplicates

Expand Down Expand Up @@ -256,8 +257,8 @@ Example:
```


> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.2/diff.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.2.0/diff.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.2.0/>

# Deep Search
Expand Down Expand Up @@ -289,17 +290,17 @@ And you can pass all the same kwargs as DeepSearch to grep too:
{'matched_paths': {"root['somewhere']": 'around'}, 'matched_values': {"root['long']": 'somewhere'}}
```

> - Please take a look at the [DeepSearch docs](https://zepworks.com/deepdiff/5.0.2/dsearch.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
> - Please take a look at the [DeepSearch docs](https://zepworks.com/deepdiff/5.2.0/dsearch.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.2.0/>
# Deep Hash
(New in v4-0-0)

DeepHash is designed to give you hash of ANY python object based on its contents even if the object is not considered hashable!
DeepHash is supposed to be deterministic in order to make sure 2 objects that contain the same data, produce the same hash.

> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.2/deephash.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.2.0/deephash.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.2.0/>
Let's say you have a dictionary object.

Expand Down Expand Up @@ -347,8 +348,8 @@ Which you can write as:
At first it might seem weird why DeepHash(obj)[obj] but remember that DeepHash(obj) is a dictionary of hashes of all other objects that obj contains too.


> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.2/deephash.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.2.0/deephash.html)
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.2.0/>

# Using DeepDiff in unit tests
Expand Down Expand Up @@ -435,9 +436,9 @@ git push && git push --tags
1. Please make your PR against the dev branch
2. Please make sure that your PR has tests. Since DeepDiff is used in many sensitive data driven projects, we strive to maintain around 100% test coverage on the code.

Please run `pytest --cov=deepdiff` to see the coverage report.
Please run `pytest --cov=deepdiff --runslow` to see the coverage report. Note that the `--runslow` flag will run some slow tests too. In most cases you only want to run the fast tests which so you won't add the `--runslow` flag.

Or to see a more user friendly version, please run: `pytest --cov=deepdiff --cov-report term-missing`.
Or to see a more user friendly version, please run: `pytest --cov=deepdiff --cov-report term-missing --runslow`.

Thank you!

Expand Down
2 changes: 1 addition & 1 deletion deepdiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""This module offers the DeepDiff, DeepSearch, grep, Delta and DeepHash classes."""
# flake8: noqa
__version__ = '5.0.2'
__version__ = '5.2.0'
import logging

if __name__ == '__main__':
Expand Down