@@ -28,9 +28,10 @@ use pixi_install_pypi::{
2828 LazyEnvironmentVariables , PyPIBuildConfig , PyPIContextConfig , PyPIEnvironmentUpdater ,
2929 PyPIUpdateConfig ,
3030} ;
31- use pixi_manifest:: { ChannelPriority , EnvironmentName , FeaturesExt , HasFeaturesIter } ;
31+ use pixi_manifest:: { ChannelPriority , EnvironmentName , FeaturesExt } ;
3232use pixi_progress:: global_multi_progress;
3333use pixi_record:: { ParseLockFileError , PixiRecord } ;
34+ use pixi_spec:: SourceSpec ;
3435use pixi_utils:: prefix:: Prefix ;
3536use pixi_uv_context:: UvResolutionContext ;
3637use pixi_uv_conversions:: {
@@ -1907,35 +1908,27 @@ pub enum TaskResult {
19071908
19081909/// Expands develop dependencies for a grouped environment.
19091910///
1910- /// Collects all develop dependencies from the features of the grouped environment,
1911- /// converts them to DependencyOnlySource format, and uses the command dispatcher
1912- /// to expand them into their build/host/run dependencies.
1911+ /// Takes the develop dependencies, converts them to DependencyOnlySource format,
1912+ /// and uses the command dispatcher to expand them into their build/host/run dependencies.
19131913///
19141914/// Returns `None` if there are no develop dependencies.
19151915async fn expand_develop_dependencies (
1916- group : & GroupedEnvironment < ' _ > ,
1916+ develop_dependencies : IndexMap < PackageName , SourceSpec > ,
1917+ group_name : GroupedEnvironmentName ,
19171918 platform : Platform ,
19181919 channel_config : & ChannelConfig ,
19191920 channels : & [ ChannelUrl ] ,
19201921 virtual_packages : & [ GenericVirtualPackage ] ,
19211922 variants : & BTreeMap < String , Vec < String > > ,
19221923 command_dispatcher : & CommandDispatcher ,
19231924) -> Result < Option < ExpandedDevSources > , SolveCondaEnvironmentError > {
1924- // Collect develop dependencies from all features in the group
1925- let mut develop_deps = IndexMap :: new ( ) ;
1926- for feature in group. features ( ) {
1927- if let Some ( deps) = feature. develop_dependencies ( Some ( platform) ) {
1928- develop_deps. extend ( deps. into_owned ( ) ) ;
1929- }
1930- }
1931-
19321925 // If there are no develop dependencies, return early
1933- if develop_deps . is_empty ( ) {
1926+ if develop_dependencies . is_empty ( ) {
19341927 return Ok ( None ) ;
19351928 }
19361929
19371930 // Convert to Vec<DependencyOnlySource>
1938- let dev_sources: Vec < DependencyOnlySource > = develop_deps
1931+ let dev_sources: Vec < DependencyOnlySource > = develop_dependencies
19391932 . into_iter ( )
19401933 . map ( |( name, spec) | DependencyOnlySource {
19411934 source : spec,
@@ -1959,7 +1952,7 @@ async fn expand_develop_dependencies(
19591952 . await
19601953 . map_err (
19611954 |source| SolveCondaEnvironmentError :: ExpandDevSourcesFailed {
1962- environment_name : group . name ( ) ,
1955+ environment_name : group_name ,
19631956 platform,
19641957 source,
19651958 } ,
@@ -1981,15 +1974,18 @@ async fn spawn_solve_conda_environment_task(
19811974 // Get the dependencies for this platform
19821975 let dependencies = group. combined_dependencies ( Some ( platform) ) ;
19831976
1977+ // Get the develop dependencies for this platform
1978+ let develop_dependencies = group. combined_develop_dependencies ( Some ( platform) ) ;
1979+
19841980 // Get solve options
19851981 let exclude_newer = group. exclude_newer ( ) ;
19861982 let strategy = group. solve_strategy ( ) ;
19871983
19881984 // Get the environment name
19891985 let group_name = group. name ( ) ;
19901986
1991- // Early out if there are no dependencies to solve.
1992- if dependencies. is_empty ( ) {
1987+ // Early out if there are no dependencies to solve and no develop dependencies to expand .
1988+ if dependencies. is_empty ( ) && develop_dependencies . is_empty ( ) {
19931989 return Ok ( TaskResult :: CondaGroupSolved (
19941990 group_name,
19951991 platform,
@@ -2028,7 +2024,8 @@ async fn spawn_solve_conda_environment_task(
20282024
20292025 // Expand develop dependencies if any
20302026 let expanded_develop = expand_develop_dependencies (
2031- & group,
2027+ develop_dependencies,
2028+ group_name. clone ( ) ,
20322029 platform,
20332030 & channel_config,
20342031 & channels,
@@ -2051,6 +2048,16 @@ async fn spawn_solve_conda_environment_task(
20512048 Default :: default ( )
20522049 } ;
20532050
2051+ // Early out if the final combined dependencies are still empty after expansion
2052+ if dependencies. is_empty ( ) {
2053+ return Ok ( TaskResult :: CondaGroupSolved (
2054+ group_name,
2055+ platform,
2056+ PixiRecordsByName :: default ( ) ,
2057+ Duration :: default ( ) ,
2058+ ) ) ;
2059+ }
2060+
20542061 let start = Instant :: now ( ) ;
20552062
20562063 // Solve the environment using the command dispatcher.
0 commit comments