Skip to content

Release 0.0.7 #124

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

Merged
merged 11 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 51 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,81 @@ on: # yamllint disable-line rule:truthy rule:comments

jobs:
black:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: black"
run: "poetry run invoke black"
mypy:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: mypy"
run: "poetry run invoke mypy"
bandit:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
pydocstyle:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
flake8:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
yamllint:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
pylint:
Expand All @@ -84,7 +96,7 @@ jobs:
- "yamllint"
- "black"
- "mypy"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
strategy:
fail-fast: true
matrix:
Expand All @@ -94,9 +106,13 @@ jobs:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
# Default install options is "--only dev", but we need to install all dependencies
poetry-install-options: ""
- name: "Linting: Pylint"
run: "poetry run invoke pylint"
pytest:
Expand All @@ -106,28 +122,32 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
# Default install options is "--only dev", but we need to install all dependencies
poetry-install-options: ""
- name: "Run Tests"
run: "poetry run invoke pytest"
publish_gh:
needs:
- "pytest"
name: "Publish to GitHub"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v2"
uses: "actions/setup-python@v5"
with:
python-version: "3.9"
- name: "Install Python Packages"
Expand All @@ -150,13 +170,13 @@ jobs:
needs:
- "pytest"
name: "Push Package to PyPI"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v2"
uses: "actions/setup-python@v5"
with:
python-version: "3.9"
- name: "Install Python Packages"
Expand All @@ -177,7 +197,7 @@ jobs:
- "publish_gh"
- "publish_pypi"
name: "Send notification to the Slack"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
SLACK_MESSAGE: >-
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v0.0.7
- Fix exclude to work with lists [#123](https://github.com/networktocode/jdiff/pull/123)

## v0.0.6
- Sort the data when data normalization is used with key anchoring

Expand Down
2 changes: 1 addition & 1 deletion jdiff/extract_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def extract_data_from_json(data: Union[Mapping, List], path: str = "*", exclude:
Returns:
Evaluated data, may be anything depending on JMESPath used.
"""
if exclude and isinstance(data, Dict):
if exclude and isinstance(data, (Dict, List)):
if not isinstance(exclude, list):
raise ValueError(f"Exclude list must be defined as a list. You have {type(exclude)}")
# exclude unwanted elements
Expand Down
Loading