Skip to content

Commit a4d8fce

Browse files
ImLucasBrownclaude
andcommitted
* Python 3.14 compatibility
* Skip non-.py files in plugin loader to avoid crashes on stale .pyc bytecode * Use class-defined _NodeSpec for INTERNAL_ATTRS.BUILTINS so __firstlineno__ and __static_attributes__ (added in Python 3.12+) are properly filtered * Bump python_requires upper bound from <3.12 to <3.15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e14a965 commit a4d8fce

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

nxt/nxt_node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ class INTERNAL_ATTRS(object):
4040
CACHED_CODE = _prefix + 'cached_code'
4141
# List of python attrs that a node will have but we don't want to parse or
4242
# considering in our composite logic
43-
BUILTINS = tuple(dir(type('NodeSpec', (object,), {})))
43+
class _NodeSpec(object):
44+
pass
45+
BUILTINS = tuple(dir(_NodeSpec))
4446
# A list of node attrs that are used internally in our composite logic but
4547
# tracked and like user attrs with a `_source__nxt` meta attr
4648
TRACKED = (COMPUTE, EXECUTE_IN, COMMENT, START_POINT, ENABLED,

nxt/plugin_loader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def load_plugins():
2020
if not os.path.isdir(plugin_dir):
2121
continue
2222
for file_name in os.listdir(plugin_dir):
23+
if not file_name.endswith('.py'):
24+
continue
2325
mod_name, _ = os.path.splitext(file_name)
2426
if mod_name in _nxt_loaded_plugin_module_names:
2527
continue

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
long_description_content_type="text/markdown",
2727
url="https://github.com/nxt-dev/nxt",
2828
packages=setuptools.find_packages(),
29-
python_requires='>=3.7, <3.12',
29+
python_requires='>=3.7, <3.15',
3030
entry_points={
3131
'console_scripts': [
3232
'nxt=nxt.cli:main',

0 commit comments

Comments
 (0)