Skip to content

Commit a7e411b

Browse files
authored
Merge pull request #697 from networktocode/release-1.15.0
Release 1.15.0
2 parents b0aba97 + a12a5b1 commit a7e411b

File tree

81 files changed

+5725
-1201
lines changed

Some content is hidden

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

81 files changed

+5725
-1201
lines changed

.bandit.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Default owner(s) of all files in this repository
2-
* @itdependsnetworks @jeffkala @qduk @abates
2+
* @itdependsnetworks @jeffkala @qduk

.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.7.7 -->
8-
* netutils version: <!-- Example: 1.0.0 -->
7+
* Python version: <!-- Example: 3.8.5 -->
8+
* netutils version: <!-- Example: 1.14.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.0.0 -->
8+
* netutils version: <!-- Example: 1.14.0 -->
99

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

.github/workflows/ci.yml

Lines changed: 111 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
---
22
name: "CI"
3-
on: # yamllint disable-line rule:truthy
4-
- "push"
5-
- "pull_request"
3+
concurrency: # Cancel any existing runs of this workflow for this same PR
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: true
6+
on: # yamllint disable-line rule:truthy rule:comments
7+
push:
8+
branches:
9+
- "main"
10+
- "develop"
11+
tags:
12+
- "v*"
13+
pull_request: ~
614

715
env:
8-
IMAGE_NAME: "netutils"
16+
INVOKE_NETUTILS_IMAGE_NAME: "netutils"
17+
INVOKE_NETUTILS_IMAGE_VER: "latest"
918

1019
jobs:
11-
black:
20+
ruff-format:
1221
runs-on: "ubuntu-24.04"
1322
env:
14-
INVOKE_LOCAL: "True"
23+
INVOKE_NETUTILS_LOCAL: "True"
1524
steps:
1625
- name: "Check out repository code"
1726
uses: "actions/checkout@v4"
1827
- name: "Setup environment"
1928
uses: "networktocode/gh-action-setup-poetry-environment@v6"
2029
with:
21-
python-version: "3.13"
22-
- name: "Linting: black"
23-
run: "poetry run invoke black"
24-
bandit:
30+
poetry-version: "1.8.5"
31+
- name: "Linting: ruff format"
32+
run: "poetry run invoke ruff --action format"
33+
ruff-lint:
2534
runs-on: "ubuntu-24.04"
2635
env:
27-
INVOKE_LOCAL: "True"
36+
INVOKE_NETUTILS_LOCAL: "True"
2837
steps:
2938
- name: "Check out repository code"
3039
uses: "actions/checkout@v4"
3140
- name: "Setup environment"
3241
uses: "networktocode/gh-action-setup-poetry-environment@v6"
3342
with:
34-
python-version: "3.13"
35-
- name: "Linting: bandit"
36-
run: "poetry run invoke bandit"
37-
needs:
38-
- "black"
43+
poetry-version: "1.8.5"
44+
- name: "Linting: ruff"
45+
run: "poetry run invoke ruff --action lint"
3946
mypy:
4047
runs-on: "ubuntu-24.04"
4148
env:
42-
INVOKE_LOCAL: "True"
49+
INVOKE_NETUTILS_LOCAL: "True"
4350
steps:
4451
- name: "Check out repository code"
4552
uses: "actions/checkout@v4"
@@ -50,125 +57,94 @@ jobs:
5057
- name: "Type-Hints: mypy"
5158
run: "poetry run invoke mypy"
5259
needs:
53-
- "black"
54-
pydocstyle:
60+
- "ruff-format"
61+
- "ruff-lint"
62+
check-docs-build:
5563
runs-on: "ubuntu-24.04"
5664
env:
57-
INVOKE_LOCAL: "True"
65+
INVOKE_NETUTILS_LOCAL: "True"
5866
steps:
5967
- name: "Check out repository code"
6068
uses: "actions/checkout@v4"
6169
- name: "Setup environment"
6270
uses: "networktocode/gh-action-setup-poetry-environment@v6"
6371
with:
64-
python-version: "3.13"
65-
- name: "Linting: pydocstyle"
66-
run: "poetry run invoke pydocstyle"
67-
needs:
68-
- "black"
69-
flake8:
72+
poetry-version: "1.8.5"
73+
- name: "Check Docs Build"
74+
run: "poetry run invoke build-and-check-docs"
75+
poetry:
7076
runs-on: "ubuntu-24.04"
7177
env:
72-
INVOKE_LOCAL: "True"
78+
INVOKE_NETUTILS_LOCAL: "True"
7379
steps:
7480
- name: "Check out repository code"
7581
uses: "actions/checkout@v4"
7682
- name: "Setup environment"
7783
uses: "networktocode/gh-action-setup-poetry-environment@v6"
7884
with:
79-
python-version: "3.13"
80-
- name: "Linting: flake8"
81-
run: "poetry run invoke flake8"
85+
poetry-version: "1.8.5"
86+
- name: "Checking: poetry lock file"
87+
run: "poetry lock --check"
8288
needs:
83-
- "black"
89+
- "ruff-format"
90+
- "ruff-lint"
91+
- "mypy"
92+
- "yamllint"
8493
yamllint:
8594
runs-on: "ubuntu-24.04"
8695
env:
87-
INVOKE_LOCAL: "True"
96+
INVOKE_NETUTILS_LOCAL: "True"
8897
steps:
8998
- name: "Check out repository code"
9099
uses: "actions/checkout@v4"
91100
- name: "Setup environment"
92101
uses: "networktocode/gh-action-setup-poetry-environment@v6"
93102
with:
94-
python-version: "3.13"
103+
poetry-version: "1.8.5"
95104
- name: "Linting: yamllint"
96105
run: "poetry run invoke yamllint"
97106
needs:
98-
- "black"
99-
build:
100-
strategy:
101-
fail-fast: true
102-
matrix:
103-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
104-
runs-on: "ubuntu-24.04"
105-
env:
106-
PYTHON_VER: "${{ matrix.python-version }}"
107-
steps:
108-
- name: "Check out repository code"
109-
uses: "actions/checkout@v4"
110-
- name: "Setup environment"
111-
uses: "networktocode/gh-action-setup-poetry-environment@v6"
112-
- name: "Get image version"
113-
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
114-
- name: "Set up Docker Buildx"
115-
id: "buildx"
116-
uses: "docker/setup-buildx-action@v1"
117-
- name: "Build"
118-
uses: "docker/build-push-action@v2"
119-
with:
120-
builder: "${{ steps.buildx.outputs.name }}"
121-
context: "./"
122-
push: false
123-
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
124-
file: "./Dockerfile"
125-
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
126-
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
127-
build-args: |
128-
PYTHON_VER=${{ env.PYTHON_VER }}
129-
needs:
130-
- "bandit"
131-
- "mypy"
132-
- "pydocstyle"
133-
- "flake8"
134-
- "yamllint"
107+
- "ruff-format"
108+
- "ruff-lint"
135109
pylint:
136110
runs-on: "ubuntu-24.04"
137111
strategy:
138112
fail-fast: true
139113
matrix:
140-
python-version: ["3.13"]
114+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
141115
env:
142116
PYTHON_VER: "${{ matrix.python-version }}"
143117
steps:
144118
- name: "Check out repository code"
145119
uses: "actions/checkout@v4"
146120
- name: "Setup environment"
147121
uses: "networktocode/gh-action-setup-poetry-environment@v6"
122+
with:
123+
poetry-version: "1.8.5"
148124
- name: "Get image version"
149-
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
125+
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
150126
- name: "Set up Docker Buildx"
151127
id: "buildx"
152-
uses: "docker/setup-buildx-action@v1"
153-
- name: "Load the image from cache"
154-
uses: "docker/build-push-action@v2"
128+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
129+
- name: "Build"
130+
uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0
155131
with:
156132
builder: "${{ steps.buildx.outputs.name }}"
157133
context: "./"
158134
push: false
159135
load: true
160-
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
136+
tags: "${{ env.INVOKE_NETUTILS_IMAGE_NAME }}:${{ env.INVOKE_NETUTILS_IMAGE_VER }}"
161137
file: "./Dockerfile"
162-
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
163-
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
138+
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
139+
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
164140
build-args: |
165141
PYTHON_VER=${{ env.PYTHON_VER }}
166142
- name: "Debug: Show docker images"
167143
run: "docker image ls"
168144
- name: "Linting: Pylint"
169145
run: "poetry run invoke pylint"
170146
needs:
171-
- "build"
147+
- "poetry"
172148
pytest:
173149
strategy:
174150
fail-fast: true
@@ -182,61 +158,58 @@ jobs:
182158
uses: "actions/checkout@v4"
183159
- name: "Setup environment"
184160
uses: "networktocode/gh-action-setup-poetry-environment@v6"
161+
with:
162+
poetry-version: "1.8.5"
185163
- name: "Get image version"
186-
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
164+
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
187165
- name: "Set up Docker Buildx"
188166
id: "buildx"
189-
uses: "docker/setup-buildx-action@v1"
190-
- name: "Load the image from cache"
191-
uses: "docker/build-push-action@v2"
167+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
168+
- name: "Build"
169+
uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0
192170
with:
193171
builder: "${{ steps.buildx.outputs.name }}"
194172
context: "./"
195173
push: false
196174
load: true
197-
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
175+
tags: "${{ env.INVOKE_NETUTILS_IMAGE_NAME }}:${{ env.INVOKE_NETUTILS_IMAGE_VER }}"
198176
file: "./Dockerfile"
199-
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
200-
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
177+
cache-from: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
178+
cache-to: "type=gha,scope=${{ env.INVOKE_NETUTILS_IMAGE_NAME }}-${{ env.INVOKE_NETUTILS_IMAGE_VER }}-py${{ matrix.python-version }}"
201179
build-args: |
202180
PYTHON_VER=${{ env.PYTHON_VER }}
203181
- name: "Debug: Show docker images"
204182
run: "docker image ls"
205183
- name: "Run Tests"
206184
run: "poetry run invoke pytest"
207-
- name: "Install Optional Dependencies"
208-
run: "poetry run poetry install --extras optionals"
209-
- name: "Run Optional Tests"
210-
run: "poetry run pytest tests/unit/test_lib_helpers_optionals.py tests/unit/test_acl.py"
211185
needs:
212186
- "pylint"
213187
publish_gh:
214188
name: "Publish to GitHub"
215189
runs-on: "ubuntu-24.04"
216-
if: "startsWith(github.ref, 'refs/tags/v')"
190+
# yamllint disable-line rule:quoted-strings
191+
if: startsWith(github.ref, 'refs/tags/v')
217192
steps:
218193
- name: "Check out repository code"
219194
uses: "actions/checkout@v4"
220-
- name: "Set up Python"
221-
uses: "actions/setup-python@v2"
195+
- name: "Setup environment"
196+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
222197
with:
223-
python-version: "3.13"
224-
- name: "Install Python Packages"
225-
run: "pip install poetry"
198+
poetry-version: "1.8.5"
199+
python-version: "3.12"
200+
poetry-install-options: "--no-root"
226201
- name: "Set env"
227202
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
228203
- name: "Run Poetry Version"
229204
run: "poetry version $RELEASE_VERSION"
205+
- name: "Build Documentation"
206+
run: "poetry run invoke build-and-check-docs"
230207
- name: "Run Poetry Build"
231208
run: "poetry build"
232209
- name: "Upload binaries to release"
233-
uses: "svenstaro/upload-release-action@v2"
234-
with:
235-
repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}"
236-
file: "dist/*"
237-
tag: "${{ github.ref }}"
238-
overwrite: true
239-
file_glob: true
210+
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
211+
env:
212+
GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}"
240213
needs:
241214
- "pytest"
242215
publish_pypi:
@@ -265,3 +238,38 @@ jobs:
265238
password: "${{ secrets.PYPI_API_TOKEN }}"
266239
needs:
267240
- "pytest"
241+
slack-notify:
242+
needs:
243+
- "publish_gh"
244+
- "publish_pypi"
245+
runs-on: "ubuntu-24.04"
246+
env:
247+
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
248+
SLACK_MESSAGE: >-
249+
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
250+
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
251+
Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
252+
Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
253+
steps:
254+
- name: "Send a notification to Slack"
255+
# ENVs cannot be used directly in job.if. This is a workaround to check
256+
# if SLACK_WEBHOOK_URL is present.
257+
if: "env.SLACK_WEBHOOK_URL != ''"
258+
uses: "slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
259+
with:
260+
payload: |
261+
{
262+
"text": "${{ env.SLACK_MESSAGE }}",
263+
"blocks": [
264+
{
265+
"type": "section",
266+
"text": {
267+
"type": "mrkdwn",
268+
"text": "${{ env.SLACK_MESSAGE }}"
269+
}
270+
}
271+
]
272+
}
273+
env:
274+
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
275+
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"

.github/workflows/proto_filepull.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
# Push new branch so Flatbot can make its commit
2626
- name: "Push Flatbot branch"
2727
run: "git push -f --set-upstream origin $BRANCH_NAME"
28-
# Install Black
29-
- name: "Install Python Black"
30-
run: "pip install black"
28+
# Install Ruff
29+
- name: "Install Python Ruff"
30+
run: "pip install ruff"
3131
# This step installs Deno, which is a new Javascript runtime that improves on Node. Can be used for an optional postprocessing step
3232
- name: "Setup deno"
3333
uses: "denoland/setup-deno@main"

0 commit comments

Comments
 (0)