Skip to content

Commit d491288

Browse files
committed
Eliminate uses of deprecated abstractproperty() decorator.
Its docstring with the deprecation notice polluted the documentation.
1 parent 7f00f4b commit d491288

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

amaranth/build/plat.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections import OrderedDict
22
from collections.abc import Iterable
3-
from abc import ABCMeta, abstractmethod, abstractproperty
3+
from abc import ABCMeta, abstractmethod
44
import os
55
import textwrap
66
import re
@@ -20,11 +20,11 @@
2020

2121

2222
class Platform(ResourceManager, metaclass=ABCMeta):
23-
resources = abstractproperty()
24-
connectors = abstractproperty()
23+
resources = property(abstractmethod(lambda: None))
24+
connectors = property(abstractmethod(lambda: None))
2525
default_clk = None
2626
default_rst = None
27-
required_tools = abstractproperty()
27+
required_tools = property(abstractmethod(lambda: None))
2828

2929
def __init__(self):
3030
super().__init__(self.resources, self.connectors)
@@ -271,9 +271,9 @@ def get_diff_input_output(self, pin, port, attrs, invert):
271271

272272

273273
class TemplatedPlatform(Platform):
274-
toolchain = abstractproperty()
275-
file_templates = abstractproperty()
276-
command_templates = abstractproperty()
274+
toolchain = property(abstractmethod(lambda: None))
275+
file_templates = property(abstractmethod(lambda: None))
276+
command_templates = property(abstractmethod(lambda: None))
277277

278278
build_script_templates = {
279279
"build_{{name}}.sh": """

amaranth/vendor/intel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import abstractproperty
1+
from abc import abstractmethod
22

33
from ..hdl import *
44
from ..build import *
@@ -55,9 +55,9 @@ class IntelPlatform(TemplatedPlatform):
5555

5656
toolchain = None # selected when creating platform
5757

58-
device = abstractproperty()
59-
package = abstractproperty()
60-
speed = abstractproperty()
58+
device = property(abstractmethod(lambda: None))
59+
package = property(abstractmethod(lambda: None))
60+
speed = property(abstractmethod(lambda: None))
6161
suffix = ""
6262

6363
# Quartus templates

amaranth/vendor/lattice_ecp5.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import abstractproperty
1+
from abc import abstractmethod
22

33
from ..hdl import *
44
from ..build import *
@@ -66,9 +66,9 @@ class LatticeECP5Platform(TemplatedPlatform):
6666

6767
toolchain = None # selected when creating platform
6868

69-
device = abstractproperty()
70-
package = abstractproperty()
71-
speed = abstractproperty()
69+
device = property(abstractmethod(lambda: None))
70+
package = property(abstractmethod(lambda: None))
71+
speed = property(abstractmethod(lambda: None))
7272
grade = "C" # [C]ommercial, [I]ndustrial
7373

7474
# Trellis templates

amaranth/vendor/lattice_ice40.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import abstractproperty
1+
from abc import abstractmethod
22

33
from ..hdl import *
44
from ..lib.cdc import ResetSynchronizer
@@ -68,8 +68,8 @@ class LatticeICE40Platform(TemplatedPlatform):
6868

6969
toolchain = None # selected when creating platform
7070

71-
device = abstractproperty()
72-
package = abstractproperty()
71+
device = property(abstractmethod(lambda: None))
72+
package = property(abstractmethod(lambda: None))
7373

7474
# IceStorm templates
7575

amaranth/vendor/lattice_machxo_2_3l.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import abstractproperty
1+
from abc import abstractmethod
22

33
from ..hdl import *
44
from ..build import *
@@ -40,9 +40,9 @@ class LatticeMachXO2Or3LPlatform(TemplatedPlatform):
4040

4141
toolchain = "Diamond"
4242

43-
device = abstractproperty()
44-
package = abstractproperty()
45-
speed = abstractproperty()
43+
device = property(abstractmethod(lambda: None))
44+
package = property(abstractmethod(lambda: None))
45+
speed = property(abstractmethod(lambda: None))
4646
grade = "C" # [C]ommercial, [I]ndustrial
4747

4848
required_tools = [

amaranth/vendor/quicklogic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import abstractproperty
1+
from abc import abstractmethod
22

33
from ..hdl import *
44
from ..lib.cdc import ResetSynchronizer
@@ -27,8 +27,8 @@ class QuicklogicPlatform(TemplatedPlatform):
2727
* ``add_constraints``: inserts commands in XDC file.
2828
"""
2929

30-
device = abstractproperty()
31-
package = abstractproperty()
30+
device = property(abstractmethod(lambda: None))
31+
package = property(abstractmethod(lambda: None))
3232

3333
# Since the QuickLogic version of SymbiFlow toolchain is not upstreamed yet
3434
# we should distinguish the QuickLogic version from mainline one.

amaranth/vendor/xilinx.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
from abc import abstractproperty
2+
from abc import abstractmethod
33

44
from ..hdl import *
55
from ..lib.cdc import ResetSynchronizer
@@ -118,9 +118,9 @@ class XilinxPlatform(TemplatedPlatform):
118118

119119
toolchain = None # selected when creating platform
120120

121-
device = abstractproperty()
122-
package = abstractproperty()
123-
speed = abstractproperty()
121+
device = property(abstractmethod(lambda: None))
122+
package = property(abstractmethod(lambda: None))
123+
speed = property(abstractmethod(lambda: None))
124124

125125
@property
126126
def _part(self):

0 commit comments

Comments
 (0)