Using ABC as class basis for deprecated meta
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from abc import ABC, abstractmethod
|
||||
from copy import deepcopy
|
||||
from dataclasses import dataclass, field
|
||||
from os.path import abspath, basename, dirname, isdir, isfile, join
|
||||
@@ -65,7 +65,7 @@ def get_language_directories(compile_type: str, language_config: Config, propert
|
||||
return configurables
|
||||
|
||||
@dataclass
|
||||
class FlushableMakeProjectData(metaclass=ABCMeta):
|
||||
class FlushableMakeProjectData(ABC):
|
||||
@abstractmethod
|
||||
def flush_to_output(self, directory: str) -> int:
|
||||
...
|
||||
@@ -224,7 +224,7 @@ PROJECT_TYPE_MOD = 1
|
||||
PROJECT_TYPE_MODPACK = 2
|
||||
PROJECT_TYPE_PACK = 3
|
||||
|
||||
class MakeDataConfig(FileConfig, RuleSetConfig, RuleSetHolder, metaclass=ABCMeta):
|
||||
class MakeDataConfig(FileConfig, RuleSetConfig, RuleSetHolder, ABC):
|
||||
defaults: FileConfig
|
||||
current_project: Final[str]
|
||||
project_unique_name: Final[str]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import os
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from abc import ABC, abstractmethod
|
||||
from functools import cmp_to_key
|
||||
from itertools import chain
|
||||
from os.path import abspath, basename, exists, isdir, isfile, join
|
||||
@@ -15,7 +15,7 @@ from .utils import ensure_not_whitespace, remove_tree
|
||||
|
||||
AVAILABLE_ARTIFACTS: Dict[Union[type, Callable[[Any], bool]], Union[Callable[[Any], 'Artifact'], Type['Artifact']]] = {}
|
||||
|
||||
class Artifact(metaclass=ABCMeta):
|
||||
class Artifact(ABC):
|
||||
def __init__(self, description: Any) -> None:
|
||||
self.description = description
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import (Any, Callable, Dict, Iterable, List, Optional, Sequence,
|
||||
Sized, Tuple, Union, cast)
|
||||
|
||||
@@ -19,7 +19,7 @@ from .shell import (Editable, Interactable, Selectable, attention, failure,
|
||||
frozen, get_toolchain_style, pretty_print, success)
|
||||
|
||||
|
||||
class Feedback(metaclass=ABCMeta):
|
||||
class Feedback(ABC):
|
||||
on_pre_request: Optional[Callable[['Feedback'], None]]
|
||||
|
||||
def __init__(self, prompt: AnyFormattedText = "Ooh, was it supposed to be a query here?", fallback: object = None) -> None:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from abc import ABCMeta
|
||||
from abc import ABC
|
||||
from itertools import chain
|
||||
from typing import (Any, Dict, MutableMapping, MutableSequence, MutableSet,
|
||||
Optional)
|
||||
@@ -93,7 +93,7 @@ TOOLCHAIN_RULE_SET.append_set("package_type", "develop", "release")
|
||||
TOOLCHAIN_RULE_SET.append_set("java_compiler", "javac", "ecj", "gradle")
|
||||
TOOLCHAIN_RULE_SET.append_set("native_architecture", "arm", "arm64", "x86", "x86_64")
|
||||
|
||||
class RuleSetHolder(metaclass=ABCMeta):
|
||||
class RuleSetHolder(ABC):
|
||||
rule_set: RuleSet
|
||||
properties: MutableSequence[str]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user