Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"click>=8,<=8.2; python_version == '3.10'", # cannot deepcopy cmd params (specifically, Sentinel.UNSET) on 3.10
"click>=8,!=8.3.0,<8.4",
"tomli; python_version < '3.11'",
"colorama; platform_system == 'Windows'",
Expand Down
9 changes: 9 additions & 0 deletions spin/cmds/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
)

import copy
import enum
import os
import shlex
import shutil
Expand Down Expand Up @@ -159,6 +160,14 @@ def build(*, parent_callback, extra=None, **kwargs):
"""
my_cmd = copy.copy(cmd)

# This patch is to work around an enum deepcopy bug in Python 3.10.
if not hasattr(enum.Enum, "__deepcopy__"):

def __deepcopy__(self, memo):
return self

enum.Enum.__deepcopy__ = __deepcopy__ # type: ignore[method-assign]

# This is necessary to ensure that added options do not leak
# to the original command
my_cmd.params = copy.deepcopy(cmd.params)
Expand Down
Loading