Skip to content

Commit

Permalink
Remove ABCMeta metaclass, keep abstractmethods
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 20, 2024
1 parent 477f713 commit bdd0a8d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from __future__ import annotations

import sys
from abc import ABC

if sys.version_info < (3, 8): # noqa: UP036 # Check for unsupported versions
raise RuntimeError("Python 3.8 or later is required")
Expand Down Expand Up @@ -306,7 +305,7 @@ def get_supported_platform():
]


class ResolutionError(Exception, ABC):
class ResolutionError(Exception):
"""Abstract base for dependency resolution errors"""

def __repr__(self):
Expand Down
4 changes: 2 additions & 2 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import re
import sys
from abc import ABC, abstractmethod
from abc import abstractmethod
from typing import TYPE_CHECKING, TypeVar, overload

sys.path.extend(((vendor_path := os.path.join(os.path.dirname(os.path.dirname(__file__)), 'setuptools', '_vendor')) not in sys.path) * [vendor_path]) # fmt: skip
Expand Down Expand Up @@ -120,7 +120,7 @@ def setup(**attrs):
_Command = monkey.get_unpatched(distutils.core.Command)


class Command(_Command, ABC):
class Command(_Command):
"""
Setuptools internal actions are organized using a *command design pattern*.
This means that each action (or group of closely related actions) executed during
Expand Down
3 changes: 1 addition & 2 deletions setuptools/command/setopt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import configparser
import os
from abc import ABC

from .. import Command
from ..unicode_utils import _cfg_read_utf8_with_fallback
Expand Down Expand Up @@ -70,7 +69,7 @@ def edit_config(filename, settings, dry_run=False):
opts.write(f)


class option_base(Command, ABC):
class option_base(Command):
"""Abstract base class for commands that mess with config files"""

user_options = [
Expand Down
3 changes: 1 addition & 2 deletions setuptools/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sys
import tempfile
import textwrap
from abc import ABC

import pkg_resources
from pkg_resources import working_set
Expand Down Expand Up @@ -263,7 +262,7 @@ def run_setup(setup_script, args):
# Normal exit, just return


class AbstractSandbox(ABC):
class AbstractSandbox:
"""Wrap 'os' module and 'open()' builtin for virtualizing setup scripts"""

_active = False
Expand Down

0 comments on commit bdd0a8d

Please sign in to comment.