Skip to content

broken with python311 #22

@zeratax

Description

@zeratax

I ran nixops deploy from nixos-23.11, which should corresponded to the latest commit e14f340 here but it results in the following error:

re.error: global flags not at the start of the expression at position 3

Apparently this behaviour changed in python 3.11

log
trace: warning: lib.mkFixStrictness has no effect and will be removed. It returns its argument unmodified, so you can just remove any calls.
nexus> creating cx11 server at Nuremberg DC Park 1...Traceback (most recent call last):
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/bin/.nixops-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/__main__.py", line 56, in main
    args.op(args)
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/script_defs.py", line 715, in op_deploy
    depl.deploy(
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/deployment.py", line 1365, in deploy
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/deployment.py", line 1354, in run_with_notify
    f()
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/deployment.py", line 1365, in <lambda>
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
                                           ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/deployment.py", line 1268, in _deploy
    nixops.parallel.run_tasks(
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/parallel.py", line 106, in run_tasks
    raise list(exceptions.values())[0]
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/parallel.py", line 70, in thread_fun
    work_result = (worker_fun(t), None, t.name)
                   ^^^^^^^^^^^^^
  File "/nix/store/1h0pjvanshp3mrr19hd19xrxcn4lvr23-nixops-unstable-2023-10-26/lib/python3.11/site-packages/nixops/deployment.py", line 1220, in worker
    r.create(
  File "/nix/store/hrb2chnvqq59vw6rxl3gc2al69v8z4gz-python3.11-nixops-hetznercloud-unstable-2023-02-19/lib/python3.11/site-packages/nixops_hetznercloud/backends/hetznercloud.py", line 748, in create
    self._create_instance(defn)
  File "/nix/store/hrb2chnvqq59vw6rxl3gc2al69v8z4gz-python3.11-nixops-hetznercloud-unstable-2023-02-19/lib/python3.11/site-packages/nixops_hetznercloud/backends/hetznercloud.py", line 649, in _create_instance
    labels={**self.get_common_labels(), **dict(defn.labels)},
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hrb2chnvqq59vw6rxl3gc2al69v8z4gz-python3.11-nixops-hetznercloud-unstable-2023-02-19/lib/python3.11/site-packages/nixops_hetznercloud/backends/hetznercloud.py", line 171, in get_common_labels
    if re.match(pattern, file_name):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/__init__.py", line 166, in match
    return _compile(pattern, flags).match(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/_parser.py", line 982, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/_parser.py", line 457, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/re/_parser.py", line 843, in _parse
    raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 3

On a sidenote: I tried to fix this myself, but trying to run the tests they all seem to fail? Is that expected? Considering it's a flake I assume this is not due to a different python version or w/e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions