Skip to content

Commit be0f52b

Browse files
authored
feat: handle editable python installs better with globs (#136)
* handle editable python installs better with globs * fix editable
1 parent 6b87e9f commit be0f52b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

crates/pixi-build-python/src/protocol.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<P: ProjectModel + Sync> Protocol for PythonBuildBackend<P> {
349349
.await?;
350350
let built_package = CondaBuiltPackage {
351351
output_file: package,
352-
input_globs: input_globs(),
352+
input_globs: input_globs(params.editable),
353353
name: output.name().as_normalized().to_string(),
354354
version: output.version().to_string(),
355355
build: build_string.to_string(),
@@ -367,13 +367,12 @@ impl<P: ProjectModel + Sync> Protocol for PythonBuildBackend<P> {
367367
/// has a different way of determining the input globs than hatch etc.
368368
///
369369
/// However, lets take everything in the directory as input for now
370-
fn input_globs() -> Vec<String> {
371-
vec![
370+
fn input_globs(editable: bool) -> Vec<String> {
371+
let mut globs: Vec<_> = vec![
372372
// Source files
373-
"**/*.py",
374-
"**/*.pyx",
375373
"**/*.c",
376374
"**/*.cpp",
375+
"**/*.rs",
377376
"**/*.sh",
378377
// Common data files
379378
"**/*.json",
@@ -401,7 +400,14 @@ fn input_globs() -> Vec<String> {
401400
]
402401
.iter()
403402
.map(|s| s.to_string())
404-
.collect()
403+
.collect();
404+
405+
if !editable {
406+
globs.push("**/*.py".to_string());
407+
globs.push("**/*.pyx".to_string());
408+
}
409+
410+
globs
405411
}
406412

407413
pub struct PythonBuildBackendInstantiator {

0 commit comments

Comments
 (0)