Skip to content
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Align TOML indenting with Tombi
[*.toml]
indent_size = 2
29 changes: 3 additions & 26 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
# Copyright (C) 2020-2025 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details
Expand All @@ -15,28 +15,5 @@ on:

jobs:
Publish:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@v1.3.1
with:
user: __token__
# The token is provided by the inveniosoftware organization
password: ${{ secrets.pypi_token }}
uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master
secrets: inherit
39 changes: 2 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,5 @@ on:
default: 'Manual trigger'

jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
requirements-level: [min, pypi]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
sudo apt-get install libxml2-dev libxslt1-dev
python -m pip install --upgrade pip setuptools py wheel requirements-builder
requirements-builder -e all --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}

- name: Install dependencies
run: |
pip install -r .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
pip install .[all]
pip freeze

- name: Run tests
run: |
./run-tests.sh
Python:
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ docs/_build
docs/db
docs/static
htmlcov
uv.lock
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

5 changes: 2 additions & 3 deletions dictdiffer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

"""Dictdiffer is a helper module to diff and patch dictionaries."""

from collections.abc import (Iterable, MutableMapping, MutableSequence,
MutableSet)
from collections.abc import Iterable, MutableMapping, MutableSequence, MutableSet
from copy import deepcopy

from .utils import EPSILON, PathLimit, are_different, dot_lookup
Expand Down Expand Up @@ -71,7 +70,7 @@ def diff(first, second, node=None, ignore=None, path_limit=None, expand=False,
... path_limit=PathLimit([('a', 'b')])))
[('add', '', [('a', {})]), ('add', 'a', [('b', 'c')])]

>>> from dictdiffer.utils import PathLimit
>>> from dictdiffer.utils import PathLimit
>>> list(diff({'a': {'b': 'c'}}, {'a': {'b': 'c'}}, path_limit=PathLimit([('a',)])))
[]

Expand Down
7 changes: 3 additions & 4 deletions dictdiffer/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# SPDX-FileCopyrightText: 2014-2021 CERN.
# SPDX-License-Identifier: MIT

# -*- coding: utf-8 -*-
# Do not change the format of this next line. Doing so risks breaking
# setup.py and docs/conf.py

"""Version information for dictdiffer package."""

__version__ = '0.9.0'
__version__ = "0.9.0"
18 changes: 3 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@

import sys

from pkg_resources import get_distribution

_html_theme = "sphinx_rtd_theme"
_html_theme_path = []
try:
import sphinx_rtd_theme
_html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
print("Template {0} not found, pip install it", file=sys.stderr)
_html_theme = "default"
from dictdiffer import __version__

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -74,10 +65,9 @@
# built documents.
#
# The short X.Y version.
version = get_distribution('dictdiffer').version

# The full version, including alpha/beta/rc tags.
release = version
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -122,8 +112,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'default'
html_theme = _html_theme
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -132,7 +121,6 @@

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_theme_path = _html_theme_path

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down
77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SPDX-FileCopyrightText: 2013 Fatih Erikli.
# SPDX-FileCopyrightText: 2014, 2015, 2016 CERN.
# SPDX-FileCopyrightText: 2016 CERN.
# SPDX-FileCopyrightText: 2017, 2019 ETH Zurich, Swiss Data Science Center, Jiri Kuncar.
# SPDX-FileCopyrightText: 2026 TU Wien.
# SPDX-License-Identifier: MIT

[project]
name = "dictdiffer"
description = "Dictdiffer is a library that helps you to diff and patch dictionaries."
readme = "README.rst"
requires-python = ">=3.7"
license = "MIT"
authors = [
{ name = "Invenio Collaboration", email = "info@inveniosoftware.org" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Utilities",
]
dynamic = ["version"]

[project.urls]
Changelog = "https://github.com/inveniosoftware/dictdiffer/blob/master/CHANGES"
Docs = "https://dictdiffer.rtfd.io/"
Homepage = "https://github.com/inveniosoftware/dictdiffer"

[project.optional-dependencies]
docs = [
"sphinx-rtd-theme>=0.2",
"sphinx>=3",
]
numpy = [
"numpy>=1.20.0",
]
tests = [
"mock>=1.3.0",
"pycodestyle>=2.10.0",
"pytest-cov>=2.10.1",
"pytest-isort>=1.2.0",
"pytest-pydocstyle>=2.2.0",
"pytest>=6,<9",
"sphinx>=3",
"tox>=3.7.0",
]

[build-system]
requires = ["hatch-vcs", "hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "dictdiffer/version.py"

[tool.hatch.build.targets.sdist]
include = [
"/dictdiffer",
]

[tool.isort]
profile = "black"

[tool.pydocstyle]
add_ignore = ""

[tool.pytest.ini_options]
addopts = '--isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=dictdiffer --cov-report=term-missing'
testpaths = "tests dictdiffer"
live_server_scope = "module"
7 changes: 0 additions & 7 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -o errexit
# Quit on unbound symbols
set -o nounset

python -m check_manifest --ignore ".*-requirements.txt"
python -m sphinx.cmd.build -qnNW docs docs/_build/html
python -m pytest
python -m sphinx.cmd.build -qnNW -b doctest docs docs/_build/doctest
pycodestyle --ignore=E501,E226,W504 dictdiffer
13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

105 changes: 0 additions & 105 deletions setup.py

This file was deleted.

Loading