From 06457e787f574a4c04a1f48991af1d9ef0e0d362 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 23 Nov 2021 21:35:11 +0800 Subject: [PATCH] Fix `pip install maturin` on OpenBSD 6.8 --- Changelog.md | 1 + setup.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 41b16548b..f1e6835f1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] * Add support for excluding files from wheels by `.gitignore` in [#695](https://github.com/PyO3/maturin/pull/695) +* Fix `pip install maturin` on OpenBSD 6.8 in [#697](https://github.com/PyO3/maturin/pull/697) ## [0.12.1] - 2021-11-21 diff --git a/setup.py b/setup.py index b7de2b135..d61f02264 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,10 @@ def run(self): raise RuntimeError("build maturin failed:\n" + exc.output.decode()) print(metadata) assert metadata["target"]["name"] == "maturin" - source = metadata["filenames"][0] + filenames = metadata["filenames"] + # somehow on openbsd `filenames` is empty but we can use the + # `executable` instead, see https://github.com/PyO3/maturin/issues/481 + source = filenames[0] if filenames else metadata["executable"] # run this after trying to build with cargo (as otherwise this leaves # venv in a bad state: https://github.com/benfred/py-spy/issues/69)