Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix maturin develop for PyPy on Unix #596

Merged
merged 1 commit into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Use UTF-8 encoding when reading `pyproject.toml` by domdfcoding in [#588](https://github.com/PyO3/maturin/pull/588)
* Use Cargo's `repository` field as `Source Code` in project URL in [#590](https://github.com/PyO3/maturin/pull/590)
* Fold long header fields in Python metadata in [#594](https://github.com/PyO3/maturin/pull/594)
* Fix `maturin develop` for PyPy on Unix in [#596](https://github.com/PyO3/maturin/pull/596)

## [0.11.1] - 2021-07-10

Expand Down
19 changes: 12 additions & 7 deletions src/target.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::python_interpreter::InterpreterKind;
use crate::{PlatformTag, PythonInterpreter};
use anyhow::{bail, format_err, Context, Result};
use platform_info::*;
Expand Down Expand Up @@ -316,13 +317,17 @@ impl Target {
interpreter: &PythonInterpreter,
) -> PathBuf {
if self.is_unix() {
let python_dir = format!("python{}.{}", interpreter.major, interpreter.minor);

venv_base
.as_ref()
.join("lib")
.join(python_dir)
.join("site-packages")
match interpreter.interpreter_kind {
InterpreterKind::CPython => {
let python_dir = format!("python{}.{}", interpreter.major, interpreter.minor);
venv_base
.as_ref()
.join("lib")
.join(python_dir)
.join("site-packages")
}
InterpreterKind::PyPy => venv_base.as_ref().join("site-packages"),
}
} else {
venv_base.as_ref().join("Lib").join("site-packages")
}
Expand Down