Skip to content

Commit 928d069

Browse files
authored
Prepare for Traits 7.0.2 release (#1828)
This PR prepares for a Traits 7.0.2 release: * Backport PR #1827 and PR #1826 * Bump the version number
1 parent 79b0604 commit 928d069

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

.github/workflows/run-traits-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, windows-latest, macos-latest]
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
12+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1313

1414
runs-on: ${{ matrix.os }}
1515

.github/workflows/test-from-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
test-pypi-sdist:
1111
strategy:
1212
matrix:
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1414
platform:
1515
- os: ubuntu-latest
1616
architecture: x64
@@ -44,7 +44,7 @@ jobs:
4444
test-pypi-wheel:
4545
strategy:
4646
matrix:
47-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
47+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
4848
platform:
4949
- os: ubuntu-latest
5050
architecture: x64

CHANGES.rst

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

4+
Release 7.0.2
5+
-------------
6+
7+
Released: 2025-01-24
8+
9+
This is a bugfix release of the Traits package that fixes an interoperability
10+
issue with Pyface (a regression since Traits 6.4.3).
11+
12+
Fixes
13+
~~~~~
14+
* Make ``traits.trait_notifiers.ui_handler`` public again, since
15+
Pyface relies on importing it directly. (#1827)
16+
17+
Build
18+
~~~~~
19+
* Include Python 3.13 in all test workflows. (#1826)
20+
21+
422
Release 7.0.1
523
-------------
624

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 = 7
2222
MINOR = 0
23-
MICRO = 1
23+
MICRO = 2
2424
PRERELEASE = ""
2525
IS_RELEASED = True
2626

traits/trait_notifiers.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,33 @@
2929

3030
# The currently active handler for notifications that must be run on the UI
3131
# thread, or None if no handler has been set.
32-
_ui_handler = None
32+
# Note: the Pyface library current accesses the `ui_handler` attribute
33+
# directly, so we can't make it private yet.
34+
ui_handler = None
3335

3436

3537
def get_ui_handler():
3638
"""
3739
Return the current user interface thread handler.
3840
"""
39-
return _ui_handler
41+
return ui_handler
4042

4143

4244
def set_ui_handler(handler):
4345
""" Sets up the user interface thread handler.
4446
"""
45-
global _ui_handler
47+
global ui_handler
4648

47-
_ui_handler = handler
49+
ui_handler = handler
4850

4951

5052
def ui_dispatch(handler, *args, **kw):
5153
if threading.current_thread() == threading.main_thread():
5254
handler(*args, **kw)
53-
elif _ui_handler is None:
55+
elif ui_handler is None:
5456
raise RuntimeError("no UI handler registered for dispatch='ui'")
5557
else:
56-
_ui_handler(handler, *args, **kw)
58+
ui_handler(handler, *args, **kw)
5759

5860

5961
class NotificationExceptionHandlerState(object):
@@ -616,10 +618,10 @@ class FastUITraitChangeNotifyWrapper(TraitChangeNotifyWrapper):
616618
def dispatch(self, handler, *args):
617619
if threading.current_thread() == threading.main_thread():
618620
handler(*args)
619-
elif _ui_handler is None:
621+
elif ui_handler is None:
620622
raise RuntimeError("no UI handler registered for dispatch='ui'")
621623
else:
622-
_ui_handler(handler, *args)
624+
ui_handler(handler, *args)
623625

624626

625627
class NewTraitChangeNotifyWrapper(TraitChangeNotifyWrapper):

0 commit comments

Comments
 (0)