Skip to content

Commit 95a028b

Browse files
Fix specs before the solver (#97)
* Remove adding installed packages to specs * Clean code * Small fix
1 parent 4c73f80 commit 95a028b

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

packages/mambajs/src/solver.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,8 @@ export const getSolvedPackages = async (
138138
} else {
139139
const pkgs = splitPipPackages(installedPackages);
140140
installedCondaPackages = pkgs.installedCondaPackages;
141-
specs = prepareSpecsForInstalling(
142-
installedCondaPackages,
143-
ymlOrSpecs as string[]
144-
);
145141
newChannels = formatChannels(channels);
142+
specs = ymlOrSpecs as string[];
146143
}
147144

148145
if (logger) {
@@ -215,19 +212,3 @@ const formatChannels = (channels?: string[]) => {
215212
const normalizeUrl = (url: string) => {
216213
return url.replace(/[\/\s]+$/, '');
217214
};
218-
219-
export const prepareSpecsForInstalling = (
220-
condaPackages: ISolvedPackages,
221-
specs: Array<string>
222-
) => {
223-
Object.keys(condaPackages).map((filename: string) => {
224-
const installedPackage = condaPackages[filename];
225-
if (installedPackage.name === 'python') {
226-
specs.push(`${installedPackage.name}=${installedPackage.version}`);
227-
} else {
228-
specs.push(`${installedPackage.name}`);
229-
}
230-
});
231-
232-
return specs;
233-
};

0 commit comments

Comments
 (0)