File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+ ### Fixed
5
+ - Fix regression in ` get_lib_name ` crashing since 1.5.0. [ #280 ] ( https://github.com/PyO3/setuptools-rust/pull/280 )
6
+
3
7
## 1.5.0 (2022-08-09)
4
8
### Added
5
9
- Add support for extension modules built for wasm32-unknown-emscripten with Pyodide. [ #244 ] ( https://github.com/PyO3/setuptools-rust/pull/244 )
12
16
- Fix RustBin build without wheel. [ #273 ] ( https://github.com/PyO3/setuptools-rust/pull/273 )
13
17
- Fix RustBin setuptools install. [ #275 ] ( https://github.com/PyO3/setuptools-rust/pull/275 )
14
18
15
-
16
19
## 1.4.1 (2022-07-05)
17
20
### Fixed
18
21
- Fix crash when checking Rust version. [ #263 ] ( https://github.com/PyO3/setuptools-rust/pull/263 )
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def __init__(
174
174
175
175
def get_lib_name (self , * , quiet : bool ) -> str :
176
176
"""Parse Cargo.toml to get the name of the shared library."""
177
- metadata = self ._metadata (quiet = quiet )
177
+ metadata = self .metadata (quiet = quiet )
178
178
root_key = metadata ["resolve" ]["root" ]
179
179
[pkg ] = [p for p in metadata ["packages" ] if p ["id" ] == root_key ]
180
180
name = pkg ["targets" ][0 ]["name" ]
Original file line number Diff line number Diff line change 3
3
import pytest
4
4
from pytest import CaptureFixture , MonkeyPatch
5
5
6
- from setuptools_rust .extension import RustBin
6
+ from setuptools_rust .extension import RustBin , RustExtension
7
+
8
+ SETUPTOOLS_RUST_DIR = Path (__file__ ).parent .parent
7
9
8
10
9
11
@pytest .fixture ()
10
12
def hello_world_bin () -> RustBin :
11
- setuptools_rust_dir = Path (__file__ ).parent .parent
12
13
return RustBin (
13
14
"hello-world" ,
14
15
path = (
15
- setuptools_rust_dir / "examples" / "hello-world" / "Cargo.toml"
16
+ SETUPTOOLS_RUST_DIR / "examples" / "hello-world" / "Cargo.toml"
17
+ ).as_posix (),
18
+ )
19
+
20
+
21
+ @pytest .fixture ()
22
+ def namespace_package_extension () -> RustExtension :
23
+ return RustExtension (
24
+ "namespace_package.rust" ,
25
+ path = (
26
+ SETUPTOOLS_RUST_DIR / "examples" / "namespace_package" / "Cargo.toml"
16
27
).as_posix (),
17
28
)
18
29
@@ -38,3 +49,11 @@ def test_metadata_cargo_log(
38
49
captured = capfd .readouterr ()
39
50
assert captured .out == ""
40
51
assert captured .err == ""
52
+
53
+
54
+ def test_get_lib_name_namespace_package (
55
+ namespace_package_extension : RustExtension ,
56
+ ) -> None :
57
+ assert (
58
+ namespace_package_extension .get_lib_name (quiet = True ) == "namespace_package_rust"
59
+ )
You can’t perform that action at this time.
0 commit comments