Commit 7568be0
fix: path_to_module to handle hidden files (e.g. .clang-tidy) correctly (#987)
It works fine with normal install `pip install .` but not for editable
install `pip install -e .`
I got the error below without this fix because it can't handle hidden
file's extension corretly:
```
File "/opt/miniconda3/envs/pyapl/lib/python3.12/site-packages/scikit_build_core/build/_pathutil.py", line 31, in path_to_module
path = path.with_name(path.name.split(".", 1)[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/pyapl/lib/python3.12/pathlib.py", line 634, in with_name
raise ValueError("Invalid name %r" % (name))
ValueError: Invalid name ''
```
For example, if it's `.clang-tidy`, the original splitting
`path.name.split(".", 1)[0]` results empty string.
---------
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>1 parent 2f402a6 commit 7568be0
3 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
0 commit comments