Skip to content
Open
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
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
ruff-lint:
Expand All @@ -38,7 +38,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Linting: ruff"
run: "poetry run invoke ruff --action lint"
check-docs-build:
Expand All @@ -51,7 +51,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
poetry-install-options: "--only dev,docs"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
Expand All @@ -65,7 +65,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Checking: poetry lock file"
run: "poetry run invoke lock --check"
yamllint:
Expand All @@ -78,7 +78,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
check-in-docker:
Expand All @@ -91,7 +91,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.13"]
python-version: ["3.11", "3.15"]
env:
INVOKE_DIFFSYNC_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -100,7 +100,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Get image version"
run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
Expand All @@ -127,7 +127,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
runs-on: "ubuntu-latest"
env:
INVOKE_DIFFSYNC_PYTHON_VER: "${{ matrix.python-version }}"
Expand All @@ -137,7 +137,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Get image version"
run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
- name: "Check for changelog entry"
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-version: "2.5.1"
python-version: "3.13"
poetry-install-options: "--no-root"
- name: "Run Poetry Build"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VER="3.10"
ARG PYTHON_VER="3.13"

FROM python:${PYTHON_VER}-slim

Expand All @@ -8,7 +8,7 @@ FROM python:${PYTHON_VER}-slim
# This also makes it so that Poetry will *not* be included in the "final" image since it's not installed to /usr/local/
ARG POETRY_HOME=/opt/poetry
ARG POETRY_INSTALLER_PARALLEL=true
ARG POETRY_VERSION=2.1.3
ARG POETRY_VERSION=2.5.1
ARG POETRY_VIRTUALENVS_CREATE=false
ADD https://install.python-poetry.org /tmp/install-poetry.py
RUN python /tmp/install-poetry.py
Expand Down
2 changes: 2 additions & 0 deletions changes/377.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added support for Python 3.14 and 3.15.
Dropped support for Python 3.10.
1 change: 1 addition & 0 deletions docs/source/core_engine/01-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Global flags can be defined at runtime when calling one of these functions : `di

```python
from diffsync.enum import DiffSyncFlags

flags = DiffSyncFlags.SKIP_UNMATCHED_DST
diff = nautobot.diff_from(local, flags=flags)
```
Expand Down
9 changes: 7 additions & 2 deletions docs/source/getting_started/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Each `DiffSyncModel` subclass supports the following class-level attributes:
from typing import List, Optional
from diffsync import DiffSyncModel


class Site(DiffSyncModel):
_modelname = "site"
_identifiers = ("name",)
Expand Down Expand Up @@ -71,28 +72,33 @@ The models will be processed in a specfic order as defined by `top_level` atttri
Given the following Scenario:

```python

class Site(DiffSyncModel):
_children = {"vlan": "vlans", "prefix": "prefixes"}
[...]


class Device(DiffSyncModel):
_children = {"interface": "interfaces"}
[...]


class Vlan(DiffSyncModel):
[...]


class Prefix(DiffSyncModel):
[...]


class Interface(DiffSyncModel):
_children = {"ip_address": "ip_addresses"}
[...]


class IPAddress(DiffSyncModel):
[...]


class Cable(DiffSyncModel):
[...]

Expand All @@ -108,7 +114,6 @@ class Nautobot(Adapter):

top_level = ["site", "device", "cable"]
[...]

```

Would result in processing in the following order for each element until there are no elements left:
Expand Down
2 changes: 2 additions & 0 deletions docs/source/upgrading/01-upgrading-to-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ from typing import Optional

from diffsync import DiffSyncModel


# Before
class Person(DiffSyncModel):
_identifiers = ("name",)
Expand All @@ -27,6 +28,7 @@ class Person(DiffSyncModel):
name: str
age: Optional[int]


# After
class BetterPerson(DiffSyncModel):
_identifiers = ("name",)
Expand Down
2 changes: 1 addition & 1 deletion example.invoke.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"diffsync":
python_ver: "3.10"
python_ver: "3.15"
local: false
# image_name: "diffsync"
# image_ver: "latest"
Expand Down
1 change: 1 addition & 0 deletions examples/01-multiple-data-sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Configure verbosity of DiffSync's structured logging to console; the default is

```python
from diffsync.logging import enable_console_logging

enable_console_logging(verbosity=0) # Show WARNING and ERROR logs only
# enable_console_logging(verbosity=1) # Also include INFO logs
# enable_console_logging(verbosity=2) # Also include DEBUG logs
Expand Down
8 changes: 6 additions & 2 deletions examples/04-get-update-instantiate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ The following arguments are supported: model (`DiffSyncModel`), ids (dictionary)
It will then return a tuple that can be unpacked.

```python
obj, created = self.get_or_instantiate(Interface, {"device_name": "test100", "name": "eth0"}, {"description": "Test description"})
obj, created = self.get_or_instantiate(
Interface, {"device_name": "test100", "name": "eth0"}, {"description": "Test description"}
)
```

If the object already exists, `created` will be `False` or else it will return `True` if the object had to be created.
Expand All @@ -21,7 +23,9 @@ If the object already exists, `created` will be `False` or else it will return `
This helper is similar to `get_or_instantiate`, but it will update an existing object or add a new instance with the provided `ids` and `attrs`. The method does accept the same arguments, but requires `attrs`, whereas `get_or_instantiate` does not.

```python
obj, created = self.update_or_instantiate(Interface, {"device_name": "test100", "name": "eth0"}, {"description": "Test description"})
obj, created = self.update_or_instantiate(
Interface, {"device_name": "test100", "name": "eth0"}, {"description": "Test description"}
)
```

## Example Walkthrough
Expand Down
11 changes: 2 additions & 9 deletions examples/05-nautobot-peeringdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,10 @@ store_one = RedisStore(host="redis")
store_two = RedisStore(host="redis")

# Initialize PeeringDB adapter, using CATNIX id for demonstration
peeringdb = PeeringDB(
ix_id=62,
internal_storage_engine=store_one
)
peeringdb = PeeringDB(ix_id=62, internal_storage_engine=store_one)

# Initialize Nautobot adapter, pointing to the demo instance (it's also the default settings)
nautobot = NautobotRemote(
url="https://demo.nautobot.com",
token="a" * 40,
internal_storage_engine=store_two
)
nautobot = NautobotRemote(url="https://demo.nautobot.com", token="a" * 40, internal_storage_engine=store_two)

# Load PeeringDB info into the adapter
peeringdb.load()
Expand Down
Loading
Loading