Skip to content

Commit 2483764

Browse files
authored
Merge branch 'main' into dependabot-pr
2 parents caa4d2c + 046df7a commit 2483764

Some content is hidden

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

52 files changed

+1209
-1160
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
target-branch: dependabot-pr
38
- package-ecosystem: pip
49
directory: "/"
510
schedule:

.github/workflows/tests.yml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,24 @@ jobs:
4848
python-version: '${{ matrix.python }}'
4949
- name: 'Display Python version'
5050
run: 'python -c ''import sys; print(sys.version)'''
51-
- name: 'Install dependencies on macos and fix scrypt install with CFLAGS / LDFLAGS'
52-
if: '${{ matrix.os == ''macos-latest'' }}'
53-
run: |
54-
true ###############################################################
55-
true # install pip, pytest, and python packages
56-
true # asterisk globbing is fragile, so don't use asterisk path
57-
true # globs. Just call out individual files, below.
58-
true ###############################################################
59-
python -m pip install --upgrade pip
60-
pip install -U pytest
61-
true ###############################################################
62-
true # Install ourself
63-
true ###############################################################
64-
true # Fix macos scrypt imports manually because they throw errors otherwise
65-
export CFLAGS="-I$(brew --prefix openssl)/include"
66-
export LDFLAGS="-L$(brew --prefix openssl)/lib"
67-
pip install -U .
68-
- name: 'Install dependencies on Ubuntu Linux / Windows'
69-
if: '${{ matrix.os != ''macos-latest'' }}'
51+
- name: "Install the latest version of uv"
52+
uses: "astral-sh/setup-uv@v6"
53+
with:
54+
version: "latest"
55+
- name: 'Install dependencies on Ubuntu Linux / Windows / MacOS'
7056
run: |
7157
true ###############################################################
72-
true # install pip, pytest, and python packages
73-
true # asterisk globbing is fragile, so don't use asterisk path
74-
true # globs. Just call out individual files, below.
58+
true # install pip
59+
true # asterisk globbing is fragile
7560
true ###############################################################
7661
python -m pip install --upgrade pip
77-
pip install -U pytest
7862
true ###############################################################
79-
true # Install ourself
63+
true # Install all dependencies, including dev deps
64+
true # then install ourself
65+
true #
66+
true # Use --system to install to the test runner system python
8067
true ###############################################################
81-
pip install -U .
68+
uv pip install --system -r pyproject.toml --extra dev .
8269
- name: 'Run pytest'
8370
run: |-
8471
true ###############################################################

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: "pyupgrade"
1818
name: "Auto-standardize python syntax"
1919
args:
20-
- "--py3-plus"
20+
- "--py39-plus"
2121
language: "python"
2222
verbose: true
2323

CHANGES.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,80 @@
44
- Summary:
55
- Insert something here
66

7+
## Version: 0.8.29
8+
9+
- Released: 2025-07-19
10+
- Summary:
11+
- Migrate documentation from reStructuredText to markdown (myST flavor)
12+
- Warn users of `CiscoPassword()` class against usage which will soon be deprecated
13+
14+
## Version: 0.8.28
15+
16+
- Released: 2025-07-12
17+
- Summary:
18+
- Use a better random number generator to create the salt for Cisco Type 8 passwords (Type 9 scrypt passwords already use a better random number generator)
19+
20+
## Version: 0.8.27
21+
22+
- Released: 2025-07-12
23+
- Summary:
24+
- Another attempt to silence SonarQube warnings about scrypt() r being too low. It seems that Cisco IOS requires r=1
25+
26+
## Version: 0.8.26
27+
28+
- Released: 2025-07-12
29+
- Summary:
30+
- Silence SonarQube warnings about scrypt() r being too low. It seems that Cisco IOS requires r=1
31+
32+
## Version: 0.8.25
33+
34+
- Released: 2025-07-12
35+
- Summary:
36+
- Add MacOS back into the test matrix
37+
38+
## Version: 0.8.24
39+
40+
- Released: 2025-07-12
41+
- Summary:
42+
- Remove scrypt and cryptography imports
43+
44+
## Version: 0.8.23
45+
46+
- Released: 2025-07-12
47+
- Summary:
48+
- Replace https://pypi.org/project/scrypt/ with `hashlib.scrypt()`
49+
50+
## Version: 0.8.22
51+
52+
- Released: 2025-07-04
53+
- Summary:
54+
- attempting to retire use of passlib==1.7.4, which is now unmaintained. [`libpass`][2] will be used instead...
55+
56+
## Version: 0.8.21
57+
58+
- Released: 2025-07-04
59+
- Summary:
60+
- Add hypothesis `IPv4Obj()` and `IPv6Obj()` tests
61+
- Remove unused sshd mock
62+
- Remove tomlkit and tox as dev dependencies
63+
- Update typeguard to the latest version
64+
- Remove `requirements/` directory
65+
66+
## Version: 0.8.20
67+
68+
- Released: 2025-05-17
69+
- Summary:
70+
- Add initial context-manager support to `CiscoConfParse()`
71+
- Add initial context-manager support to `ConfigList()`
72+
- Remove support for the `ConfigList().CiscoConfParse` attribute
73+
- Implement `traitlets` on non-container objects instead of typeguard
74+
75+
## Version: 0.8.19
76+
77+
- Released: 2025-05-17
78+
- Summary:
79+
- Make dev dependencies explicit
80+
781
## Version: 0.8.18
882

983
- Released: 2025-05-17
@@ -840,3 +914,4 @@
840914
- Start new project as `ciscoconfparse2` from the original `ciscoconfparse` version 1.9.51
841915

842916
[1]: http://www.pennington.net/py/ciscoconfparse2/
917+
[2]: https://github.com/notypecheck/passlib

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ install_build:
4949
cicd:
5050
@echo "$(COL_CYAN)>> Use CI/CD to publish ciscoconfparse2 pypi artifacts$(COL_END)"
5151
make clean
52+
-git commit --all -m "chore: commit changes I forgot before running 'make cicd'"
5253
# yamlfix doesn't understand pyproject.toml config
5354
# if used in pre-commit...
5455
yamlfix .github/workflows/

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ complex queries about these relationships.
137137

138138
In late 2023, I started a rewrite because [ciscoconfparse][64] is too large
139139
and has some defaults that I wish it didn't have. I froze
140-
[ciscoconfparse][64] PYPI releases at [version 1.9.41][65]; there will be no
140+
[ciscoconfparse][64] PYPI releases at [version 1.9.52][65]; there will be no
141141
more [ciscoconfparse][64] PYPI releases.
142142

143143
What do you do? Upgrade to [ciscoconfparse2][17]!
@@ -151,7 +151,7 @@ Here's why, it:
151151
- Defaults `ignore_blank_lines=False` (this could be a breaking change for old scripts).
152152
- Is better at handling multiple-child-level configurations (such as IOS XR and JunOS)
153153
- Can search for parents and children using an *arbitrary list of ancestors*
154-
- Adds the concept of change commits; this is a config-modification safety feature that [ciscoconfparse][64] lacks
154+
- Adds the concept of change commits; this is a config-modification performance feature that [ciscoconfparse][64] lacks
155155
- Adds an `auto_commit` keyword, which defaults True
156156
- Documents much more of the API
157157
- Intentionally requires a different import statement to minimize confusion between the original and [ciscoconfparse2][17]
@@ -171,21 +171,21 @@ Here's why, it:
171171

172172
- [Python 3](https://python.org/)
173173
- [attrs](https://github.com/python-attrs/attrs)
174-
- [passlib](https://github.com/glic3rinu/passlib)
175-
- [tomlkit](https://github.com/sdispater/tomlkit)
174+
- [libpass](https://github.com/notypecheck/passlib)
176175
- [dnspython](https://github.com/rthalley/dnspython)
177176
- [`hier_config`](https://github.com/netdevops/hier_config)
178177
- [`PyYAML`](https://github.com/yaml/pyyaml)
178+
- [`macaddress`](https://github.com/mentalisttraceur/python-macaddress)
179179
- [`pyparsing`](https://github.com/pyparsing/pyparsing)
180-
- [typeguard](https://github.com/agronholm/typeguard)
180+
- [`traitlets`](https://github.com/ipython/traitlets)
181+
- [`rich`](https://github.com/Textualize/rich)
182+
- [`typeguard`](https://github.com/agronholm/typeguard)
181183
- [loguru](https://github.com/Delgan/loguru)
182184

183185

184186
## Pre-requisites
185187

186-
[The ciscoconfparse2 python package][3] requires Python versions 3.7+.
187-
188-
Type-hinting (work-in-progress) targets Python3.9+ due to the need for `tuple[str, ...]` hints.
188+
[The ciscoconfparse2 python package][3] requires Python versions 3.9+.
189189

190190
## What is the pythonic way of handling script credentials?
191191

@@ -217,7 +217,7 @@ I will not. however, if it's truly a problem for your company, there are commerc
217217

218218
[ciscoconfparse2][3] is licensed [GPLv3][21]
219219

220-
- Copyright (C) 2023-2024 David Michael Pennington
220+
- Copyright (C) 2025 David Michael Pennington
221221

222222
The word \"Cisco\" is a registered trademark of [Cisco Systems][27].
223223

@@ -290,7 +290,7 @@ The word \"Cisco\" is a registered trademark of [Cisco Systems][27].
290290
[62]: https://sonarcloud.io/summary/new_code?id=mpenning_ciscoconfparse2
291291
[63]: https://docs.pytest.org/en/
292292
[64]: https://github.com/mpenning/ciscoconfparse
293-
[65]: https://pypi.org/project/ciscoconfparse/1.9.41/
293+
[65]: https://pypi.org/project/ciscoconfparse/1.9.52/
294294
[66]: https://raw.githubusercontent.com/mpenning/ciscoconfparse2/main/sphinx-doc/_static/ciscoconfparse_logo_bw_01.png
295295
[67]: http://www.pennington.net/py/ciscoconfparse2/cli.html
296296
[68]: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg

README_workflow.md

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

ciscoconfparse2/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.18"
1+
__version__ = "0.8.29"

ciscoconfparse2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from ciscoconfparse2.ccp_util import log_function_call
4141
from ciscoconfparse2.ccp_util import enforce_valid_types
4242
from ciscoconfparse2.ccp_util import fix_repeated_words
43-
from ciscoconfparse2.ccp_util import __ccp_re__
4443
from ciscoconfparse2.ccp_util import _get_ipv4
4544
from ciscoconfparse2.ccp_util import _get_ipv6
4645
from ciscoconfparse2.ccp_util import ip_factory

ciscoconfparse2/ccp_abc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def verbose(self) -> str:
497497

498498
# On BaseCfgLine()
499499
@property
500-
def all_parents(self) -> List:
500+
def all_parents(self) -> list:
501501
"""
502502
:return: A sequence of all parent objects, not including this object
503503
:rtype: List[BaseCfgLine]
@@ -516,7 +516,7 @@ def all_parents(self) -> List:
516516

517517
# On BaseCfgLine()
518518
@property
519-
def all_children(self) -> List:
519+
def all_children(self) -> list:
520520
"""
521521
:return: A sequence of all child objects, not including this object
522522
:rtype: List[BaseCfgLine]
@@ -1112,7 +1112,7 @@ def strip(self, chars: str = None) -> str:
11121112

11131113
# On BaseCfgLine()
11141114
@logger.catch(reraise=True)
1115-
def split(self, sep: str = None, maxsplit: int = -1) -> List[str]:
1115+
def split(self, sep: str = None, maxsplit: int = -1) -> list[str]:
11161116
"""
11171117
Split ``text`` in-place
11181118
@@ -1680,7 +1680,7 @@ def re_list_iter_typed(
16801680
groupdict: dict = None,
16811681
recurse: bool = True,
16821682
debug: bool = False,
1683-
) -> List[Any]:
1683+
) -> list[Any]:
16841684
r"""Use ``regex`` to search the children of
16851685
:class:`~ciscoconfparse2.models_cisco.IOSCfgLine` text and return a list of the contents of
16861686
objects matching the regular expression group, at the integer ``group`` index, cast as

0 commit comments

Comments
 (0)