Skip to content

Commit b0f3ec2

Browse files
smith-ntcbakebot
andauthored
Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool (#350)
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" } ``` Co-authored-by: bakebot <info@networktocode.com>
1 parent 5a72750 commit b0f3ec2

File tree

8 files changed

+41
-15
lines changed

8 files changed

+41
-15
lines changed

.cookiecutter.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
"pull_request_strategy": "update-or-create",
2424
"post_actions": [],
2525
"draft": false,
26+
<<<<<<< HEAD
2627
"baked_commit_ref": "67d15ddeb638efb7c39ab746e97e7b9c96c16801",
28+
=======
29+
"baked_commit_ref": "5e993bc834a6e47f91ba8b03446af56ab741e0fb",
30+
>>>>>>> 9cf5def (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
2731
"drift_managed_branch": "develop"
2832
}
2933
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
with:
103103
poetry-version: "2.1.3"
104104
- name: "Get image version"
105-
run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py$${{ matrix.python-version }} >> $GITHUB_ENV"
105+
run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
106106
- name: "Set up Docker Buildx"
107107
id: "buildx"
108108
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: "Release"
3-
on: # yamllint disable-line rule:truthy rule:comments
3+
on: # yamllint disable-line rule:truthy rule:comments
44
release:
55
types: ["published"]
66

@@ -47,7 +47,7 @@ jobs:
4747
- name: "Upload binaries to release"
4848
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
4949
env:
50-
GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}"
50+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5151

5252
publish-pypi:
5353
name: "Push Package to PyPI"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Apache Software License 2.0
22

3-
Copyright (c) 2025, Network to Code, LLC
3+
Copyright (c) 2020-2026, Network to Code, LLC
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ A.sync_to(B)
5454

5555
Full documentation for this library can be found over on the [Diffsync Docs](https://diffsync.readthedocs.io/) website:
5656

57-
- [User Guide](https://diffsync.readthedocs.io/user/app_overview/) - Overview, Using the Library, Getting Started.
58-
- [Administrator Guide](https://diffsync.readthedocs.io/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library.
59-
- [Developer Guide](https://diffsync.readthedocs.io/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide.
60-
- [Release Notes / Changelog](https://diffsync.readthedocs.io/admin/release_notes/).
61-
- [Frequently Asked Questions](https://diffsync.readthedocs.io/user/faq/).
57+
- [User Guide](https://diffsync.readthedocs.io/en/latest/user/app_overview/) - Overview, Using the Library, Getting Started.
58+
- [Administrator Guide](https://diffsync.readthedocs.io/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library.
59+
- [Developer Guide](https://diffsync.readthedocs.io/en/latest/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide.
60+
- [Release Notes / Changelog](https://diffsync.readthedocs.io/en/latest/admin/release_notes/).
61+
- [Frequently Asked Questions](https://diffsync.readthedocs.io/en/latest/user/faq/).
6262

6363
## Installation
6464

changes/+main.housekeeping

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rebaked from the cookie `main`.

docs/admin/release_notes/version_1.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This document describes all new features and changes in the release. The format
66

77
Initial release of DiffSync.
88

9+
<<<<<<< HEAD
910
## [v1.0.0] - 2020-10-23
11+
=======
12+
## [v1.0.0] - 2026-03-24
13+
>>>>>>> 9cf5def (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
1014
1115
Initial release

tasks.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def is_truthy(arg):
3939
"python_ver": "3.10",
4040
"local": is_truthy(os.getenv("INVOKE_DIFFSYNC_LOCAL", "false")),
4141
"image_name": "diffsync",
42-
"image_ver": os.getenv("INVOKE_PARSER_IMAGE_VER", "latest"),
42+
"image_ver": os.getenv("INVOKE_DIFFSYNC_IMAGE_VER", "latest"),
4343
"pwd": Path(__file__).parent,
4444
}
4545
}
@@ -66,13 +66,14 @@ def task_wrapper(function=None):
6666
return task_wrapper
6767

6868

69-
def run_command(context, exec_cmd, port=None):
69+
def run_command(context, exec_cmd, port=None, rm=True):
7070
"""Wrapper to run the invoke task commands.
7171
7272
Args:
7373
context ([invoke.task]): Invoke task object.
7474
exec_cmd ([str]): Command to run.
7575
port (int): Used to serve local docs.
76+
rm (bool): Whether to remove the container after running the command.
7677
7778
Returns:
7879
result (obj): Contains Invoke result from running task.
@@ -86,12 +87,12 @@ def run_command(context, exec_cmd, port=None):
8687
)
8788
if port:
8889
result = context.run(
89-
f"docker run -it -p {port} -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'",
90+
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}'",
9091
pty=True,
9192
)
9293
else:
9394
result = context.run(
94-
f"docker run -it -v {context.diffsync.pwd}:/local {context.diffsync.image_name}:{context.diffsync.image_ver} sh -c '{exec_cmd}'",
95+
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}'",
9596
pty=True,
9697
)
9798

@@ -169,12 +170,28 @@ def coverage(context):
169170
run_command(context, "coverage html")
170171

171172

172-
@task
173-
def pytest(context):
173+
@task(
174+
help={
175+
"pattern": "Only run tests which match the given substring. Can be used multiple times.",
176+
"label": "Module path to run (e.g., tests/unit/test_foo.py). Can be used multiple times.",
177+
},
178+
iterable=["pattern", "label"],
179+
)
180+
def pytest(context, pattern=None, label=None):
174181
"""Run pytest test cases."""
175182
exec_cmd = "pytest -vv --doctest-modules diffsync/ && coverage run --source=diffsync -m pytest && coverage report"
176183
run_command(context, exec_cmd)
177184

185+
doc_test_cmd = "pytest -vv --doctest-modules diffsync/"
186+
pytest_cmd = "coverage run --source=diffsync -m pytest"
187+
if pattern:
188+
pytest_cmd += "".join([f" -k {_pattern}" for _pattern in pattern])
189+
if label:
190+
pytest_cmd += "".join([f" {_label}" for _label in label])
191+
coverage_cmd = "coverage report"
192+
exec_cmd = " && ".join([doc_test_cmd, pytest_cmd, coverage_cmd])
193+
run_command(context, exec_cmd)
194+
178195

179196
@task(aliases=("a",))
180197
def autoformat(context):

0 commit comments

Comments
 (0)