@@ -61,6 +61,10 @@ function tomlHasBuildSystem(toml: tomljs.JsonMap): boolean {
61
61
return toml [ 'build-system' ] !== undefined ;
62
62
}
63
63
64
+ function tomlHasProject ( toml : tomljs . JsonMap ) : boolean {
65
+ return toml . project !== undefined ;
66
+ }
67
+
64
68
function getTomlOptionalDeps ( toml : tomljs . JsonMap ) : string [ ] {
65
69
const extras : string [ ] = [ ] ;
66
70
if ( toml . project && ( toml . project as tomljs . JsonMap ) [ 'optional-dependencies' ] ) {
@@ -139,7 +143,7 @@ async function pickRequirementsFiles(
139
143
140
144
export function isPipInstallableToml ( tomlContent : string ) : boolean {
141
145
const toml = tomlParse ( tomlContent ) ;
142
- return tomlHasBuildSystem ( toml ) ;
146
+ return tomlHasBuildSystem ( toml ) && tomlHasProject ( toml ) ;
143
147
}
144
148
145
149
export interface IPackageInstallSelection {
@@ -162,12 +166,17 @@ export async function pickPackagesToInstall(
162
166
163
167
let extras : string [ ] = [ ] ;
164
168
let hasBuildSystem = false ;
169
+ let hasProject = false ;
165
170
166
171
if ( await fs . pathExists ( tomlPath ) ) {
167
172
const toml = tomlParse ( await fs . readFile ( tomlPath , 'utf-8' ) ) ;
168
173
extras = getTomlOptionalDeps ( toml ) ;
169
174
hasBuildSystem = tomlHasBuildSystem ( toml ) ;
175
+ hasProject = tomlHasProject ( toml ) ;
170
176
177
+ if ( ! hasProject ) {
178
+ traceVerbose ( 'Create env: Found toml without project. So we will not use editable install.' ) ;
179
+ }
171
180
if ( ! hasBuildSystem ) {
172
181
traceVerbose ( 'Create env: Found toml without build system. So we will not use editable install.' ) ;
173
182
}
@@ -179,7 +188,7 @@ export async function pickPackagesToInstall(
179
188
return MultiStepAction . Back ;
180
189
}
181
190
182
- if ( hasBuildSystem ) {
191
+ if ( hasBuildSystem && hasProject ) {
183
192
if ( extras . length > 0 ) {
184
193
traceVerbose ( 'Create Env: Found toml with optional dependencies.' ) ;
185
194
0 commit comments