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 11# Changelog
22
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+
37## 1.5.0 (2022-08-09)
48### Added
59- Add support for extension modules built for wasm32-unknown-emscripten with Pyodide. [ #244 ] ( https://github.com/PyO3/setuptools-rust/pull/244 )
1216- Fix RustBin build without wheel. [ #273 ] ( https://github.com/PyO3/setuptools-rust/pull/273 )
1317- Fix RustBin setuptools install. [ #275 ] ( https://github.com/PyO3/setuptools-rust/pull/275 )
1418
15-
1619## 1.4.1 (2022-07-05)
1720### Fixed
1821- 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__(
174174
175175 def get_lib_name (self , * , quiet : bool ) -> str :
176176 """Parse Cargo.toml to get the name of the shared library."""
177- metadata = self ._metadata (quiet = quiet )
177+ metadata = self .metadata (quiet = quiet )
178178 root_key = metadata ["resolve" ]["root" ]
179179 [pkg ] = [p for p in metadata ["packages" ] if p ["id" ] == root_key ]
180180 name = pkg ["targets" ][0 ]["name" ]
Original file line number Diff line number Diff line change 33import pytest
44from pytest import CaptureFixture , MonkeyPatch
55
6- from setuptools_rust .extension import RustBin
6+ from setuptools_rust .extension import RustBin , RustExtension
7+
8+ SETUPTOOLS_RUST_DIR = Path (__file__ ).parent .parent
79
810
911@pytest .fixture ()
1012def hello_world_bin () -> RustBin :
11- setuptools_rust_dir = Path (__file__ ).parent .parent
1213 return RustBin (
1314 "hello-world" ,
1415 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"
1627 ).as_posix (),
1728 )
1829
@@ -38,3 +49,11 @@ def test_metadata_cargo_log(
3849 captured = capfd .readouterr ()
3950 assert captured .out == ""
4051 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