Skip to content

Commit 7af44cb

Browse files
author
bakebot
committed
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/netutils.git", "path": "/tmp/tmp422crx0_/netutils", "repository_path": "/tmp/tmp422crx0_/netutils", "dir": "", "branch_prefix": "drift-manager/develop", "context": { "codeowner_github_usernames": "@itdependsnetworks @jeffkala @qduk", "full_name": "Network to Code, LLC", "email": "info@networktocode.com", "github_org": "networktocode", "description": "Common helper functions useful in network automation.", "project_name": "netutils", "project_slug": "netutils", "repo_url": "https://github.com/networktocode/netutils", "base_url": "netutils", "project_python_name": "netutils", "project_python_base_version": "3.10", "project_with_config_settings": "no", "generate_docs": "yes", "version": "1.15.1", "original_publish_year": "2021", "_template": "/__w/cookiecutter-nautobot-app-drift-manager/cookiecutter-nautobot-app-drift-manager/cookiecutter-ntc/python", "_output_dir": "/tmp/tmp422crx0_", "_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": "b23a9ed5a4714810d83670ad47cc182764c6d464", "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" } ```
1 parent a996428 commit 7af44cb

4 files changed

Lines changed: 29 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
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_NETUTILS_IMAGE_VER=`poetry version -s`-py$${{ matrix.python-version }} >> $GITHUB_ENV"
105+
run: "echo INVOKE_NETUTILS_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
@@ -118,7 +118,7 @@ jobs:
118118
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
119119
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
120120
build-args: |
121-
PYTHON_VER=${{ env.PYTHON_VER }}
121+
PYTHON_VER=${{ env.INVOKE_{{cookiecutter.project_slug | upper}}_PYTHON_VER }}
122122
- name: "Linting: Pylint"
123123
run: "poetry run invoke pylint"
124124
pytest:
@@ -155,7 +155,7 @@ jobs:
155155
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
156156
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
157157
build-args: |
158-
PYTHON_VER=${{ env.PYTHON_VER }}
158+
PYTHON_VER=${{ env.INVOKE_{{cookiecutter.project_slug | upper}}_PYTHON_VER }}
159159
- name: "Run Tests"
160160
run: "poetry run invoke pytest"
161161
changelog:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg
1111
-->
1212

1313
<p align="center">
14-
<img src="https://raw.githubusercontent.com/networktocode/netutils/develop/docs/images/icon-Netutils.png" class="logo" height="200px">
14+
<img src="https://raw.githubusercontent.com/networktocode/netutils/develop/docs/images/netutils_logo.png" class="logo" height="200px">
1515
<br>
1616
<a href="https://github.com/networktocode/netutils/actions"><img src="https://github.com/networktocode/netutils/actions/workflows/ci.yml/badge.svg?branch=main"></a>
1717
<a href="https://netutils.readthedocs.io/en/latest/"><img src="https://readthedocs.org/projects/netutils/badge/"></a>
@@ -28,11 +28,11 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg
2828

2929
Full documentation for this library can be found over on the [Netutils Docs](https://netutils.readthedocs.io/) website:
3030

31-
- [User Guide](https://netutils.readthedocs.io/user/app_overview/) - Overview, Using the Library, Getting Started.
32-
- [Administrator Guide](https://netutils.readthedocs.io/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library.
33-
- [Developer Guide](https://netutils.readthedocs.io/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide.
34-
- [Release Notes / Changelog](https://netutils.readthedocs.io/admin/release_notes/).
35-
- [Frequently Asked Questions](https://netutils.readthedocs.io/user/faq/).
31+
- [User Guide](https://netutils.readthedocs.io/en/latest/user/app_overview/) - Overview, Using the Library, Getting Started.
32+
- [Administrator Guide](https://netutils.readthedocs.io/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library.
33+
- [Developer Guide](https://netutils.readthedocs.io/en/latest/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide.
34+
- [Release Notes / Changelog](https://netutils.readthedocs.io/en/latest/admin/release_notes/).
35+
- [Frequently Asked Questions](https://netutils.readthedocs.io/en/latest/user/faq/).
3636

3737
### Contributing to the Documentation
3838

docs/admin/release_notes/version_1.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This document describes all new features and changes in the release `1.0`. The f
2929
- Achieved in this `x.y` release
3030
- Changes to compatibility with Nautobot and/or other apps, libraries etc.
3131

32-
## [v1.0.0] - 2026-02-12
32+
## [v1.0.0] - 2026-03-03
3333

3434
### Added
3535

tasks.py

Lines changed: 19 additions & 3 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_NETUTILS_LOCAL", "false")),
4141
"image_name": "netutils",
42-
"image_ver": os.getenv("INVOKE_PARSER_IMAGE_VER", "latest"),
42+
"image_ver": os.getenv("INVOKE_NETUTILS_IMAGE_VER", "latest"),
4343
"pwd": Path(__file__).parent,
4444
}
4545
}
@@ -172,12 +172,28 @@ def coverage(context):
172172
run_command(context, "coverage html")
173173

174174

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

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

182198
@task(aliases=("a",))
183199
def autoformat(context):

0 commit comments

Comments
 (0)