Thus any defined resources.sshKeyPairs break nixops commands,
causing failures with the message:
TypeError: <class 'nixops.resources.ssh_keypair.SSHKeyPairDefinition'>.config's type annotation is not allowed to be a string, see: https://nixops.readthedocs.io/en/latest/plugins/authoring.html
A number of possible workarounds for this, but the simplest would seem
to just not activate PEP 563-style postponed annotations in
ssh_keypair.py.
This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried.
The base
ResourceDefinition
class requires theconfig
property's type annotation to not be a string (added https://github.com/NixOS/nixops/commit/cd9319be1ccceb80bd70faa6157774b600b51ef3 / https://github.com/NixOS/nixops/commit/a70af27155717e9e437fe4facb9526ffc9ce5c35), but thessh_keypair.py
module activates postponed annotations via thefrom __future__ import annotations
syntax (added https://github.com/NixOS/nixops/commit/e48422a9b0d2f4db38af7db7edc7c13f799a656b), which turns all type annotations in the module into strings[1], breaking theSSHKeyPairDefinition
class when initialized.Thus any defined
resources.sshKeyPairs
breaknixops
commands, causing failures with the message:A number of possible workarounds for this, but the simplest would seem to just not activate PEP 563-style postponed annotations in
ssh_keypair.py
.[1] https://peps.python.org/pep-0563/