Skip to content

Commit

Permalink
Merge pull request #254 from ijl/py2-tag
Browse files Browse the repository at this point in the history
Fix non-interpreter-specific wheels using tag with py2
  • Loading branch information
konstin authored Jan 23, 2020
2 parents 981d15d + e66f096 commit cc96d4c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 613 deletions.
6 changes: 3 additions & 3 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ type BuiltWheelMetadata = (PathBuf, String, Option<PythonInterpreter>);

impl BuildContext {
/// Checks which kind of bindings we have (pyo3/rust-cypthon or cffi or bin) and calls the
/// correct builder. Returns a Vec that contains location, python tag (e.g. py2.py3 or cp35)
/// correct builder. Returns a Vec that contains location, python tag (e.g. py3 or cp35)
/// and for bindings the python interpreter they bind against.
pub fn build_wheels(&self) -> Result<Vec<BuiltWheelMetadata>, Error> {
fs::create_dir_all(&self.out)
.context("Failed to create the target directory for the wheels")?;

let wheels = match &self.bridge {
BridgeModel::Cffi => vec![(self.build_cffi_wheel()?, "py2.py3".to_string(), None)],
BridgeModel::Bin => vec![(self.build_bin_wheel()?, "py2.py3".to_string(), None)],
BridgeModel::Cffi => vec![(self.build_cffi_wheel()?, "py3".to_string(), None)],
BridgeModel::Bin => vec![(self.build_bin_wheel()?, "py3".to_string(), None)],
BridgeModel::Bindings(_) => self.build_binding_wheels()?,
};

Expand Down
1 change: 0 additions & 1 deletion src/python_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fn windows_interpreter_no_build(
/// Installed Pythons found by py Launcher for Windows
/// -3.7-64 *
/// -3.6-32
/// -2.7-64
/// ```
///
/// When using `conda` we can use the `conda info -e` command to retrieve information
Expand Down
7 changes: 3 additions & 4 deletions src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ impl Target {
}

/// Returns the tags for the WHEEL file for cffi wheels
pub fn get_py2_and_py3_tags(&self, manylinux: &Manylinux) -> Vec<String> {
pub fn get_py3_tags(&self, manylinux: &Manylinux) -> Vec<String> {
vec![
format!("py2-none-{}", self.get_platform_tag(&manylinux)),
format!("py3-none-{}", self.get_platform_tag(&manylinux)),
]
}
Expand Down Expand Up @@ -237,10 +236,10 @@ impl Target {
/// Returns the tags for the platform without python version
pub fn get_universal_tags(&self, manylinux: &Manylinux) -> (String, Vec<String>) {
let tag = format!(
"py2.py3-none-{platform}",
"py3-none-{platform}",
platform = self.get_platform_tag(&manylinux)
);
let tags = self.get_py2_and_py3_tags(&manylinux);
let tags = self.get_py3_tags(&manylinux);
(tag, tags)
}
}
Loading

0 comments on commit cc96d4c

Please sign in to comment.