File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
poetry_dynamic_versioning Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ ## Unreleased
2
+
3
+ * Fixed:
4
+ * There was an intermittent ` ValueError ` in PEP 621 mode,
5
+ related to trying to remove ` "version" ` from ` project.dynamic `
6
+ when it had already been removed.
7
+
1
8
## v1.7.0 (2025-01-15)
2
9
3
10
* Added:
Original file line number Diff line number Diff line change @@ -594,9 +594,11 @@ def _apply_version(
594
594
if mode == _Mode .Classic :
595
595
pyproject ["tool" ]["poetry" ]["version" ] = version # type: ignore
596
596
elif mode == _Mode .Pep621 :
597
- pyproject ["project" ]["dynamic" ].remove ("version" ) # type: ignore
597
+ if "version" in pyproject ["project" ]["dynamic" ]: # type: ignore
598
+ pyproject ["project" ]["dynamic" ].remove ("version" ) # type: ignore
598
599
pyproject ["project" ]["version" ] = version # type: ignore
599
- pyproject ["tool" ]["poetry" ].pop ("version" ) # type: ignore
600
+ if "version" in pyproject ["tool" ]["poetry" ]: # type: ignore
601
+ pyproject ["tool" ]["poetry" ].pop ("version" ) # type: ignore
600
602
601
603
# Disable the plugin in case we're building a source distribution,
602
604
# which won't have access to the VCS info at install time.
@@ -727,7 +729,7 @@ def _revert_version(retain: bool = False) -> None:
727
729
pyproject ["tool" ]["poetry" ]["version" ] = state .original_version # type: ignore
728
730
elif state .mode == _Mode .Pep621 :
729
731
if state .dynamic_array is not None :
730
- pyproject ["project" ]["dynamic" ] = state .dynamic_array
732
+ pyproject ["project" ]["dynamic" ] = state .dynamic_array # type: ignore
731
733
if "version" in pyproject ["project" ]: # type: ignore
732
734
pyproject ["project" ].pop ("version" ) # type: ignore
733
735
if state .original_version is not None :
You can’t perform that action at this time.
0 commit comments