Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
"pull_request_strategy": "update-or-create",
"post_actions": [],
"draft": false,
<<<<<<< HEAD
<<<<<<< HEAD
"baked_commit_ref": "b23a9ed5a4714810d83670ad47cc182764c6d464",
=======
"baked_commit_ref": "a996428068385caa4a089ec4abfd1ac731fca674",
>>>>>>> 016b1ed (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
=======
"baked_commit_ref": "7af44cb7e9a8e4894c9edfd2ee6ad8dc7b109de2",
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
"drift_managed_branch": "develop"
}
}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ jobs:
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
<<<<<<< HEAD
PYTHON_VER=${{ matrix.python-version }}
=======
PYTHON_VER=${{ env.INVOKE_{{cookiecutter.project_slug | upper}}_PYTHON_VER }}
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
- name: "Linting: Pylint"
run: "poetry run invoke pylint"
pytest:
Expand Down Expand Up @@ -171,7 +175,11 @@ jobs:
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
<<<<<<< HEAD
PYTHON_VER=${{ matrix.python-version }}
=======
PYTHON_VER=${{ env.INVOKE_{{cookiecutter.project_slug | upper}}_PYTHON_VER }}
Comment thread
jeffkala marked this conversation as resolved.
Outdated
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
- name: "Run Tests"
run: "poetry run invoke pytest"
changelog:
Expand Down
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Apache Software License 2.0

<<<<<<< HEAD
<<<<<<< HEAD
Copyright (c) 2021-2025, Network to Code, LLC
=======
Copyright (c) 2021-2026, Network to Code, LLC
>>>>>>> 016b1ed (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
=======
Copyright (c) 2021-2026, Network to Code, LLC
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Netutils

<p align="center">
<img src="https://raw.githubusercontent.com/networktocode/netutils/develop/docs/images/icon-Netutils.png" class="logo" height="200px">
<img src="https://raw.githubusercontent.com/networktocode/netutils/develop/docs/images/netutils_logo.png" class="logo" height="200px">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just make sure we update the logo during the same PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bunch of others thiings I need to fix too

<br>
<a href="https://github.com/networktocode/netutils/actions"><img src="https://github.com/networktocode/netutils/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<a href="https://netutils.readthedocs.io/en/latest"><img src="https://readthedocs.org/projects/netutils/badge/"></a>
Expand All @@ -18,9 +18,15 @@ A Python library that is a collection of functions that are used in the common n

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

<<<<<<< HEAD
- [User Guide](https://netutils.readthedocs.io/en/latest/user/lib_overview/) - Overview, Using the library, Getting Started.
- [Administrator Guide](https://netutils.readthedocs.io/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the library.
- [Developer Guide](https://netutils.readthedocs.io/en/latest/dev/contributing/) - Extending the library, Code Reference, Contribution Guide.
=======
- [User Guide](https://netutils.readthedocs.io/en/latest/user/app_overview/) - Overview, Using the Library, Getting Started.
- [Administrator Guide](https://netutils.readthedocs.io/en/latest/admin/install/) - How to Install, Configure, Upgrade, or Uninstall the Library.
- [Developer Guide](https://netutils.readthedocs.io/en/latest/dev/contributing/) - Extending the Library, Code Reference, Contribution Guide.
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
- [Release Notes / Changelog](https://netutils.readthedocs.io/en/latest/admin/release_notes/).
- [Frequently Asked Questions](https://netutils.readthedocs.io/en/latest/user/faq/).

Expand Down
1 change: 1 addition & 0 deletions changes/+main.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebaked from the cookie `main`.
8 changes: 8 additions & 0 deletions docs/admin/release_notes/version_1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
- Commit to SemVer
- F5 fixes

<<<<<<< HEAD
<<<<<<< HEAD
## v1.0.0 - 2021-11
=======
## [v1.0.0] - 2026-02-12
>>>>>>> 016b1ed (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
=======
## [v1.0.0] - 2026-03-03
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)

### Added

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 @@
---
"netutils":
python_ver: "3.9"
python_ver: "3.10"
local: false
# image_name: "netutils"
# image_ver: "latest"
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ include = [

[tool.poetry.dependencies]
python = ">=3.10,<3.14"
<<<<<<< HEAD
<<<<<<< HEAD
napalm = {version = "^4.0.0", optional = true}
jsonschema = {version = "^4.17.3", optional = true}
legacycrypt = {version = "0.3", optional = true}

[tool.poetry.extras]
optionals = ["jsonschema", "napalm", "legacycrypt"]
=======
=======
>>>>>>> 3ab07dc (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)
click = "*"
>>>>>>> 016b1ed (Cookie updated targeting develop by NetworkToCode Cookie Drift Manager Tool)

[tool.poetry.group.dev.dependencies]
coverage = "*"
Expand Down
19 changes: 15 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def is_truthy(arg):
"python_ver": "3.10",
"local": is_truthy(os.getenv("INVOKE_NETUTILS_LOCAL", "false")),
"image_name": "netutils",
"image_ver": os.getenv("INVOKE_PARSER_IMAGE_VER", "latest"),
"image_ver": os.getenv("INVOKE_NETUTILS_IMAGE_VER", "latest"),
"pwd": Path(__file__).parent,
}
}
Expand All @@ -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.
Expand All @@ -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.netutils.pwd}:/local {context.netutils.image_name}:{context.netutils.image_ver} sh -c '{exec_cmd}'",
f"docker run -it {'--rm' if rm else ''} -p {port} -v {context.netutils.pwd}:/local {context.netutils.image_name}:{context.netutils.image_ver} sh -c '{exec_cmd}'",
pty=True,
)
else:
result = context.run(
f"docker run -it -v {context.netutils.pwd}:/local {context.netutils.image_name}:{context.netutils.image_ver} sh -c '{exec_cmd}'",
f"docker run -it {'--rm' if rm else ''} -v {context.netutils.pwd}:/local {context.netutils.image_name}:{context.netutils.image_ver} sh -c '{exec_cmd}'",
pty=True,
)

Expand Down Expand Up @@ -188,6 +189,16 @@ def pytest(context, pattern=None, label=None):
exec_cmd = " && ".join([doc_test_cmd, pytest_cmd, coverage_cmd])
run_command(context, exec_cmd)

doc_test_cmd = "pytest -vv --doctest-modules netutils/"
pytest_cmd = "coverage run --source=netutils -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):
Expand Down