From 6cbee7a58ca3773fa470d7a8fe683868763e23aa Mon Sep 17 00:00:00 2001 From: bakebot Date: Tue, 24 Mar 2026 17:07:57 +0000 Subject: [PATCH] Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool Template: ``` { "template": "https://github.com/networktocode-llc/cookiecutter-ntc.git", "dir": "python", "ref": "main", "path": "/__w/cookiecutter-nautobot-app-drift-manager/cookiecutter-nautobot-app-drift-manager/cookiecutter-ntc/python" } ``` Cookie: ``` { "remote": "https://github.com/networktocode/diffsync.git", "path": "/tmp/tmp02ms1_83/diffsync", "repository_path": "/tmp/tmp02ms1_83/diffsync", "dir": "", "branch_prefix": "drift-manager/develop", "context": { "codeowner_github_usernames": "@glennmatthews @michalis1 @jdrew82", "full_name": "Network to Code, LLC", "email": "info@networktocode.com", "github_org": "networktocode", "description": "Library to easily sync/diff/update 2 different data sources", "project_name": "diffsync", "project_slug": "diffsync", "repo_url": "https://github.com/networktocode/diffsync", "base_url": "diffsync", "project_python_name": "diffsync", "project_python_base_version": "3.10", "project_with_config_settings": "no", "generate_docs": "yes", "version": "2.2.0", "original_publish_year": "2020", "_template": "/__w/cookiecutter-nautobot-app-drift-manager/cookiecutter-nautobot-app-drift-manager/cookiecutter-ntc/python", "_output_dir": "/tmp/tmp02ms1_83", "_repo_dir": "/__w/cookiecutter-nautobot-app-drift-manager/cookiecutter-nautobot-app-drift-manager/cookiecutter-ntc/python", "_checkout": null }, "drift_managed_branch": "develop", "remote_name": "origin", "pull_request_strategy": "PullRequestStrategy.UPDATE_OR_CREATE", "post_actions": [], "baked_commit_ref": "67d15ddeb638efb7c39ab746e97e7b9c96c16801", "draft": false } ``` CLI Arguments: ``` { "cookie_dir": "", "input": false, "json_filename": "", "output_dir": "", "push": true, "template": "./cookiecutter-ntc", "template_dir": "python", "template_ref": "main", "pull_request": "update-or-create", "post_action": [], "disable_post_actions": true, "draft": null, "drift_managed_branch": "develop" } ``` --- .cookiecutter.json | 4 ++++ .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 4 ++-- LICENSE | 2 +- README.md | 10 ++++----- changes/+main.housekeeping | 1 + docs/admin/release_notes/version_1.0.md | 4 ++++ tasks.py | 29 ++++++++++++++++++++----- 8 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 changes/+main.housekeeping diff --git a/.cookiecutter.json b/.cookiecutter.json index 3a74a3a0..735dd0ea 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -23,7 +23,11 @@ "pull_request_strategy": "update-or-create", "post_actions": [], "draft": false, +<<<<<<< HEAD "baked_commit_ref": "67d15ddeb638efb7c39ab746e97e7b9c96c16801", +======= + "baked_commit_ref": "5e993bc834a6e47f91ba8b03446af56ab741e0fb", +>>>>>>> 9cf5def (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool) "drift_managed_branch": "develop" } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 681a9351..c7442e89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,7 +102,7 @@ jobs: with: poetry-version: "2.1.3" - name: "Get image version" - run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py$${{ matrix.python-version }} >> $GITHUB_ENV" + run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV" - name: "Set up Docker Buildx" id: "buildx" uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef26e629..c09a0402 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ --- name: "Release" -on: # yamllint disable-line rule:truthy rule:comments +on: # yamllint disable-line rule:truthy rule:comments release: types: ["published"] @@ -47,7 +47,7 @@ jobs: - name: "Upload binaries to release" run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}" env: - GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}" + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" publish-pypi: name: "Push Package to PyPI" diff --git a/LICENSE b/LICENSE index e923d125..97b16298 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache Software License 2.0 -Copyright (c) 2025, Network to Code, LLC +Copyright (c) 2020-2026, Network to Code, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 5815cfd8..6002306f 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ A.sync_to(B) Full documentation for this library can be found over on the [Diffsync Docs](https://diffsync.readthedocs.io/) website: -- [User Guide](https://diffsync.readthedocs.io/user/app_overview/) - Overview, Using the Library, Getting Started. -- [Administrator Guide](https://diffsync.readthedocs.io/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library. -- [Developer Guide](https://diffsync.readthedocs.io/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide. -- [Release Notes / Changelog](https://diffsync.readthedocs.io/admin/release_notes/). -- [Frequently Asked Questions](https://diffsync.readthedocs.io/user/faq/). +- [User Guide](https://diffsync.readthedocs.io/en/latest/user/app_overview/) - Overview, Using the Library, Getting Started. +- [Administrator Guide](https://diffsync.readthedocs.io/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library. +- [Developer Guide](https://diffsync.readthedocs.io/en/latest/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide. +- [Release Notes / Changelog](https://diffsync.readthedocs.io/en/latest/admin/release_notes/). +- [Frequently Asked Questions](https://diffsync.readthedocs.io/en/latest/user/faq/). ## Installation diff --git a/changes/+main.housekeeping b/changes/+main.housekeeping new file mode 100644 index 00000000..3433adf6 --- /dev/null +++ b/changes/+main.housekeeping @@ -0,0 +1 @@ +Rebaked from the cookie `main`. diff --git a/docs/admin/release_notes/version_1.0.md b/docs/admin/release_notes/version_1.0.md index 1cbcdfe2..43446431 100644 --- a/docs/admin/release_notes/version_1.0.md +++ b/docs/admin/release_notes/version_1.0.md @@ -6,6 +6,10 @@ This document describes all new features and changes in the release. The format Initial release of DiffSync. +<<<<<<< HEAD ## [v1.0.0] - 2020-10-23 +======= +## [v1.0.0] - 2026-03-24 +>>>>>>> 9cf5def (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool) Initial release diff --git a/tasks.py b/tasks.py index ade398d8..b4d92b85 100644 --- a/tasks.py +++ b/tasks.py @@ -39,7 +39,7 @@ def is_truthy(arg): "python_ver": "3.10", "local": is_truthy(os.getenv("INVOKE_DIFFSYNC_LOCAL", "false")), "image_name": "diffsync", - "image_ver": os.getenv("INVOKE_PARSER_IMAGE_VER", "latest"), + "image_ver": os.getenv("INVOKE_DIFFSYNC_IMAGE_VER", "latest"), "pwd": Path(__file__).parent, } } @@ -66,13 +66,14 @@ def task_wrapper(function=None): return task_wrapper -def run_command(context, exec_cmd, port=None): +def run_command(context, exec_cmd, port=None, rm=True): """Wrapper to run the invoke task commands. Args: context ([invoke.task]): Invoke task object. exec_cmd ([str]): Command to run. port (int): Used to serve local docs. + rm (bool): Whether to remove the container after running the command. Returns: result (obj): Contains Invoke result from running task. @@ -86,12 +87,12 @@ def run_command(context, exec_cmd, port=None): ) if port: result = context.run( - f"docker run -it -p {port} -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'", + f"docker run -it {'--rm' if rm else ''} -p {port} -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'", pty=True, ) else: result = context.run( - f"docker run -it -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'", + f"docker run -it {'--rm' if rm else ''} -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'", pty=True, ) @@ -169,12 +170,28 @@ def coverage(context): run_command(context, "coverage html") -@task -def pytest(context): +@task( + help={ + "pattern": "Only run tests which match the given substring. Can be used multiple times.", + "label": "Module path to run (e.g., tests/unit/test_foo.py). Can be used multiple times.", + }, + iterable=["pattern", "label"], +) +def pytest(context, pattern=None, label=None): """Run pytest test cases.""" exec_cmd = "pytest -vv --doctest-modules diffsync/ && coverage run --source=diffsync -m pytest && coverage report" run_command(context, exec_cmd) + doc_test_cmd = "pytest -vv --doctest-modules diffsync/" + pytest_cmd = "coverage run --source=diffsync -m pytest" + if pattern: + pytest_cmd += "".join([f" -k {_pattern}" for _pattern in pattern]) + if label: + pytest_cmd += "".join([f" {_label}" for _label in label]) + coverage_cmd = "coverage report" + exec_cmd = " && ".join([doc_test_cmd, pytest_cmd, coverage_cmd]) + run_command(context, exec_cmd) + @task(aliases=("a",)) def autoformat(context):