Commit c1a78b3
committed
refactor: fix runtime TypeAlias with pipe operator
Move GivenPyProjectResult type alias after PyProjectData class definition
to use unquoted modern syntax. TypeAlias with pipe operator requires
runtime evaluation, so forward references must be avoided.
Changes:
- vcs-versioning/src/vcs_versioning/_pyproject_reading.py:
- Move GivenPyProjectResult after PyProjectData class
- Use unquoted: PyProjectData | InvalidTomlError | FileNotFoundError | None
- Fixes TypeError: unsupported operand type(s) for |: 'str' and 'type'
- vcs-versioning/src/vcs_versioning/_types.py:
- PathT: os.PathLike[str] | str (unquoted)
- Already worked since os is imported1 parent 0a79a96 commit c1a78b3
File tree
2 files changed
+7
-6
lines changed- vcs-versioning/src/vcs_versioning
2 files changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
| |||
161 | 156 | | |
162 | 157 | | |
163 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments