Skip to content

Commit 860f726

Browse files
authored
Merge pull request #786 from networktocode/release-1.16.0
Release v1.16.0
2 parents 68b7384 + 3fa6ad8 commit 860f726

54 files changed

Lines changed: 9647 additions & 870 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cookiecutter.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@
1010
"repo_url": "https://github.com/networktocode/netutils",
1111
"base_url": "netutils",
1212
"project_python_name": "netutils",
13-
"project_python_base_version": "3.9",
13+
"project_python_base_version": "3.10",
1414
"project_with_config_settings": "no",
1515
"generate_docs": "yes",
1616
"version": "1.15.1",
17+
"original_publish_year": "2021",
1718
"_drift_manager": {
1819
"template": "https://github.com/networktocode-llc/cookiecutter-ntc.git",
1920
"template_dir": "python",
2021
"template_ref": "main",
2122
"cookie_dir": "",
22-
"branch_prefix": "drift-manager",
23-
"pull_request_strategy": "create",
23+
"pull_request_strategy": "update-or-create",
2424
"post_actions": [],
2525
"draft": false,
26-
"baked_commit_ref": "cb8b5e31dece5ab2663d2ffd218a96ca1ae794c5"
26+
"baked_commit_ref": "b23a9ed5a4714810d83670ad47cc182764c6d464",
27+
"drift_managed_branch": "develop"
2728
}
2829
}
2930
}

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ about: Report a reproducible bug in the current release of netutils
44
---
55

66
### Environment
7-
* Python version: <!-- Example: 3.9 -->
7+
* Python version: <!-- Example: 3.10 -->
88
* netutils version: <!-- Example: 1.0.0 -->
99

1010
<!-- What did you expect to happen? -->

.github/workflows/ci.yml

Lines changed: 11 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on: # yamllint disable-line rule:truthy rule:comments
88
branches:
99
- "main"
1010
- "develop"
11-
tags:
12-
- "v*"
1311
pull_request: ~
1412

1513
env:
@@ -86,10 +84,6 @@ jobs:
8684
poetry-version: "2.1.3"
8785
- name: "Checking: poetry lock file"
8886
run: "poetry run invoke lock --check"
89-
needs:
90-
- "ruff-format"
91-
- "ruff-lint"
92-
- "yamllint"
9387
yamllint:
9488
runs-on: "ubuntu-latest"
9589
env:
@@ -103,17 +97,19 @@ jobs:
10397
poetry-version: "2.1.3"
10498
- name: "Linting: yamllint"
10599
run: "poetry run invoke yamllint"
100+
check-in-docker:
106101
needs:
107102
- "ruff-format"
108103
- "ruff-lint"
109-
pylint:
104+
- "poetry"
105+
- "yamllint"
110106
runs-on: "ubuntu-latest"
111107
strategy:
112108
fail-fast: true
113109
matrix:
114-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
110+
python-version: ["3.10", "3.13"]
115111
env:
116-
PYTHON_VER: "${{ matrix.python-version }}"
112+
INVOKE_NETUTILS_PYTHON_VER: "${{ matrix.python-version }}"
117113
steps:
118114
- name: "Check out repository code"
119115
uses: "actions/checkout@v4"
@@ -138,19 +134,19 @@ jobs:
138134
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
139135
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
140136
build-args: |
141-
PYTHON_VER=${{ env.PYTHON_VER }}
137+
PYTHON_VER=${{ matrix.python-version }}
142138
- name: "Linting: Pylint"
143139
run: "poetry run invoke pylint"
144-
needs:
145-
- "poetry"
146140
pytest:
141+
needs:
142+
- "check-in-docker"
147143
strategy:
148144
fail-fast: true
149145
matrix:
150-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
146+
python-version: ["3.10", "3.11", "3.12", "3.13"]
151147
runs-on: "ubuntu-latest"
152148
env:
153-
PYTHON_VER: "${{ matrix.python-version }}"
149+
INVOKE_NETUTILS_PYTHON_VER: "${{ matrix.python-version }}"
154150
steps:
155151
- name: "Check out repository code"
156152
uses: "actions/checkout@v4"
@@ -175,11 +171,9 @@ jobs:
175171
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
176172
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
177173
build-args: |
178-
PYTHON_VER=${{ env.PYTHON_VER }}
174+
PYTHON_VER=${{ matrix.python-version }}
179175
- name: "Run Tests"
180176
run: "poetry run invoke pytest"
181-
needs:
182-
- "poetry"
183177
changelog:
184178
if: >
185179
contains(fromJson('["develop"]'), github.base_ref) &&
@@ -198,99 +192,3 @@ jobs:
198192
run: |
199193
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
200194
poetry run towncrier check --compare-with origin/${{ github.base_ref }}
201-
publish_gh:
202-
name: "Publish to GitHub"
203-
runs-on: "ubuntu-latest"
204-
# yamllint disable-line rule:quoted-strings
205-
if: startsWith(github.ref, 'refs/tags/v')
206-
env:
207-
INVOKE_NETUTILS_LOCAL: "True"
208-
steps:
209-
- name: "Check out repository code"
210-
uses: "actions/checkout@v4"
211-
- name: "Setup environment"
212-
uses: "networktocode/gh-action-setup-poetry-environment@v6"
213-
with:
214-
poetry-version: "2.1.3"
215-
python-version: "3.12"
216-
poetry-install-options: "--no-root"
217-
- name: "Set env"
218-
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
219-
- name: "Run Poetry Version"
220-
run: "poetry version $RELEASE_VERSION"
221-
- name: "Build Documentation"
222-
run: "poetry run invoke build-and-check-docs"
223-
- name: "Run Poetry Build"
224-
run: "poetry build"
225-
- name: "Upload binaries to release"
226-
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
227-
env:
228-
GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}"
229-
needs:
230-
- "pytest"
231-
publish_pypi:
232-
name: "Push Package to PyPI"
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"
238-
steps:
239-
- name: "Check out repository code"
240-
uses: "actions/checkout@v4"
241-
- name: "Setup environment"
242-
uses: "networktocode/gh-action-setup-poetry-environment@v6"
243-
with:
244-
poetry-version: "2.1.3"
245-
- name: "Set env"
246-
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
247-
- name: "Run Poetry Version"
248-
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"
253-
- name: "Run Poetry Build"
254-
run: "poetry build"
255-
- name: "Push to PyPI"
256-
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
257-
with:
258-
user: "__token__"
259-
password: "${{ secrets.PYPI_API_TOKEN }}"
260-
needs:
261-
- "pytest"
262-
slack-notify:
263-
needs:
264-
- "publish_gh"
265-
- "publish_pypi"
266-
runs-on: "ubuntu-latest"
267-
env:
268-
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
269-
SLACK_MESSAGE: >-
270-
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
271-
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
272-
Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
273-
Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
274-
steps:
275-
- name: "Send a notification to Slack"
276-
# ENVs cannot be used directly in job.if. This is a workaround to check
277-
# if SLACK_WEBHOOK_URL is present.
278-
if: "env.SLACK_WEBHOOK_URL != ''"
279-
uses: "slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
280-
with:
281-
payload: |
282-
{
283-
"text": "${{ env.SLACK_MESSAGE }}",
284-
"blocks": [
285-
{
286-
"type": "section",
287-
"text": {
288-
"type": "mrkdwn",
289-
"text": "${{ env.SLACK_MESSAGE }}"
290-
}
291-
}
292-
]
293-
}
294-
env:
295-
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
296-
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"

.github/workflows/oui_filepull.yml

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,59 @@ name: "OUI-Updates"
44
on: # yamllint disable-line rule:truthy
55
schedule:
66
- cron: "0 2 1 * *"
7+
workflow_dispatch: {}
78

89
jobs:
910
data_gathering:
1011
runs-on: "ubuntu-latest"
1112
env:
1213
BRANCH_NAME: "OUI_Updates"
1314
steps:
14-
# Checkout repo
1515
- name: "Check out code"
1616
uses: "actions/checkout@v4"
1717
with:
1818
ref: "develop"
19-
# Delete old branch if it exists
19+
fetch-depth: 0
20+
21+
- name: "Authenticate git remote"
22+
env:
23+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
24+
run: |
25+
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
26+
2027
- name: "Delete existing branch"
21-
run: "git branch -D $BRANCH_NAME || true"
22-
# Create branch for Flatbot
23-
- name: "Create Flatbot branch"
24-
run: "git checkout -b $BRANCH_NAME"
25-
# Push new branch so Flatbot can make its commit
26-
- name: "Push Flatbot branch"
27-
run: "git push -f --set-upstream origin $BRANCH_NAME"
28-
# This step installs Deno, which is a new Javascript runtime that improves on Node. Can be used for an optional postprocessing step
29-
- name: "Setup deno"
30-
uses: "denoland/setup-deno@main"
31-
with:
32-
deno-version: "v1.10.x"
33-
# The Flat Action step. We fetch the data in the http_url and save it as downloaded_filename
34-
- name: "Fetch data"
35-
uses: "githubocto/flat@v3"
36-
with:
37-
http_url: "https://standards-oui.ieee.org"
38-
downloaded_filename: "./netutils/data_files/oui_mappings.py"
39-
postprocess: "./flat_postprocess/oui_postprocess.ts"
28+
run: |
29+
git branch -D "$BRANCH_NAME" || true
30+
31+
- name: "Create branch"
32+
run: |
33+
git checkout -b "$BRANCH_NAME"
34+
35+
- name: "Push branch"
36+
run: |
37+
git push -f --set-upstream origin "$BRANCH_NAME"
38+
39+
# Fetch data via curl as IEEE has blocked requests/urllib library requests
40+
- name: "Download IEEE OUI data"
41+
run: |
42+
curl -fsSL "https://standards-oui.ieee.org/oui/oui.csv" \
43+
-o "./netutils/data_files/oui_mappings.py"
44+
45+
- name: "Generate oui_mappings.py"
46+
run: "python ./flat_postprocess/oui_postprocess.py ./netutils/data_files/oui_mappings.py"
47+
48+
- name: "Commit changes"
49+
run: |
50+
git config user.name "github-actions[bot]"
51+
git config user.email "github-actions[bot]@users.noreply.github.com"
52+
53+
git add ./netutils/data_files/oui_mappings.py
54+
git diff --cached --quiet || git commit -m "Update OUI mappings"
55+
56+
- name: "Push changes"
57+
run: |
58+
git push origin "$BRANCH_NAME"
59+
4060
pr_creation:
4161
runs-on: "ubuntu-latest"
4262
needs: "data_gathering"

0 commit comments

Comments
 (0)