Skip to content

Commit 7797c63

Browse files
committed
[fix] Resolved F821 undefined name errors
Added project_name local variable in _handle_pyproject_toml_version and removed orphaned assert in test_bump_version_pyproject_toml_malformed
1 parent fadd47a commit 7797c63

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

openwisp_utils/releaser/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ def _handle_pyproject_toml_version(config):
110110
config["package_type"] = "pyproject"
111111
config["version_path"] = "pyproject.toml"
112112
config["CURRENT_VERSION"] = current_version
113+
project_name = get_package_name_from_setup()
114+
if not project_name:
115+
return
113116
package_directory = project_name.replace("-", "_")
114117
candidate_files = [
115118
os.path.join(package_directory, "__init__.py"),

openwisp_utils/releaser/tests/test_version_bumping.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,3 @@ def test_bump_version_pyproject_toml_malformed():
467467
with patch("os.path.exists", return_value=True), patch("builtins.open", m_open):
468468
with pytest.raises(RuntimeError, match="Failed to find"):
469469
bump_version(config, "1.2.4")
470-
assert written_content == "1.2.4\n"

0 commit comments

Comments
 (0)