Skip to content

Commit 4066fad

Browse files
authored
Prepare for 6.3.1 release (#1579)
* Bump version for development towards 6.3.1 * Backwards compatibility fix: make `PrefixMap._map` available (#1578) * Backwards compatibility fix for those subclassing PrefixMap * Add changelog entry (cherry picked from commit 3a5ba84)
1 parent cf60014 commit 4066fad

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

CHANGES.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Traits CHANGELOG
22
================
33

4+
Release 6.3.1
5+
-------------
6+
7+
Released: 2021-10-12
8+
9+
Traits 6.3.1 is a bugfix release, fixing an incompatibility between
10+
Traits 6.3.0 and Mayavi <= 4.7.3.
11+
12+
Fixes
13+
~~~~~
14+
15+
* Make ``PrefixMap._map`` available again, for compatibility with Mayavi.
16+
(#1578)
17+
18+
419
Release 6.3.0
520
-------------
621

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# into the package source.
2121
MAJOR = 6
2222
MINOR = 3
23-
MICRO = 0
23+
MICRO = 1
2424
PRERELEASE = ""
2525
IS_RELEASED = False
2626

traits/tests/test_prefix_map.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,12 @@ class Person(HasTraits):
236236
default_value_callable = reconstituted.default_value()[1]
237237

238238
self.assertEqual(default_value_callable(p), 1)
239+
240+
def test_existence_of__map(self):
241+
# This test can be removed once Mayavi no longer depends on the
242+
# existence of the _map attribute.
243+
# xref: enthought/traits#1577
244+
# xref: enthought/mayavi#1094
245+
246+
prefix_map = PrefixMap({"yes": 1, "yeah": 1, "no": 0, "nah": 0})
247+
self.assertEqual(prefix_map._map["yes"], "yes")

traits/trait_types.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,6 +3294,13 @@ def __init__(self, map, *, default_value=None, **metadata):
32943294
if not map:
32953295
raise ValueError("map must be nonempty")
32963296
self.map = map
3297+
# Provide backwards compatibility for Mayavi, which currently
3298+
# subclasses PrefixMap and depends on the existence of the _map
3299+
# attribute. This attribute can be removed as soon as RevPrefixMap in
3300+
# Mayavi has been fixed.
3301+
# xref: enthought/traits#1577
3302+
# xref: enthought/mayavi#1094
3303+
self._map = {value: value for value in map}
32973304

32983305
if default_value is not None:
32993306
default_value = self._complete_value(default_value)

0 commit comments

Comments
 (0)