Skip to content

Commit

Permalink
feat: remove Python and Pipenv installation
Browse files Browse the repository at this point in the history
Fixes  #198
Fixes #191
Fixes #176

More information: leon-ai/leon#437
  • Loading branch information
theoludwig committed Oct 15, 2022
1 parent a94a826 commit 3cdc0df
Show file tree
Hide file tree
Showing 27 changed files with 14 additions and 868 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
matrix:
include:
- os: 'macos-latest'
# - os: 'windows-2019'
- os: 'windows-latest'
- os: 'ubuntu-latest'
fail-fast: false

Expand All @@ -86,4 +86,3 @@ jobs:

- name: 'End To End (e2e) Test'
run: 'npm run test:e2e-classic'
shell: 'bash'
63 changes: 6 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"access": "public"
},
"files": [
"build",
"scripts"
"build"
],
"main": "build/index.js",
"bin": {
Expand Down Expand Up @@ -70,9 +69,7 @@
"extract-zip": "2.0.1",
"ora": "6.1.2",
"read-pkg": "7.1.0",
"semver": "7.3.8",
"simple-git": "3.14.1",
"sudo-prompt": "9.2.1",
"table": "6.8.0",
"typanion": "3.12.0",
"update-notifier": "6.0.2"
Expand All @@ -84,7 +81,6 @@
"@swc/core": "1.3.8",
"@types/mock-fs": "4.13.1",
"@types/node": "18.11.0",
"@types/semver": "7.3.12",
"@types/sinon": "10.0.13",
"@types/tap": "15.0.7",
"@types/update-notifier": "6.0.1",
Expand Down
5 changes: 0 additions & 5 deletions scripts/dependencies/install_apk_packages.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/dependencies/install_apt_packages.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/dependencies/install_brew_packages.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/dependencies/install_dnf_packages.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/dependencies/install_pacman_packages.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/dependencies/install_yum_packages.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/install_pipenv.sh

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/install_pyenv.sh

This file was deleted.

26 changes: 0 additions & 26 deletions scripts/install_pyenv_macos.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/install_python_pipenv_with_pyenv.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/pipenv_variables.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/pyenv_variables.sh

This file was deleted.

6 changes: 0 additions & 6 deletions src/commands/create/birth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import chalk from 'chalk'

import { Leon } from '../../services/Leon.js'
import { Log } from '../../services/Log.js'
import { isGNULinux, isMacOS } from '../../utils/operatingSystem.js'

export class CreateBirthCommand extends Command {
static paths = [['create', 'birth']]
Expand Down Expand Up @@ -55,11 +54,6 @@ export class CreateBirthCommand extends Command {
await leon.createBirth()
console.log(`\n${chalk.bold.green('Success:')} Leon is born! 🎉`)
console.log('You can start your leon instance:')
if (isGNULinux || isMacOS) {
console.log(`${chalk.cyan('exec $SHELL')}`)
} else {
console.log(`First, restart your command prompt.`)
}
console.log(`${chalk.cyan('leon start')}`)
return 0
} catch (error) {
Expand Down
13 changes: 5 additions & 8 deletions src/services/Leon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from 'node:path'
import os from 'node:os'
import fs from 'node:fs'
import crypto from 'node:crypto'
import stream from 'node:stream'

import axios from 'axios'
import ora from 'ora'
Expand Down Expand Up @@ -123,12 +124,12 @@ export class Leon implements LeonOptions {
TEMPORARY_PATH,
sourceCodeInformation.folderName
)
const sourceCodeWriter = fs.createWriteStream(destination)
const { data } = await axios.get(sourceCodeInformation.url, {
responseType: 'arraybuffer'
})
await fs.promises.writeFile(destination, Buffer.from(data), {
encoding: 'binary'
responseType: 'stream'
})
data.pipe(sourceCodeWriter)
await stream.promises.finished(sourceCodeWriter)
await extractZip(destination, { dir: TEMPORARY_PATH })
return extractedPath
}
Expand All @@ -141,7 +142,6 @@ export class Leon implements LeonOptions {
}

public async createBirth(): Promise<void> {
const requirements = Requirements.getInstance()
let cwdIsLeonCore = false
const cwdPath = process.cwd()
const cwdPackageJSONPath = path.join(cwdPath, 'package.json')
Expand Down Expand Up @@ -177,9 +177,6 @@ export class Leon implements LeonOptions {
})
}
const mode = this.useDocker ? 'docker' : 'classic'
if (mode === 'classic') {
await requirements.install(this.interactive)
}
if (!cwdIsLeonCore) {
const sourceCodePath = await this.getSourceCode()
await this.transferSourceCodeFromTemporaryToBirthPath(sourceCodePath)
Expand Down
Loading

0 comments on commit 3cdc0df

Please sign in to comment.