From 52fa385b1a827cf3a56d24c05da9062f8ed18773 Mon Sep 17 00:00:00 2001 From: qubka Date: Sat, 29 Nov 2025 12:09:40 +0000 Subject: [PATCH 1/4] fix: add current to paths in cmake --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c39f77..2d3139b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,11 +193,11 @@ set(PY3LM_GITHUB_ACTIONS "0" CACHE STRING "Build with github actions") if(PY3LM_GITHUB_ACTIONS) execute_process(COMMAND cmake -E create_symlink - "${CMAKE_SOURCE_DIR}/lib" - "${CMAKE_BINARY_DIR}/lib" + "${CMAKE_CURRENT_SOURCE_DIR}/lib" + "${CMAKE_CURRENT_BINARY_DIR}/lib" ) execute_process(COMMAND cmake -E create_symlink - "${CMAKE_SOURCE_DIR}/python3.12" - "${CMAKE_BINARY_DIR}/python3.12" + "${CMAKE_CURRENT_SOURCE_DIR}/python3.12" + "${CMAKE_CURRENT_BINARY_DIR}/python3.12" ) endif() From 58dbac9609f1db9c76b52db998ee55b1ff7b2048 Mon Sep 17 00:00:00 2001 From: qubka Date: Mon, 1 Dec 2025 16:59:06 +0000 Subject: [PATCH 2/4] fix: add class construction with handle if no other ctors are available --- lib/plugify/plugin.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/plugify/plugin.py b/lib/plugify/plugin.py index 7eb44c9..cec4416 100644 --- a/lib/plugify/plugin.py +++ b/lib/plugify/plugin.py @@ -294,31 +294,41 @@ def __init__(self, *args, **kwargs): # Check if this is handle + ownership construction # Pattern: ClassName(handle_value, Ownership.OWNED/BORROWED) - if len(args) >= 2 and isinstance(args[1], Ownership): + if len(args) == 2 and isinstance(args[1], Ownership): self._handle = args[0] self._owned = args[1] return + # Check if this is handle-only construction (assume OWNED by default) + # Pattern: ClassName(handle_value) + if len(args) == 1 and len(constructors) == 0: + self._handle = args[0] + self._owned = Ownership.OWNED + return + # Constructor call mode if len(constructors) == 0: - raise ValueError(f"{class_name} requires handle and ownership for construction") + raise ValueError( + f"{className} has no constructors. " + f"Use: {className}(handle, Ownership.OWNED/BORROWED) or " + f"{className}(handle) to wrap an existing handle." + ) # Try constructors - last_error = None - for constructor in constructors: + errors = [] + for i, constructor in enumerate(constructors): try: self._handle = constructor(*args, **kwargs) self._owned = Ownership.OWNED return # Success! except Exception as e: - last_error = e - continue + errors.append(f"Constructor {i}: {e}") # If we get here, all constructors failed - if last_error: - raise last_error - else: - raise ValueError(f"No constructor matched the arguments for {class_name}") + raise ValueError( + f"No constructor matched the arguments for {className}.\n" + f"Tried {len(constructors)} constructor(s):\n" + "\n".join(errors) + ) cls.__init__ = __init__ From d3e65a681c58ea2ed7eb2cb68dc385e23d5feca2 Mon Sep 17 00:00:00 2001 From: qubka Date: Mon, 1 Dec 2025 17:59:17 +0000 Subject: [PATCH 3/4] fix: update plugify --- external/plugify | 2 +- src/module.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/external/plugify b/external/plugify index ae5cb77..27f47c6 160000 --- a/external/plugify +++ b/external/plugify @@ -1 +1 @@ -Subproject commit ae5cb77bb027f3586511b45fdea0f7c261540438 +Subproject commit 27f47c6ffd996a04b3abf7625ed42f961a34b3ed diff --git a/src/module.cpp b/src/module.cpp index 10f1fe0..a2fa65e 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3106,20 +3106,20 @@ namespace py3lm { } } - PyObject* AliasToTuple(const Alias& alias) { - if (alias.GetName().empty()) { + PyObject* AliasToTuple(const std::optional& alias) { + if (!alias) { return CreatePyObject(); } PyObject* tuple = PyTuple_New(Py_ssize_t{ 2 }); if (!tuple) return nullptr; - PyObject* name = CreatePyObject(alias.GetName()); + PyObject* name = CreatePyObject(alias->GetName()); if (!name) { Py_DECREF(tuple); return nullptr; } - PyObject* owner = CreatePyObject(alias.IsOwner()); + PyObject* owner = CreatePyObject(alias->IsOwner()); if (!owner) { Py_DECREF(tuple); return nullptr; From 051fcb2f7d4ee7c312120fe1aefd70d03fb397d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:59:33 +0000 Subject: [PATCH 4/4] chore(main): release 2.0.13 --- .github/release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ version.txt | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/release-please-manifest.json b/.github/release-please-manifest.json index cf0c464..c7edfac 100644 --- a/.github/release-please-manifest.json +++ b/.github/release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.12" + ".": "2.0.13" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 38914c1..f24f570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.13](https://github.com/untrustedmodders/plugify-module-python3/compare/v2.0.12...v2.0.13) (2025-12-01) + + +### Bug Fixes + +* add class construction with handle if no other ctors are available ([58dbac9](https://github.com/untrustedmodders/plugify-module-python3/commit/58dbac9609f1db9c76b52db998ee55b1ff7b2048)) +* add current to paths in cmake ([52fa385](https://github.com/untrustedmodders/plugify-module-python3/commit/52fa385b1a827cf3a56d24c05da9062f8ed18773)) +* update plugify ([d3e65a6](https://github.com/untrustedmodders/plugify-module-python3/commit/d3e65a681c58ea2ed7eb2cb68dc385e23d5feca2)) + ## [2.0.12](https://github.com/untrustedmodders/plugify-module-python3/compare/v2.0.11...v2.0.12) (2025-11-28) diff --git a/version.txt b/version.txt index 280a1e3..82bd22f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.12 +2.0.13