Skip to content

Commit

Permalink
Merge pull request #213 from seperman/dev
Browse files Browse the repository at this point in the history
Adding Commandline Interface
  • Loading branch information
seperman committed Jan 1, 2021
2 parents c78395c + d04af64 commit 0baced4
Show file tree
Hide file tree
Showing 56 changed files with 1,545 additions and 278 deletions.
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

0 comments on commit 0baced4

Please sign in to comment.