diff --git a/crates/pixi-build/src/bin/pixi-build-python/python.rs b/crates/pixi-build/src/bin/pixi-build-python/python.rs index 39a2837..5b86664 100644 --- a/crates/pixi-build/src/bin/pixi-build-python/python.rs +++ b/crates/pixi-build/src/bin/pixi-build-python/python.rs @@ -328,6 +328,48 @@ impl PythonBuildBackend { } } +/// Determines the build input globs for given python package +/// even this will be probably backend specific, e.g setuptools +/// has a different way of determining the input globs than hatch etc. +/// +/// However, lets take everything in the directory as input for now +fn input_globs() -> Vec { + vec![ + // Source files + "**/*.py", + "**/*.pyx", + "**/*.c", + "**/*.cpp", + "**/*.sh", + // Common data files + "**/*.json", + "**/*.yaml", + "**/*.yml", + "**/*.txt", + // Project configuration + "setup.py", + "setup.cfg", + "pyproject.toml", + "requirements*.txt", + "Pipfile", + "Pipfile.lock", + "poetry.lock", + "tox.ini", + // Build configuration + "Makefile", + "MANIFEST.in", + "tests/**/*.py", + "docs/**/*.rst", + "docs/**/*.md", + // Versioning + "VERSION", + "version.py", + ] + .iter() + .map(|s| s.to_string()) + .collect() +} + #[async_trait::async_trait] impl Protocol for PythonBuildBackend { async fn get_conda_metadata( @@ -431,7 +473,10 @@ impl Protocol for PythonBuildBackend { .within_context_async(move || async move { run_build(output, &tool_config).await }) .await?; - Ok(CondaBuildResult { path: package }) + Ok(CondaBuildResult { + output_file: package, + input_globs: input_globs(), + }) } } diff --git a/crates/pixi-build/src/cli.rs b/crates/pixi-build/src/cli.rs index b9c5766..09e7a13 100644 --- a/crates/pixi-build/src/cli.rs +++ b/crates/pixi-build/src/cli.rs @@ -138,7 +138,11 @@ async fn build(factory: impl ProtocolFactory, manifest_path: &Path) -> miette::R }) .await?; - eprintln!("Successfully build '{}'", result.path.display()); + eprintln!("Successfully build '{}'", result.output_file.display()); + eprintln!("Use following globs to revalidate: "); + for glob in result.input_globs { + eprintln!(" - {}", glob); + } Ok(()) }