Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
7090478
Import the 2.9 development line (Python 3.11+, NETCONF)
Oct 30, 2026
848dbac
Add regression safety nets for the 3.0 modernization
Oct 30, 2026
fef99ad
Restore the public Lexer.forward()
Oct 30, 2026
196760e
Move to pyproject.toml, hatchling and uv with a src layout
Oct 30, 2026
c7baea3
Port to Python 3.15 and annotate for a green mypy baseline
Oct 30, 2026
68bb2d8
Keep test data byte-identical across platforms
Oct 30, 2026
466247c
Format the code base with ruff
Oct 30, 2026
b16e2b6
Apply safe ruff fixes and add a lint baseline
Oct 30, 2026
fae2abc
Add mypy, pre-commit and GitHub Actions CI
Oct 30, 2026
86d7cf6
Use the MIT license header in the exscript CLI
Oct 30, 2026
25b38c6
Add record/replay tests with self-collected recordings
Oct 31, 2026
23ef68b
Verify SSH host keys before sending credentials
Oct 31, 2026
24500b2
Keep passwords and device output out of logs and exceptions
Oct 31, 2026
9e06b6f
Redesign the OpenTelemetry instrumentation
Oct 31, 2026
b3412cd
Run templates in secure mode by default
Oct 31, 2026
a1da726
Parse XML without entities, DTDs or network access
Oct 31, 2026
0b4a2e8
Label the telnetlib code derived from CPython
Nov 1, 2026
154a5b7
Add a security policy, CodeQL, dependency audits and Dependabot
Nov 1, 2026
23eab16
Remove eval() and the shell from the CLI
Nov 1, 2026
aa0532b
Fire job_started before the job runs
Nov 2, 2026
898bc40
Make the API report work against the 2.x branch layout
Nov 2, 2026
5b25d11
Base the Telnet client on CPython 3.12's telnetlib
Nov 2, 2026
cc02037
Make util.syslog.netlog() work, also on Windows
Nov 3, 2026
d6d3c1a
Accept Windows paths in pseudo:// URLs
Nov 3, 2026
40a3ca8
Make the tests pass on Windows
Nov 3, 2026
26d4d78
Run the Windows test job with the requested Python
Nov 3, 2026
f4fe3b1
Rewrite the generic prompt pattern without catastrophic backtracking
Nov 3, 2026
77fe27a
Unify expect() for all protocol adapters
Nov 3, 2026
b6893dc
Settle generic prompts and skip escape sequences
Nov 3, 2026
171fcd4
Speed up the isam prompt pattern
Nov 3, 2026
99ded2e
Fix monitors after expect() and stop copying the buffer
Nov 3, 2026
56255d8
Reassemble NETCONF chunks in linear time
Nov 3, 2026
99f82a2
Space connects per host and reconnect only after failed attempts
Nov 3, 2026
2d4af86
Close reliably, try all SSH addresses and fix interact()
Nov 3, 2026
dc22af4
Read and write text files as UTF-8 on every platform
Nov 3, 2026
8eb85ab
Scope NETCONF pretty-printing and lock the shared buffer
Nov 3, 2026
af3f704
Run the benchmarks in CI
Nov 3, 2026
7e53004
Load lxml and ncclient only when NETCONF needs them
Nov 3, 2026
d94d879
Give automated sessions a fixed, wide terminal
Nov 3, 2026
281dfa8
Record with Exscript's terminal size and replay with the recorded one
Nov 3, 2026
050e9e7
Fail the benchmark job when a limit is exceeded
Nov 3, 2026
42497a8
Report the OS-guess accuracy in CI
Nov 3, 2026
bcbafcf
Stop weak signals from selecting the wrong driver
Nov 3, 2026
e986353
Run the tests with warnings as errors
Nov 3, 2026
4ff58f6
Build the documentation with Sphinx and furo, in CI and on Read the Docs
Nov 3, 2026
aa2aa61
Publish tagged releases to PyPI with Trusted Publishing
Nov 3, 2026
0232ebb
Add issue forms and a pull request template
Nov 3, 2026
c385f4c
Do not echo the password in the virtual device
Nov 3, 2026
3bf33f6
Fix disable_driver()
Nov 3, 2026
5a92131
Correct docstrings that the documentation shows wrongly
Nov 3, 2026
81b861c
Document drivers, NETCONF, security, platforms and the migration to 3.0
Nov 3, 2026
2c1ad85
Check the documentation links weekly
Nov 3, 2026
73e2ff3
Let the test servers listen in start() and choose free ports
Nov 3, 2026
f681ea4
Check annotated modules strictly and measure docstring coverage
Nov 3, 2026
c28bd00
Type-check against the paramiko and lxml stubs
Nov 3, 2026
51820c9
Annotate the basic utility modules
Nov 4, 2026
8be7106
Annotate Account, Host, PrivateKey and the loggers
Nov 4, 2026
3d96c99
Annotate the protocol core with types and docstrings
Nov 4, 2026
6c65f1e
Annotate the template parser and interpreter
Nov 4, 2026
915c94d
Check the annotated modules strictly
Nov 4, 2026
f9f6d7e
Test the exscript command line tool
Nov 4, 2026
9eda3ec
Fix the login error pattern of the ericsson_ban driver
Nov 10, 2026
63a4bac
Fix get_filename() checking that the file exists
Nov 10, 2026
e571191
Add the SSH algorithm and authentication options to the changelog
Nov 10, 2026
72e1070
Annotate the emulators
Nov 10, 2026
2204ede
Annotate the test servers
Nov 10, 2026
6e01d4a
Annotate the Telnet and Dummy adapters
Nov 10, 2026
d14249c
Annotate the device drivers
Nov 10, 2026
7ef0aa7
Annotate the functions of the template language
Nov 10, 2026
8a17753
Annotate file, interact and log in Exscript.util
Nov 10, 2026
ac9a726
Check the newly annotated modules strictly
Nov 10, 2026
eaef21d
Annotate template, start, mail and report in Exscript.util
Nov 10, 2026
0622fe2
Recognize the prompt of the Junos root shell
Nov 10, 2026
227f37d
Recognize the NX-OS banner of newer versions
Nov 10, 2026
36c9e56
Annotate the SSH2 and NETCONF adapters
Nov 10, 2026
d6bb1dc
Annotate the OpenTelemetry instrumentation and three drivers
Nov 10, 2026
5faa87e
Log the fingerprints of SSH keys like OpenSSH
Nov 10, 2026
a52186e
Answer every keyboard-interactive prompt
Nov 10, 2026
07d614c
Continue SSH logins after a partial authentication
Nov 10, 2026
b2d33ee
Test the lexer and the tokens of parselib
Nov 10, 2026
fc13a1e
Test the interpreter of the template language
Nov 10, 2026
54851d8
Test the standard library of the template language
Nov 10, 2026
2a4bd64
Close the SMTP session of util.mail.send()
Nov 10, 2026
d46925f
Document the authorization password in host addresses
Nov 10, 2026
45ccfa4
Answer frequent questions in the documentation
Nov 10, 2026
5e215fa
Send the last line of a template without a line break
Nov 10, 2026
967183c
Mark the package as typed
Nov 10, 2026
ed43f5f
Raise a CompileError for Unicode escapes above U+10FFFF
Nov 10, 2026
2181005
Require a regular expression after extract
Nov 10, 2026
707c895
Keep the variables of the caller in compile-time declarations
Nov 10, 2026
e3e03fe
Evaluate operators of the same priority from left to right
Nov 10, 2026
838faed
Evaluate the right operand of and and or only if needed
Nov 10, 2026
8bc5dfa
Drop lines with only whitespace from the next command
Nov 10, 2026
a3ed5c5
Raise ExecuteErrors for runtime errors in expressions and statements
Nov 10, 2026
3903c24
Raise an ExecuteError for regular expressions as operands
Nov 10, 2026
5fe79ce
Test the sessions of the SSH and Telnet test servers
Nov 10, 2026
c1ea4c2
Test more of interact, start, impl and collections in Exscript.util
Nov 10, 2026
336d1e7
Test the protocol adapters more thoroughly
Nov 10, 2026
4645117
Remove Exscript.servers.HTTPd
Nov 10, 2026
ae87fa6
Point error positions behind escape sequences to the variable
Nov 10, 2026
32e690f
Detect functions in strings with callable()
Nov 10, 2026
632fab4
Raise a CompileError for long unmatched input in the lexer
Nov 10, 2026
5427bf4
Raise the protocol errors of template functions unchanged
Nov 10, 2026
d01043b
Never turn on paramiko's packet dumps
Nov 10, 2026
18ee4aa
Handle the OSError of getuser() in interact.get_user()
Nov 10, 2026
184aadd
Raise LoginFailure for failed key logins
Nov 10, 2026
2b38e8a
Handle an unknown user name in util.mail
Nov 10, 2026
14750ab
Log the errors of the logout in close()
Nov 10, 2026
dd5271c
Start the test servers of ExpectTest without sleeping
Nov 10, 2026
25f167a
Keep eof set if close() runs while Telnet.receive() waits
Nov 10, 2026
bbe2a71
Fix deepcopy and pickling of OrderedDefaultDict
Nov 10, 2026
c0e728e
Accept SSH keys that are not stored in a file
Nov 10, 2026
e19fe61
Raise a CompileError for octal escapes above \377
Nov 10, 2026
59608c2
Reject NETCONF RPC bodies that are not one XML element
Nov 10, 2026
39fa73a
Raise the first error of a NETCONF reply, not a warning before it
Nov 10, 2026
7dbe264
Use the current timeout for the RPCs of a NETCONF session
Nov 10, 2026
2c58fb6
Raise ConnectionClosedException when a NETCONF server closes
Nov 10, 2026
46a111a
Use values that are not lists like lists in operators and statements
Nov 10, 2026
9ad402b
Document that a connection belongs to one thread
Nov 10, 2026
5353a64
Stop offering 'None' in prompt() without a default
Nov 10, 2026
ddd5ef7
Accept several blanks between the words of "is not" and "not in"
Nov 10, 2026
24ca2ca
Handle an unknown user name for --ssh-key in exscript
Nov 10, 2026
ef0592a
End ncclient's IO thread when a NETCONF connection closes
Nov 10, 2026
39b5cd2
Use UTF-8 for NETCONF sessions
Nov 10, 2026
48a912a
Start no comment behind escaped characters
Nov 10, 2026
60ef889
Decode SSH banners that are not valid in the encoding
Nov 10, 2026
ff4a195
Start a comment behind an RPC as behind a code block
Nov 10, 2026
1eacddb
Store tuples as lists in variables
Nov 10, 2026
4839f92
Measure branch coverage and enforce a floor in CI
Nov 10, 2026
b8844fd
Test the reassembly of NETCONF chunks with any text
Nov 10, 2026
b2ead54
Point error positions before code blocks and RPCs to the variable
Nov 10, 2026
870c9a5
List the removed internals of the template interpreter
Nov 10, 2026
0070c55
Raise for unknown driver names in the Protocol constructor
Nov 10, 2026
21ca5c9
Frame NETCONF messages on bytes, and buffer whole messages
Nov 10, 2026
2278385
Run the jobs of the queue in threads only
Nov 10, 2026
343c037
Test the queue under gevent in CI, and document gevent and asyncio
Nov 10, 2026
e504d85
Treat the fork warning in the tests as an error again
Nov 10, 2026
36b37a8
Annotate the queue and the work queue
Nov 10, 2026
c35f376
Drop the cast of the now annotated Queue in util.start
Nov 10, 2026
83fce70
Match the prompts of junos and mrv in linear time
Nov 10, 2026
13b13fa
Add new jobs of priority_enqueue_or_raise() at the front
Nov 10, 2026
6a3d57b
Leave the pipeline unchanged when it rejects a duplicate name
Nov 10, 2026
2ea80e0
Keep passwords out of data_sent_event
Nov 10, 2026
b94e418
Explain why the S/Key one-time password uses MD4
Nov 10, 2026
c3b549f
Give a job its id before the main loop can start it
Nov 10, 2026
5c48a6b
Let tasks of the queue know each job before it can start
Nov 10, 2026
185537f
Set the host driver of the queue before the job is enqueued
Nov 10, 2026
4efaeae
Emit queue_empty_event when the work queue becomes empty
Nov 10, 2026
6b8a1cd
Check the running jobs of the work queue in the test thread
Nov 10, 2026
c5fd0b9
Fix the status bar of the queue on narrow terminals
Nov 10, 2026
10d94ac
Install the command line tools as console entry points
Nov 10, 2026
f9547eb
Make two network tests independent of WSL's consomme networking
Nov 10, 2026
db364d8
End the exscript command at once on Ctrl+C on every platform
Nov 10, 2026
e8a2834
Add docstrings to the util and workqueue packages
Nov 10, 2026
521fec2
Restore the --version option of the exscript command
Nov 10, 2026
438aaed
Check the type coverage in CI
Nov 10, 2026
8bd89b5
Keep the order of sleeping items at the head of the pipeline
Nov 10, 2026
1687d75
Test the logging setup, and the errors and options of log files
Nov 11, 2026
f731948
Keep all output of a job in a log file that is opened with mode w
Nov 11, 2026
0d8d343
Release the accounts of owners in AccountPool.reset()
Nov 11, 2026
757c3fc
Test the locking of accounts and the account pools
Nov 11, 2026
6355d2a
Test the errors and options of the readers of host and account files
Nov 11, 2026
7e7b9dc
Require a docstring for every module, class and function
Nov 11, 2026
455be7c
Test the placeholders, header errors and attachments of mail templates
Nov 11, 2026
b8be8b6
Measure the coverage of subprocesses that the tests start
Nov 11, 2026
478a57e
Mark the change of queue_empty_event as incompatible
Nov 11, 2026
2b1b08e
Count only the enqueued jobs in the progress of the queue
Nov 11, 2026
3cbae4a
Drop the threading mode argument of the exscript command
Nov 11, 2026
12fdaac
Test the end of the replication and the errors of NETCONF sessions
Nov 11, 2026
e285ac6
Expand ~ and variables in the host files of the exscript command
Nov 11, 2026
fa71e6b
Split -d assignments of the exscript command at the first =
Nov 11, 2026
8272c7f
Count jobs that end at the same time under a lock
Nov 11, 2026
2046bb3
Accept only complete IPv4 addresses in is_ip()
Nov 11, 2026
21b2f50
Test the errors of the IP address helpers
Nov 11, 2026
eedfef2
Test the options of the exscript command in-process
Nov 11, 2026
f6e4057
Give the NETCONF test sessions more time on loaded machines
Nov 11, 2026
bef7daa
Make the helpers of Exscript.cli private
Nov 11, 2026
010ddf1
Test the hp_pro_curve driver with a ProCurve banner and prompt
Nov 11, 2026
cf0601b
Unpause the queue before tearDown() of QueueTest destroys it
Nov 11, 2026
a86e765
Recognize the configuration prompts of HP ProCurve switches
Nov 11, 2026
95840fa
Draw the status bar of the queue in one step per job
Nov 11, 2026
19c867f
Test the Cisco drivers with the prompts and messages of the devices
Nov 11, 2026
68873d9
Recognize the "Invalid command" error of NX-OS
Nov 11, 2026
8899328
Test SSH2 logins without a method left and closes with bad output
Nov 11, 2026
c5d17da
Raise the error of opening the file in get_accounts_from_file()
Nov 11, 2026
a82998c
Test the Juniper, Huawei and ZTE drivers with the output of the devices
Nov 11, 2026
503bb3b
Correct the help of -n of the exscript command
Nov 11, 2026
4e49bc4
Leave __filename__ undefined for -e of the exscript command
Nov 11, 2026
5de4685
Test the drivers of switches and controllers with their prompts
Nov 11, 2026
7be9998
Test the drivers of routers, firewalls and WAN appliances
Nov 11, 2026
15aa744
Leave the Windows fallback for termios out of the coverage
Nov 11, 2026
227567a
Test the command files and the copies of the emulator's command sets
Nov 11, 2026
fd5bd17
Test copies of hosts, invalid URIs, and hosts without variables
Nov 11, 2026
f501c71
Test percent signs, empty variables and partial URLs
Nov 11, 2026
b2d7ec7
Show the intended message when Url.from_string() gets no string
Nov 11, 2026
f2372d8
Test the SSH server with a client that disappears during a command
Nov 11, 2026
68061d2
Test the argument checks of the S/Key one-time password
Nov 11, 2026
af94ddf
Test the hooks, the dependency check and unfitting calls of the tracing
Nov 11, 2026
aac325c
Raise LoginFailure at a password prompt for an account without one
Nov 11, 2026
2130cb7
Leave if __name__ == "__main__" blocks out of the coverage
Nov 10, 2026
7e1eb27
Test the reports of failed actions and the options of format()
Nov 11, 2026
d2c20d9
Test the detection of the type of a key file
Nov 11, 2026
02defa6
Test the decorators that log the sessions of a queue
Nov 11, 2026
4ca0103
Test the matching of the response of a connection
Nov 11, 2026
f648e00
Test disconnecting a function that is not connected to an event
Nov 11, 2026
3660678
Test the version of a source tree without an installation
Nov 11, 2026
14806c2
Ignore the coverage data files of subprocesses
Nov 11, 2026
7709c22
Raise the minimum test coverage in CI to 97 %
Nov 11, 2026
445fdd3
Recognize the NX-OS login prompt of Telnet and the console
Nov 11, 2026
0faedf2
Guess NX-OS at the login prompt of Telnet and the console
Nov 11, 2026
d817980
Recognize the error messages of NX-OS
Nov 11, 2026
63eb557
Recognize NX-OS prompts with more than one mode
Nov 11, 2026
2146d4b
Guess NX-OS by its NETCONF capabilities
Nov 11, 2026
f3b7309
Move the NX-OS tests to the tests of the drivers
Nov 11, 2026
4501b7d
Merge the changelog entries of the NX-OS error messages
Nov 11, 2026
5993b83
End ncclient's thread also if a callback blocks it during close()
Nov 11, 2026
8c7723b
Return from interact() also if the terminal is gone
Nov 11, 2026
657390f
Keep escaped placeholders of mail templates as text
Nov 11, 2026
e6a2409
Remove three private helpers that nothing calls
Nov 11, 2026
47a4f33
Give the SSH test sessions more time on loaded machines
Nov 11, 2026
90e0dbb
Set SO_REUSEADDR only on the fixed ports of the test servers
Nov 11, 2026
667fe66
Try another port when a test server cannot listen on its free port
Nov 11, 2026
ce291fe
Let the listeners of the tests take a port like the test servers
Nov 11, 2026
7d7edd5
Keep standard input open when interact() ends
Nov 11, 2026
6f7dd29
Restore the SIGWINCH handler if the first resize of interact() fails
Nov 11, 2026
0c37b4f
Stop the test servers within 0.1 seconds of exit()
Nov 11, 2026
0ff4468
Turn off the connect rate limit in SSH2Test and TelnetTest
Nov 11, 2026
65b4961
Run the server tests that SSHdTest and TelnetdTest inherit
Nov 11, 2026
b0c7617
Give SSHd a host key of its own instead of the user's key
Nov 11, 2026
b806c4c
Remove util.daemonize, util.pidutil and util.sigintcatcher
Nov 3, 2026
deb8704
Report API changes in the job summary instead of failing
Nov 3, 2026
52cd679
Link the ncclient issue of the NETCONF framing workaround
Nov 11, 2026
56bb41e
Read the output of the exscript command as UTF-8 on Windows
Nov 11, 2026
60b5d87
Close the connection to the SSH agent after the login
Nov 11, 2026
02042fa
Keep the prompt after login(flush=False) with nxos, bigip and rios
Nov 11, 2026
ebde397
Silence paramiko per connection instead of disabling its logger
Nov 11, 2026
1115688
Remove the unused good_pub_key of the SSHd server interface
Nov 11, 2026
5ea6322
Show colors and a progress display in the commands with rich
Nov 11, 2026
61aa86f
Add command files for recording NX-OS sessions
Nov 11, 2026
0420b61
Document the API changes against 2.6.32 in the changelog and guide
Nov 11, 2026
6eb1c0e
Fix the lower bounds of the dependencies and extras
Nov 11, 2026
757df61
Test the lowest dependency versions in CI
Nov 11, 2026
130ed2d
State the required type coverage in CHANGES.md, not a measured one
Nov 11, 2026
7200bd4
Accept values with blanks in exscript -d
Nov 11, 2026
f2ac135
Raise binascii.Error and ValueError for undecodable account passwords
Nov 11, 2026
6240a85
Raise a ValueError and NameError for undefined template variables
Nov 11, 2026
57b6629
Remove CR from the stdout and logfile output of Dummy
Nov 11, 2026
f8c7db2
Describe the changes against 2.6.32 in the changelog
Nov 11, 2026
6a783d2
Use a terminal width of 510, since BusyBox's telnetd misreads 511
Nov 11, 2026
24ddd09
Make the lab command files safe to record and publish
Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mechanical reformatting commits; use: git config blame.ignoreRevsFile .git-blame-ignore-revs
# Format the code base with ruff
466247c9eb884d2da1b9900bff82a6fa464c76a1
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto eol=lf
*.png binary
# Device captures and expected outputs must stay byte-identical (CRLF is intentional).
tests/Exscript/protocols/banners/** -text
tests/templates/** -text
# Recorded sessions and their expected results are generated; collapse them in diffs.
tests/recordings/*/*.jsonl linguist-generated
tests/recordings/*/*.golden.json linguist-generated
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug report
description: Something does not work as documented.
labels: ["bug"]
body:
- type: markdown
attributes:
value: >
Thank you for reporting a problem. Please report security problems
privately instead, as described in SECURITY.md. Remove passwords, host
names, addresses and other data of your network from everything you
paste here.
- type: input
id: version
attributes:
label: Exscript version
description: 'Output of: python -c "import Exscript; print(Exscript.__version__)"'
placeholder: 3.0.0
validations:
required: true
- type: input
id: environment
attributes:
label: Python version and operating system
placeholder: Python 3.13.9 on Ubuntu 24.04
validations:
required: true
- type: dropdown
id: area
attributes:
label: Area
options:
- Connecting and logging in (SSH, Telnet)
- Sending commands and waiting for responses
- NETCONF
- Template language or the exscript command
- Other
validations:
required: true
- type: input
id: device
attributes:
label: Device operating system and version
description: If a device is involved.
placeholder: Cisco IOS XR 7.11.2
- type: textarea
id: description
attributes:
label: What happened, and what did you expect?
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Script or template that shows the problem
description: As short as possible.
render: python
- type: textarea
id: log
attributes:
label: Traceback and log
description: >
The traceback, and the conversation with the device: connect with
logfile="session.log", or with debug=5 after
logging.basicConfig(level=logging.DEBUG).
render: text
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Documentation
url: https://exscript.readthedocs.io
about: Tutorials, the template language and the API reference.
- name: Report a vulnerability
url: https://github.com/knipknap/exscript/security/advisories/new
about: Report security problems privately, not in a public issue.
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/device_support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Device not detected or not supported
description: Exscript picks the wrong driver for a device, or has none for it.
body:
- type: markdown
attributes:
value: >
Exscript picks the driver from the login banner, the prompts and the
protocol. To improve this, we need the text that the device sends until
the first command prompt. Remove passwords, host names, addresses and
other data of your network first.
- type: input
id: version
attributes:
label: Exscript version
description: 'Output of: python -c "import Exscript; print(Exscript.__version__)"'
placeholder: 3.0.0
validations:
required: true
- type: input
id: device
attributes:
label: Device vendor, model, operating system and version
placeholder: Cisco NCS 5501, IOS XR 7.11.2
validations:
required: true
- type: dropdown
id: protocol
attributes:
label: Protocol
options:
- SSH
- Telnet
- NETCONF
validations:
required: true
- type: input
id: guessed
attributes:
label: Driver that Exscript picks
description: Output of conn.guess_os() after conn.login().
placeholder: generic
validations:
required: true
- type: input
id: expected
attributes:
label: Driver you expected
description: The name of an existing driver, or "new driver".
placeholder: ios_xr
- type: textarea
id: transcript
attributes:
label: Login transcript
description: >
Everything from connecting to the first command prompt, including the
banner and all prompts, for example from logfile="session.log". With
debug=3 after logging.basicConfig(level=logging.DEBUG), the log also
shows the text that the detection looked at.
render: text
validations:
required: true
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: uv
directory: /
schedule:
interval: weekly
# A library keeps its lower bounds; only the lockfile used for development moves.
versioning-strategy: lockfile-only
cooldown:
default-days: 7
groups:
python:
patterns: ["*"]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
groups:
actions:
patterns: ["*"]
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- What does this change, and why? Link the issue it fixes, e.g. "Fixes #123". -->

- [ ] Tests cover the change (`uv run pytest`).
- [ ] `CHANGES.md` describes changes that users notice.
- [ ] Documentation and docstrings are updated.
- [ ] Recordings and logs contain no passwords, host names or addresses of real networks.
191 changes: 191 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
name: CI

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint and type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0 # hatch-vcs derives the version from tags
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- run: uvx pre-commit run --all-files --show-diff-on-failure
- name: Type check and type coverage (mypy; fails below the minimum)
shell: bash # with pipefail; the default shell lets tee hide a failure
run: uv run --frozen python tools/type_coverage.py --check | tee -a "$GITHUB_STEP_SUMMARY"

test:
name: Test ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Windows, macOS and free-threading are not part of the gate until their baselines are green.
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.12", "3.13", "3.14", "3.15"]
experimental: [false]
include:
# lxml has not declared support for free-threading, so importing it enables the GIL;
# PYTHON_GIL=0 keeps it off, so that this job tests without the GIL.
- { os: ubuntu-latest, python: "3.14t", experimental: true, gil: "0" }
- { os: windows-latest, python: "3.14", experimental: true }
- { os: macos-latest, python: "3.14", experimental: true }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Run tests
shell: bash # also on Windows, where the default shell does not expand "$PYTHON"
env:
PYTHON: ${{ matrix.python }}
PYTHON_GIL: ${{ matrix.gil }} # empty, i.e. ignored, except for free-threading
# Line and branch coverage: 98.6 % on 2026-11-11. Raise the floor, never lower it.
# Windows and macOS skip the tests of the POSIX terminal, so it applies on Ubuntu only.
COV_FAIL_UNDER: ${{ matrix.os == 'ubuntu-latest' && '97' || '0' }}
run: >-
uv run --frozen --python "$PYTHON" pytest --cov=Exscript
--cov-report=term-missing:skip-covered --cov-fail-under="$COV_FAIL_UNDER"

lowest:
name: Lowest dependency versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
# Only the dependencies of Exscript and its extras get their lowest versions, the test
# tools the newest that fit. uv pip neither uses nor changes uv.lock.
- name: Install the lowest versions that pyproject.toml allows, on Python 3.12
run: |
uv venv --python 3.12
uv pip compile pyproject.toml --all-extras --resolution lowest-direct --python-version 3.12 -o lowest.txt
uv pip install -r lowest.txt -e . --group test
# The tests of the extras skip instead of failing if these imports fail.
uv run --no-sync python -c 'import Exscript.contrib.otel, rich.console'
- name: Run tests
run: uv run --no-sync pytest -p no:cacheprovider

build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- run: uv build
- run: uvx twine check --strict dist/*
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dist
path: dist/

benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Run the benchmarks (fails on 4x the targets)
shell: bash # with pipefail; the default shell lets tee hide a failure
run: uv run --frozen --python 3.14 python tools/bench_bulk.py --json bench.json --check 2>&1 | tee bench.txt
- name: Add the results to the summary
if: always()
run: |
{
echo '### Benchmarks (4 MiB, median of 3 runs)'
echo '```'
cat bench.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: benchmarks
path: bench.json

docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Build the documentation (warnings are errors, like on Read the Docs)
run: uv run --frozen --python 3.14 --group docs sphinx-build -W --keep-going docs docs/_build/html

gevent:
name: Queue under gevent
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Run Telnet and SSH sessions through a queue under gevent
run: uv run --frozen --python 3.14 --group gevent pytest -p no:cacheprovider tests/Exscript/GeventTest.py

os-guessing:
name: OS-guess accuracy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Compare the guesses with the ground truth (fails if fewer are right)
shell: bash # with pipefail; the default shell lets tee hide a failure
run: uv run --frozen --python 3.14 python tools/osguess_report.py --check | tee -a "$GITHUB_STEP_SUMMARY"

api-diff:
name: Public API changes (report only)
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Compare with the target branch
shell: bash
env:
BASE_REF: ${{ github.base_ref }}
# griffe exits with 1 when it finds breaking changes; this job only reports them.
# Both search paths: the target branch may still have the package in the repository root.
run: |
status=0
uvx griffe check Exscript --search src --search . --against "origin/$BASE_REF" --verbose \
> api-changes.txt 2>&1 || status=$?
cat api-changes.txt
{
echo "### Breaking API changes against $BASE_REF"
if [ "$status" -eq 0 ]; then echo 'None.'; else echo '```'; cat api-changes.txt; echo '```'; fi
} >> "$GITHUB_STEP_SUMMARY"
Loading
Loading