File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ def _dry_run_changed(self, change):
478478 ignore_file_strategy = Enum (
479479 ExcludesStrategy .values (),
480480 config = True ,
481- default_value = ExcludesStrategy .theirs ,
481+ default_value = ExcludesStrategy .THEIRS . value ,
482482 help = """
483483 Strategy to use if an extra ignore file is passed:
484484 - merge means that the content of the extra ignore file will be merged
@@ -888,7 +888,9 @@ def build(self):
888888 self .extra_build_kwargs ,
889889 platform = self .platform ,
890890 extra_ignore_file = self .extra_ignore_file ,
891- ignore_file_strategy = self .ignore_file_strategy ,
891+ ignore_file_strategy = ExcludesStrategy (
892+ self .ignore_file_strategy
893+ ),
892894 ):
893895 if docker_client .string_output :
894896 self .log .info (l , extra = dict (phase = R2dState .BUILDING ))
Original file line number Diff line number Diff line change 77import sys
88import tarfile
99import textwrap
10- from enum import StrEnum , auto
10+ from enum import Enum
1111from functools import lru_cache
1212
1313import escapism
206206DEFAULT_NB_UID = 1000
207207
208208
209- class ExcludesStrategy (StrEnum ):
210- theirs = auto ()
211- ours = auto ()
212- merge = auto ()
209+ class ExcludesStrategy (Enum ):
210+ THEIRS = "theirs"
211+ OURS = "ours"
212+ MERGE = "merge"
213213
214214 @classmethod
215215 def values (cls ):
@@ -594,7 +594,7 @@ def build(
594594 extra_build_kwargs ,
595595 platform = None ,
596596 extra_ignore_file = None ,
597- ignore_file_strategy = ExcludesStrategy .theirs ,
597+ ignore_file_strategy = ExcludesStrategy .THEIRS ,
598598 ):
599599 tarf = io .BytesIO ()
600600 tar = tarfile .open (fileobj = tarf , mode = "w" )
@@ -640,9 +640,9 @@ def _read_excludes(filepath):
640640 excludes .extend (_read_excludes (ignore_file_name ))
641641
642642 if extra_ignore_file is not None :
643- if ignore_file_strategy == ExcludesStrategy .ours :
643+ if ignore_file_strategy == ExcludesStrategy .OURS :
644644 excludes = extra_excludes
645- elif ignore_file_strategy == ExcludesStrategy .merge :
645+ elif ignore_file_strategy == ExcludesStrategy .MERGE :
646646 excludes .extend (extra_excludes )
647647 else :
648648 # ignore means that if an ignore file exist, its content is used
You can’t perform that action at this time.
0 commit comments