From d491288e325f3af36a2d197f07620d6ee2666594 Mon Sep 17 00:00:00 2001 From: Catherine Date: Mon, 24 Jul 2023 12:37:21 +0000 Subject: [PATCH] Eliminate uses of deprecated `abstractproperty()` decorator. Its docstring with the deprecation notice polluted the documentation. --- amaranth/build/plat.py | 14 +++++++------- amaranth/vendor/intel.py | 8 ++++---- amaranth/vendor/lattice_ecp5.py | 8 ++++---- amaranth/vendor/lattice_ice40.py | 6 +++--- amaranth/vendor/lattice_machxo_2_3l.py | 8 ++++---- amaranth/vendor/quicklogic.py | 6 +++--- amaranth/vendor/xilinx.py | 8 ++++---- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/amaranth/build/plat.py b/amaranth/build/plat.py index c8b0d05..dae4c0f 100644 --- a/amaranth/build/plat.py +++ b/amaranth/build/plat.py @@ -1,6 +1,6 @@ from collections import OrderedDict from collections.abc import Iterable -from abc import ABCMeta, abstractmethod, abstractproperty +from abc import ABCMeta, abstractmethod import os import textwrap import re @@ -20,11 +20,11 @@ __all__ = ["Platform", "TemplatedPlatform"] class Platform(ResourceManager, metaclass=ABCMeta): - resources = abstractproperty() - connectors = abstractproperty() + resources = property(abstractmethod(lambda: None)) + connectors = property(abstractmethod(lambda: None)) default_clk = None default_rst = None - required_tools = abstractproperty() + required_tools = property(abstractmethod(lambda: None)) def __init__(self): super().__init__(self.resources, self.connectors) @@ -271,9 +271,9 @@ class Platform(ResourceManager, metaclass=ABCMeta): class TemplatedPlatform(Platform): - toolchain = abstractproperty() - file_templates = abstractproperty() - command_templates = abstractproperty() + toolchain = property(abstractmethod(lambda: None)) + file_templates = property(abstractmethod(lambda: None)) + command_templates = property(abstractmethod(lambda: None)) build_script_templates = { "build_{{name}}.sh": """ diff --git a/amaranth/vendor/intel.py b/amaranth/vendor/intel.py index 797fbe6..83d127b 100644 --- a/amaranth/vendor/intel.py +++ b/amaranth/vendor/intel.py @@ -1,4 +1,4 @@ -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..build import * @@ -55,9 +55,9 @@ class IntelPlatform(TemplatedPlatform): toolchain = None # selected when creating platform - device = abstractproperty() - package = abstractproperty() - speed = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) + speed = property(abstractmethod(lambda: None)) suffix = "" # Quartus templates diff --git a/amaranth/vendor/lattice_ecp5.py b/amaranth/vendor/lattice_ecp5.py index 2b54107..55c10e8 100644 --- a/amaranth/vendor/lattice_ecp5.py +++ b/amaranth/vendor/lattice_ecp5.py @@ -1,4 +1,4 @@ -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..build import * @@ -66,9 +66,9 @@ class LatticeECP5Platform(TemplatedPlatform): toolchain = None # selected when creating platform - device = abstractproperty() - package = abstractproperty() - speed = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) + speed = property(abstractmethod(lambda: None)) grade = "C" # [C]ommercial, [I]ndustrial # Trellis templates diff --git a/amaranth/vendor/lattice_ice40.py b/amaranth/vendor/lattice_ice40.py index 2b64b00..1e2ca1e 100644 --- a/amaranth/vendor/lattice_ice40.py +++ b/amaranth/vendor/lattice_ice40.py @@ -1,4 +1,4 @@ -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..lib.cdc import ResetSynchronizer @@ -68,8 +68,8 @@ class LatticeICE40Platform(TemplatedPlatform): toolchain = None # selected when creating platform - device = abstractproperty() - package = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) # IceStorm templates diff --git a/amaranth/vendor/lattice_machxo_2_3l.py b/amaranth/vendor/lattice_machxo_2_3l.py index ab19e5f..36fa4c8 100644 --- a/amaranth/vendor/lattice_machxo_2_3l.py +++ b/amaranth/vendor/lattice_machxo_2_3l.py @@ -1,4 +1,4 @@ -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..build import * @@ -40,9 +40,9 @@ class LatticeMachXO2Or3LPlatform(TemplatedPlatform): toolchain = "Diamond" - device = abstractproperty() - package = abstractproperty() - speed = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) + speed = property(abstractmethod(lambda: None)) grade = "C" # [C]ommercial, [I]ndustrial required_tools = [ diff --git a/amaranth/vendor/quicklogic.py b/amaranth/vendor/quicklogic.py index dfb4a1a..697ec4c 100644 --- a/amaranth/vendor/quicklogic.py +++ b/amaranth/vendor/quicklogic.py @@ -1,4 +1,4 @@ -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..lib.cdc import ResetSynchronizer @@ -27,8 +27,8 @@ class QuicklogicPlatform(TemplatedPlatform): * ``add_constraints``: inserts commands in XDC file. """ - device = abstractproperty() - package = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) # Since the QuickLogic version of SymbiFlow toolchain is not upstreamed yet # we should distinguish the QuickLogic version from mainline one. diff --git a/amaranth/vendor/xilinx.py b/amaranth/vendor/xilinx.py index ebf9083..47699e3 100644 --- a/amaranth/vendor/xilinx.py +++ b/amaranth/vendor/xilinx.py @@ -1,5 +1,5 @@ import re -from abc import abstractproperty +from abc import abstractmethod from ..hdl import * from ..lib.cdc import ResetSynchronizer @@ -118,9 +118,9 @@ class XilinxPlatform(TemplatedPlatform): toolchain = None # selected when creating platform - device = abstractproperty() - package = abstractproperty() - speed = abstractproperty() + device = property(abstractmethod(lambda: None)) + package = property(abstractmethod(lambda: None)) + speed = property(abstractmethod(lambda: None)) @property def _part(self):