Skip to content

Commit 985fd84

Browse files
authored
Cookie initially baked by NetworkToCode Cookie Drift Manager Tool (#726)
* Cookie initialy baked by NetworkToCode Cookie Drift Manager Tool Template: ``` { "template": "https://github.com/networktocode-llc/cookiecutter-ntc.git", "dir": "python", "ref": "main", "path": null } ``` Cookie: ``` { "remote": "https://github.com/networktocode/netutils.git", "path": "/Users/jeffkala/Documents/GitHub/outputs/netutils", "repository_path": "/Users/jeffkala/Documents/GitHub/outputs/netutils", "dir": "", "branch_prefix": "drift-manager", "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.8", "project_with_config_settings": "no", "generate_docs": "yes", "version": "1.15.1", "_template": "https://github.com/networktocode-llc/cookiecutter-ntc.git", "_output_dir": "/Users/jeffkala/Documents/GitHub/outputs", "_repo_dir": "/Users/jeffkala/.cookiecutters/cookiecutter-ntc/python", "_checkout": "main" }, "base_branch": "develop", "remote_name": "origin", "pull_request_strategy": "PullRequestStrategy.CREATE", "post_actions": [], "baked_commit_ref": "", "draft": false } ``` CLI Arguments: ``` { "cookie_dir": "", "input": true, "json_filename": "", "output_dir": "../outputs", "push": true, "template": "https://github.com/networktocode-llc/cookiecutter-ntc.git", "template_dir": "python", "template_ref": "main", "pull_request": null, "post_action": [], "disable_post_actions": false, "draft": null } ``` * fix drift mgr merge conflicts
1 parent 9a2d7b5 commit 985fd84

32 files changed

+1224
-517
lines changed

.cookiecutter.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"cookiecutter": {
3+
"codeowner_github_usernames": "@itdependsnetworks @jeffkala @qduk",
4+
"full_name": "Network to Code, LLC",
5+
"email": "info@networktocode.com",
6+
"github_org": "networktocode",
7+
"description": "Common helper functions useful in network automation.",
8+
"project_name": "netutils",
9+
"project_slug": "netutils",
10+
"repo_url": "https://github.com/networktocode/netutils",
11+
"base_url": "netutils",
12+
"project_python_name": "netutils",
13+
"project_python_base_version": "3.9",
14+
"project_with_config_settings": "no",
15+
"generate_docs": "yes",
16+
"version": "1.15.1",
17+
"_drift_manager": {
18+
"template": "https://github.com/networktocode-llc/cookiecutter-ntc.git",
19+
"template_dir": "python",
20+
"template_ref": "main",
21+
"cookie_dir": "",
22+
"branch_prefix": "drift-manager",
23+
"pull_request_strategy": "create",
24+
"post_actions": [],
25+
"draft": false,
26+
"baked_commit_ref": "cb8b5e31dece5ab2663d2ffd218a96ca1ae794c5"
27+
}
28+
}
29+
}

.dockerignore

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1-
**/*.pyc
2-
**/*.pyo
3-
**/*.log
4-
.git/
5-
.gitignore
1+
# Docker related
2+
development/Dockerfile
3+
development/docker-compose*.yml
4+
development/*.env
5+
*.env
6+
environments/
67
Dockerfile
78
docker-compose.yml
89
.env
10+
11+
# Python
12+
**/*.pyc
13+
**/*.pyo
14+
**/__pycache__/
15+
**/.pytest_cache/
16+
**/.venv/
17+
18+
19+
# Other
920
docs/_build
10-
**/__pycache__
21+
FAQ.md
22+
.git/
23+
.gitignore
24+
.github
25+
tasks.py
26+
LICENSE
27+
**/*.log
28+
**/.vscode/
29+
invoke*.yml
30+
tasks.py

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ about: Report a reproducible bug in the current release of netutils
44
---
55

66
### Environment
7-
* Python version: <!-- Example: 3.8.5 -->
8-
* netutils version: <!-- Example: 1.14.0 -->
7+
* Python version: <!-- Example: 3.9 -->
8+
* netutils version: <!-- Example: 1.0.0 -->
99

1010
<!-- What did you expect to happen? -->
1111
### Expected Behavior

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Propose a new feature or enhancement
55
---
66

77
### Environment
8-
* netutils version: <!-- Example: 1.14.0 -->
8+
* netutils version: <!-- Example: 1.0.0 -->
99

1010
<!--
1111
Describe in detail the new functionality you are proposing.

.github/workflows/ci.yml

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818

1919
jobs:
2020
ruff-format:
21-
runs-on: "ubuntu-24.04"
21+
runs-on: "ubuntu-latest"
2222
env:
2323
INVOKE_NETUTILS_LOCAL: "True"
2424
steps:
@@ -27,11 +27,11 @@ jobs:
2727
- name: "Setup environment"
2828
uses: "networktocode/gh-action-setup-poetry-environment@v6"
2929
with:
30-
poetry-version: "1.8.5"
30+
poetry-version: "2.1.3"
3131
- name: "Linting: ruff format"
3232
run: "poetry run invoke ruff --action format"
3333
ruff-lint:
34-
runs-on: "ubuntu-24.04"
34+
runs-on: "ubuntu-latest"
3535
env:
3636
INVOKE_NETUTILS_LOCAL: "True"
3737
steps:
@@ -40,11 +40,11 @@ jobs:
4040
- name: "Setup environment"
4141
uses: "networktocode/gh-action-setup-poetry-environment@v6"
4242
with:
43-
poetry-version: "1.8.5"
43+
poetry-version: "2.1.3"
4444
- name: "Linting: ruff"
4545
run: "poetry run invoke ruff --action lint"
4646
mypy:
47-
runs-on: "ubuntu-24.04"
47+
runs-on: "ubuntu-latest"
4848
env:
4949
INVOKE_NETUTILS_LOCAL: "True"
5050
steps:
@@ -60,7 +60,7 @@ jobs:
6060
- "ruff-format"
6161
- "ruff-lint"
6262
check-docs-build:
63-
runs-on: "ubuntu-24.04"
63+
runs-on: "ubuntu-latest"
6464
env:
6565
INVOKE_NETUTILS_LOCAL: "True"
6666
steps:
@@ -69,11 +69,12 @@ jobs:
6969
- name: "Setup environment"
7070
uses: "networktocode/gh-action-setup-poetry-environment@v6"
7171
with:
72-
poetry-version: "1.8.5"
72+
poetry-version: "2.1.3"
73+
poetry-install-options: "--only dev,docs"
7374
- name: "Check Docs Build"
7475
run: "poetry run invoke build-and-check-docs"
7576
poetry:
76-
runs-on: "ubuntu-24.04"
77+
runs-on: "ubuntu-latest"
7778
env:
7879
INVOKE_NETUTILS_LOCAL: "True"
7980
steps:
@@ -82,16 +83,15 @@ jobs:
8283
- name: "Setup environment"
8384
uses: "networktocode/gh-action-setup-poetry-environment@v6"
8485
with:
85-
poetry-version: "1.8.5"
86+
poetry-version: "2.1.3"
8687
- name: "Checking: poetry lock file"
87-
run: "poetry lock --check"
88+
run: "poetry run invoke lock --check"
8889
needs:
8990
- "ruff-format"
9091
- "ruff-lint"
91-
- "mypy"
9292
- "yamllint"
9393
yamllint:
94-
runs-on: "ubuntu-24.04"
94+
runs-on: "ubuntu-latest"
9595
env:
9696
INVOKE_NETUTILS_LOCAL: "True"
9797
steps:
@@ -100,14 +100,14 @@ jobs:
100100
- name: "Setup environment"
101101
uses: "networktocode/gh-action-setup-poetry-environment@v6"
102102
with:
103-
poetry-version: "1.8.5"
103+
poetry-version: "2.1.3"
104104
- name: "Linting: yamllint"
105105
run: "poetry run invoke yamllint"
106106
needs:
107107
- "ruff-format"
108108
- "ruff-lint"
109109
pylint:
110-
runs-on: "ubuntu-24.04"
110+
runs-on: "ubuntu-latest"
111111
strategy:
112112
fail-fast: true
113113
matrix:
@@ -120,7 +120,7 @@ jobs:
120120
- name: "Setup environment"
121121
uses: "networktocode/gh-action-setup-poetry-environment@v6"
122122
with:
123-
poetry-version: "1.8.5"
123+
poetry-version: "2.1.3"
124124
- name: "Get image version"
125125
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
126126
- name: "Set up Docker Buildx"
@@ -139,8 +139,6 @@ jobs:
139139
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
140140
build-args: |
141141
PYTHON_VER=${{ env.PYTHON_VER }}
142-
- name: "Debug: Show docker images"
143-
run: "docker image ls"
144142
- name: "Linting: Pylint"
145143
run: "poetry run invoke pylint"
146144
needs:
@@ -150,7 +148,7 @@ jobs:
150148
fail-fast: true
151149
matrix:
152150
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
153-
runs-on: "ubuntu-24.04"
151+
runs-on: "ubuntu-latest"
154152
env:
155153
PYTHON_VER: "${{ matrix.python-version }}"
156154
steps:
@@ -159,7 +157,7 @@ jobs:
159157
- name: "Setup environment"
160158
uses: "networktocode/gh-action-setup-poetry-environment@v6"
161159
with:
162-
poetry-version: "1.8.5"
160+
poetry-version: "2.1.3"
163161
- name: "Get image version"
164162
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
165163
- name: "Set up Docker Buildx"
@@ -178,15 +176,31 @@ jobs:
178176
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
179177
build-args: |
180178
PYTHON_VER=${{ env.PYTHON_VER }}
181-
- name: "Debug: Show docker images"
182-
run: "docker image ls"
183179
- name: "Run Tests"
184180
run: "poetry run invoke pytest"
185181
needs:
186-
- "pylint"
182+
- "poetry"
183+
changelog:
184+
if: >
185+
contains(fromJson('["develop"]'), github.base_ref) &&
186+
(github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
187+
runs-on: "ubuntu-latest"
188+
steps:
189+
- name: "Check out repository code"
190+
uses: "actions/checkout@v4"
191+
with:
192+
fetch-depth: "0"
193+
- name: "Setup environment"
194+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
195+
with:
196+
poetry-version: "2.1.3"
197+
- name: "Check for changelog entry"
198+
run: |
199+
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
200+
poetry run towncrier check --compare-with origin/${{ github.base_ref }}
187201
publish_gh:
188202
name: "Publish to GitHub"
189-
runs-on: "ubuntu-24.04"
203+
runs-on: "ubuntu-latest"
190204
# yamllint disable-line rule:quoted-strings
191205
if: startsWith(github.ref, 'refs/tags/v')
192206
env:
@@ -197,13 +211,15 @@ jobs:
197211
- name: "Setup environment"
198212
uses: "networktocode/gh-action-setup-poetry-environment@v6"
199213
with:
200-
poetry-version: "1.8.5"
214+
poetry-version: "2.1.3"
201215
python-version: "3.12"
202216
poetry-install-options: "--no-root"
203217
- name: "Set env"
204218
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
205219
- name: "Run Poetry Version"
206220
run: "poetry version $RELEASE_VERSION"
221+
- name: "Build Documentation"
222+
run: "poetry run invoke build-and-check-docs"
207223
- name: "Run Poetry Build"
208224
run: "poetry build"
209225
- name: "Upload binaries to release"
@@ -214,25 +230,30 @@ jobs:
214230
- "pytest"
215231
publish_pypi:
216232
name: "Push Package to PyPI"
217-
runs-on: "ubuntu-24.04"
218-
if: "startsWith(github.ref, 'refs/tags/v')"
233+
runs-on: "ubuntu-latest"
234+
# yamllint disable-line rule:quoted-strings
235+
if: startsWith(github.ref, 'refs/tags/v')
236+
env:
237+
INVOKE_NETUTILS_LOCAL: "True"
219238
steps:
220239
- name: "Check out repository code"
221240
uses: "actions/checkout@v4"
222-
- name: "Set up Python"
223-
uses: "actions/setup-python@v2"
241+
- name: "Setup environment"
242+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
224243
with:
225-
python-version: "3.13"
226-
- name: "Install Python Packages"
227-
run: "pip install poetry"
244+
poetry-version: "2.1.3"
228245
- name: "Set env"
229246
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
230247
- name: "Run Poetry Version"
231248
run: "poetry version $RELEASE_VERSION"
249+
- name: "Install Dependencies (needed for mkdocs)"
250+
run: "poetry install --no-root"
251+
- name: "Build Documentation"
252+
run: "poetry run invoke build-and-check-docs"
232253
- name: "Run Poetry Build"
233254
run: "poetry build"
234255
- name: "Push to PyPI"
235-
uses: "pypa/gh-action-pypi-publish@release/v1"
256+
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
236257
with:
237258
user: "__token__"
238259
password: "${{ secrets.PYPI_API_TOKEN }}"
@@ -242,7 +263,7 @@ jobs:
242263
needs:
243264
- "publish_gh"
244265
- "publish_pypi"
245-
runs-on: "ubuntu-24.04"
266+
runs-on: "ubuntu-latest"
246267
env:
247268
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
248269
SLACK_MESSAGE: >-

0 commit comments

Comments
 (0)