Skip to content

feat: add include-import-lib option to bundle Windows import libraries in wheels#3017

Merged
messense merged 1 commit intoPyO3:mainfrom
messense:include-import-lib
Feb 19, 2026
Merged

feat: add include-import-lib option to bundle Windows import libraries in wheels#3017
messense merged 1 commit intoPyO3:mainfrom
messense:include-import-lib

Conversation

@messense
Copy link
Copy Markdown
Member

Add a new include-import-lib option (defaults to false) in [tool.maturin] that includes the Windows import library (.dll.lib for MSVC, .dll.a for MinGW) in the built wheel. This enables users who distribute shared libraries via wheels to allow other programs to link against them at compile time.

The import library path is extracted directly from cargo's JSON build output (the extra filenames reported alongside the primary artifact), so no extra file copying to staging directories is needed.

Supported for all binding types that produce cdylibs/dlls: cffi, uniffi, and pyo3.

Closes #2289

…s in wheels

Add a new `include-import-lib` option (defaults to false) in `[tool.maturin]`
that includes the Windows import library (.dll.lib for MSVC, .dll.a for MinGW)
in the built wheel. This enables users who distribute shared libraries via
wheels to allow other programs to link against them at compile time.

The import library path is extracted directly from cargo's JSON build output
(the extra filenames reported alongside the primary artifact), so no extra
file copying to staging directories is needed.

Supported for all binding types that produce cdylibs/dlls: cffi, uniffi, and pyo3.

Closes PyO3#2289
@messense messense changed the title feat: add include-import-lib option to bundle Windows import libraries in wheels feat: add include-import-lib option to bundle Windows import libraries in wheels Feb 18, 2026
@messense messense merged commit f34303d into PyO3:main Feb 19, 2026
81 of 84 checks passed
@messense messense deleted the include-import-lib branch February 19, 2026 00:12
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 22, 2026
## 1.12.4

* Upgrade memmap2 version ([#3021](PyO3/maturin#3021))
* Fix: platform tag detection for Android targets ([#3023](PyO3/maturin#3023))
* Fix: only ignore maturin-generated native libraries on all platforms ([#3025](PyO3/maturin#3025))
* Fix: ignore develop artifacts for all binding types during build ([#3026](PyO3/maturin#3026))
* Feat: support conditional cargo features based on Python version ([#3027](PyO3/maturin#3027))

## 1.12.3

* Ci: set crt-static for riscv64 and loongarch64 musl targets ([#3009](PyO3/maturin#3009))
* Fix: support `maturin develop` on Windows ARM with x86 Python ([#3011](PyO3/maturin#3011))
* Fix: exclude `external_packages` bindings from uniffi wheels ([#3013](PyO3/maturin#3013))
* Update cargo-zigbuild to 0.22.1 ([#3015](PyO3/maturin#3015))
* Feat: build wheels from sdist with `--sdist` flag ([#3014](PyO3/maturin#3014))
* Feat: add `include-import-lib` option to bundle Windows import libraries in wheels ([#3017](PyO3/maturin#3017))
* Fix: auditwheel external lib check respects musllinux and reports symbol versions ([#3019](PyO3/maturin#3019))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the *.lib file to the wheel built by maturin on Windows (with the cffi bindings)

1 participant