File tree 2 files changed +39
-1
lines changed
2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change
1
+ v4.8.1
2
+ ======
3
+
4
+ * #348: Restored support for ``EntryPoint `` access by item,
5
+ deprecating support in the process. Users are advised
6
+ to use direct member access instead of item-based access::
7
+
8
+ - ep[0] -> ep.name
9
+ - ep[1] -> ep.value
10
+ - ep[2] -> ep.group
11
+ - ep[:] -> ep.name, ep.value, ep.group
12
+
1
13
v4.8.0
2
14
======
3
15
Original file line number Diff line number Diff line change @@ -125,7 +125,33 @@ def valid(line):
125
125
return line and not line .startswith ('#' )
126
126
127
127
128
- class EntryPoint :
128
+ class DeprecatedTuple :
129
+ """
130
+ Provide subscript item access for backward compatibility.
131
+
132
+ >>> recwarn = getfixture('recwarn')
133
+ >>> ep = EntryPoint(name='name', value='value', group='group')
134
+ >>> ep[:]
135
+ ('name', 'value', 'group')
136
+ >>> ep[0]
137
+ 'name'
138
+ >>> len(recwarn)
139
+ 1
140
+ """
141
+
142
+ _warn = functools .partial (
143
+ warnings .warn ,
144
+ "EntryPoint tuple interface is deprecated. Access members by name." ,
145
+ DeprecationWarning ,
146
+ stacklevel = pypy_partial (2 ),
147
+ )
148
+
149
+ def __getitem__ (self , item ):
150
+ self ._warn ()
151
+ return self ._key ()[item ]
152
+
153
+
154
+ class EntryPoint (DeprecatedTuple ):
129
155
"""An entry point as defined by Python packaging conventions.
130
156
131
157
See `the packaging docs on entry points
You can’t perform that action at this time.
0 commit comments