@bjia56/portable-python 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ var require_package = __commonJS({
55
55
  "package.json"(exports, module2) {
56
56
  module2.exports = {
57
57
  name: "@bjia56/portable-python",
58
- version: "0.1.5",
58
+ version: "0.1.6",
59
59
  description: "Portable Python",
60
60
  main: "./dist/index.js",
61
61
  module: "./dist/index.mjs",
@@ -190,7 +190,7 @@ var PortablePython = class {
190
190
  * Contains the release tag that will be downloaded.
191
191
  */
192
192
  get releaseTag() {
193
- return VERSION_BUILDS.get(this.version);
193
+ return VERSION_BUILDS[this.version];
194
194
  }
195
195
  /**
196
196
  * Contains the full name of the Python distribution.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@bjia56/portable-python\",\n \"version\": \"0.1.5\",\n \"description\": \"Portable Python\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"cp ../../README.md . && tsup\",\n \"prepublishOnly\": \"npm run build\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/bjia56/portable-python.git\"\n },\n \"keywords\": [\n \"python\"\n ],\n \"author\": \"Brett Jia\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/bjia56/portable-python/issues\"\n },\n \"homepage\": \"https://github.com/bjia56/portable-python\",\n \"dependencies\": {\n \"adm-zip\": \"^0.5.10\"\n },\n \"devDependencies\": {\n \"@types/adm-zip\": \"^0.5.5\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.0.1\",\n \"typescript\": \"^5.3.2\"\n },\n \"portablePython\": {\n \"versions\": [\n \"3.10.13\",\n \"3.9.18\",\n \"3.9.17\",\n \"3.8.18\",\n \"3.8.17\"\n ],\n \"versionBuilds\": {\n \"3.10.13\": \"v3.10.13-build.3\",\n \"3.9.18\": \"v3.9.18-beta.4\",\n \"3.9.17\": \"v3.9.17-build.4\",\n \"3.8.18\": \"v3.8.18-build.0\",\n \"3.8.17\": \"v3.8.17-build.3\"\n }\n }\n}\n","import { createWriteStream, existsSync, rm, rmSync, mkdirSync, chmodSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { platform, arch } from \"os\";\nimport { Readable } from 'stream';\nimport { finished } from 'stream/promises';\nimport { ReadableStream } from 'stream/web';\nimport AdmZip from \"adm-zip\";\n\nconst packageJson = require(\"../package.json\");\n\nconst DL_PLATFORM = (() => {\n if (platform() == \"win32\") {\n return \"windows\";\n }\n return platform();\n})();\n\nconst DL_ARCH = (() => {\n if (DL_PLATFORM == \"darwin\") {\n return \"universal2\";\n }\n\n switch (arch()) {\n case \"ia32\":\n return \"i386\";\n case \"x64\":\n return \"x86_64\";\n case \"arm64\":\n return \"aarch64\";\n }\n\n return arch();\n})();\n\nconst VERSIONS = packageJson.portablePython.versions;\nconst VERSION_BUILDS = packageJson.portablePython.versionBuilds;\n\nfunction pickVersion(version: string) {\n for (let i = 0; i < VERSIONS.length; ++i) {\n // TODO: This doesn't handle semver correctly, e.g. 3.8.17 will match 3.8.1\n if (VERSIONS[i].startsWith(version)) {\n return VERSIONS[i];\n }\n }\n return VERSIONS[0]\n}\n\n// https://stackoverflow.com/a/32134846\nasync function download(url: string, dest: string) {\n const res = await fetch(url);\n const file = createWriteStream(dest);\n await finished(Readable.fromWeb(res.body as ReadableStream).pipe(file));\n}\n\nexport class PortablePython {\n _version: string\n installDir = dirname(__dirname);\n\n constructor(version: string, installDir: string | null = null) {\n if (!version) {\n throw Error(\"version must not be empty\");\n }\n\n if (installDir) {\n this.installDir = installDir;\n }\n\n this._version = pickVersion(version);\n if (!this.releaseTag) {\n throw Error(\"no releases available for this version\");\n }\n }\n\n /**\n * Contains the path to the Python executable.\n */\n get executablePath() {\n return join(this.installDir, this.pythonDistributionName, \"bin\", \"python\" + (platform() === \"win32\" ? \".exe\" : \"\"));\n }\n\n /**\n * Contains the selected Python version.\n */\n get version() {\n return this._version;\n }\n\n /**\n * Contains the release tag that will be downloaded.\n */\n get releaseTag() {\n return VERSION_BUILDS.get(this.version) as string;\n }\n\n /**\n * Contains the full name of the Python distribution.\n */\n get pythonDistributionName() {\n return `python-${this.version}-${DL_PLATFORM}-${DL_ARCH}`;\n }\n\n /**\n * Contains the path to the extracted Python distribution folder.\n */\n get extractPath() {\n return join(this.installDir, this.pythonDistributionName);\n }\n\n /**\n * Checks if the selected Python version has been installed on the host platform.\n * @returns True if the installation exists, false otherwise.\n */\n isInstalled() {\n return existsSync(this.extractPath);\n }\n\n /**\n * Will download the compressed Python installation and extract it to\n * the installation directory.\n */\n async install() {\n if (this.isInstalled()) {\n return;\n }\n\n const url = `https://github.com/bjia56/portable-python/releases/download/${this.releaseTag}/${this.pythonDistributionName}.zip`\n const downloadPath = join(this.installDir, `${this.pythonDistributionName}.zip`);\n\n mkdirSync(this.installDir, { recursive: true });\n\n const installDir = this.installDir;\n await download(url, downloadPath);\n\n const zip = new AdmZip(downloadPath);\n zip.extractAllTo(installDir, true)\n\n rmSync(downloadPath);\n if (!this.isInstalled()) {\n throw Error(\"something went wrong and the installation failed\");\n }\n\n chmodSync(this.executablePath, 0o777);\n }\n\n /**\n * Uninstalls the Python distribution.\n */\n async uninstall() {\n if (!this.isInstalled()) {\n return;\n }\n await new Promise<void>((resolve, reject) => rm(this.extractPath, { force: true, recursive: true }, (e) => {\n if (e) {\n reject(e);\n } else {\n resolve();\n }\n }));\n }\n\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,0BAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,MAAQ;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IAAI,OAAO;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,cAAc;AACd,eAAO,kBAAK,KAAK,YAAY,KAAK,sBAAsB;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cAAc;AACV,eAAO,sBAAW,KAAK,WAAW;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMM,UAAU;AAAA;AACZ,UAAI,KAAK,YAAY,GAAG;AACpB;AAAA,MACJ;AAEA,YAAM,MAAM,+DAA+D,KAAK,UAAU,IAAI,KAAK,sBAAsB;AACzH,YAAM,mBAAe,kBAAK,KAAK,YAAY,GAAG,KAAK,sBAAsB,MAAM;AAE/E,+BAAU,KAAK,YAAY,EAAE,WAAW,KAAK,CAAC;AAE9C,YAAM,aAAa,KAAK;AACxB,YAAM,SAAS,KAAK,YAAY;AAEhC,YAAM,MAAM,IAAI,eAAAC,QAAO,YAAY;AACnC,UAAI,aAAa,YAAY,IAAI;AAEjC,4BAAO,YAAY;AACnB,UAAI,CAAC,KAAK,YAAY,GAAG;AACrB,cAAM,MAAM,kDAAkD;AAAA,MAClE;AAEA,+BAAU,KAAK,gBAAgB,GAAK;AAAA,IACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKM,YAAY;AAAA;AACd,UAAI,CAAC,KAAK,YAAY,GAAG;AACrB;AAAA,MACJ;AACA,YAAM,IAAI,QAAc,CAAC,SAAS,eAAW,cAAG,KAAK,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,GAAG,CAAC,MAAM;AACvG,YAAI,GAAG;AACH,iBAAO,CAAC;AAAA,QACZ,OAAO;AACH,kBAAQ;AAAA,QACZ;AAAA,MACJ,CAAC,CAAC;AAAA,IACN;AAAA;AAEJ;","names":["module","AdmZip"]}
1
+ {"version":3,"sources":["../package.json","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@bjia56/portable-python\",\n \"version\": \"0.1.6\",\n \"description\": \"Portable Python\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"cp ../../README.md . && tsup\",\n \"prepublishOnly\": \"npm run build\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/bjia56/portable-python.git\"\n },\n \"keywords\": [\n \"python\"\n ],\n \"author\": \"Brett Jia\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/bjia56/portable-python/issues\"\n },\n \"homepage\": \"https://github.com/bjia56/portable-python\",\n \"dependencies\": {\n \"adm-zip\": \"^0.5.10\"\n },\n \"devDependencies\": {\n \"@types/adm-zip\": \"^0.5.5\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.0.1\",\n \"typescript\": \"^5.3.2\"\n },\n \"portablePython\": {\n \"versions\": [\n \"3.10.13\",\n \"3.9.18\",\n \"3.9.17\",\n \"3.8.18\",\n \"3.8.17\"\n ],\n \"versionBuilds\": {\n \"3.10.13\": \"v3.10.13-build.3\",\n \"3.9.18\": \"v3.9.18-beta.4\",\n \"3.9.17\": \"v3.9.17-build.4\",\n \"3.8.18\": \"v3.8.18-build.0\",\n \"3.8.17\": \"v3.8.17-build.3\"\n }\n }\n}\n","import { createWriteStream, existsSync, rm, rmSync, mkdirSync, chmodSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { platform, arch } from \"os\";\nimport { Readable } from 'stream';\nimport { finished } from 'stream/promises';\nimport { ReadableStream } from 'stream/web';\nimport AdmZip from \"adm-zip\";\n\nconst packageJson = require(\"../package.json\");\n\nconst DL_PLATFORM = (() => {\n if (platform() == \"win32\") {\n return \"windows\";\n }\n return platform();\n})();\n\nconst DL_ARCH = (() => {\n if (DL_PLATFORM == \"darwin\") {\n return \"universal2\";\n }\n\n switch (arch()) {\n case \"ia32\":\n return \"i386\";\n case \"x64\":\n return \"x86_64\";\n case \"arm64\":\n return \"aarch64\";\n }\n\n return arch();\n})();\n\nconst VERSIONS = packageJson.portablePython.versions;\nconst VERSION_BUILDS = packageJson.portablePython.versionBuilds;\n\nfunction pickVersion(version: string) {\n for (let i = 0; i < VERSIONS.length; ++i) {\n // TODO: This doesn't handle semver correctly, e.g. 3.8.17 will match 3.8.1\n if (VERSIONS[i].startsWith(version)) {\n return VERSIONS[i];\n }\n }\n return VERSIONS[0]\n}\n\n// https://stackoverflow.com/a/32134846\nasync function download(url: string, dest: string) {\n const res = await fetch(url);\n const file = createWriteStream(dest);\n await finished(Readable.fromWeb(res.body as ReadableStream).pipe(file));\n}\n\nexport class PortablePython {\n _version: string\n installDir = dirname(__dirname);\n\n constructor(version: string, installDir: string | null = null) {\n if (!version) {\n throw Error(\"version must not be empty\");\n }\n\n if (installDir) {\n this.installDir = installDir;\n }\n\n this._version = pickVersion(version);\n if (!this.releaseTag) {\n throw Error(\"no releases available for this version\");\n }\n }\n\n /**\n * Contains the path to the Python executable.\n */\n get executablePath() {\n return join(this.installDir, this.pythonDistributionName, \"bin\", \"python\" + (platform() === \"win32\" ? \".exe\" : \"\"));\n }\n\n /**\n * Contains the selected Python version.\n */\n get version() {\n return this._version;\n }\n\n /**\n * Contains the release tag that will be downloaded.\n */\n get releaseTag() {\n return VERSION_BUILDS[this.version] as string;\n }\n\n /**\n * Contains the full name of the Python distribution.\n */\n get pythonDistributionName() {\n return `python-${this.version}-${DL_PLATFORM}-${DL_ARCH}`;\n }\n\n /**\n * Contains the path to the extracted Python distribution folder.\n */\n get extractPath() {\n return join(this.installDir, this.pythonDistributionName);\n }\n\n /**\n * Checks if the selected Python version has been installed on the host platform.\n * @returns True if the installation exists, false otherwise.\n */\n isInstalled() {\n return existsSync(this.extractPath);\n }\n\n /**\n * Will download the compressed Python installation and extract it to\n * the installation directory.\n */\n async install() {\n if (this.isInstalled()) {\n return;\n }\n\n const url = `https://github.com/bjia56/portable-python/releases/download/${this.releaseTag}/${this.pythonDistributionName}.zip`\n const downloadPath = join(this.installDir, `${this.pythonDistributionName}.zip`);\n\n mkdirSync(this.installDir, { recursive: true });\n\n const installDir = this.installDir;\n await download(url, downloadPath);\n\n const zip = new AdmZip(downloadPath);\n zip.extractAllTo(installDir, true)\n\n rmSync(downloadPath);\n if (!this.isInstalled()) {\n throw Error(\"something went wrong and the installation failed\");\n }\n\n chmodSync(this.executablePath, 0o777);\n }\n\n /**\n * Uninstalls the Python distribution.\n */\n async uninstall() {\n if (!this.isInstalled()) {\n return;\n }\n await new Promise<void>((resolve, reject) => rm(this.extractPath, { force: true, recursive: true }, (e) => {\n if (e) {\n reject(e);\n } else {\n resolve();\n }\n }));\n }\n\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,0BAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,QAAU;AAAA,MACV,OAAS;AAAA,MACT,OAAS;AAAA,QACP;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,gBAAkB;AAAA,QAClB,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,QAAU;AAAA,MACV,SAAW;AAAA,MACX,MAAQ;AAAA,QACN,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,MACZ,cAAgB;AAAA,QACd,WAAW;AAAA,MACb;AAAA,MACA,iBAAmB;AAAA,QACjB,kBAAkB;AAAA,QAClB,WAAW;AAAA,QACX,MAAQ;AAAA,QACR,YAAc;AAAA,MAChB;AAAA,MACA,gBAAkB;AAAA,QAChB,UAAY;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;A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ACrB,cAAM,MAAM,kDAAkD;AAAA,MAClE;AAEA,+BAAU,KAAK,gBAAgB,GAAK;AAAA,IACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKM,YAAY;AAAA;AACd,UAAI,CAAC,KAAK,YAAY,GAAG;AACrB;AAAA,MACJ;AACA,YAAM,IAAI,QAAc,CAAC,SAAS,eAAW,cAAG,KAAK,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,GAAG,CAAC,MAAM;AACvG,YAAI,GAAG;AACH,iBAAO,CAAC;AAAA,QACZ,OAAO;AACH,kBAAQ;AAAA,QACZ;AAAA,MACJ,CAAC,CAAC;AAAA,IACN;AAAA;AAEJ;","names":["module","AdmZip"]}
package/dist/index.mjs CHANGED
@@ -28,7 +28,7 @@ var require_package = __commonJS({
28
28
  "package.json"(exports, module) {
29
29
  module.exports = {
30
30
  name: "@bjia56/portable-python",
31
- version: "0.1.5",
31
+ version: "0.1.6",
32
32
  description: "Portable Python",
33
33
  main: "./dist/index.js",
34
34
  module: "./dist/index.mjs",
@@ -158,7 +158,7 @@ var PortablePython = class {
158
158
  * Contains the release tag that will be downloaded.
159
159
  */
160
160
  get releaseTag() {
161
- return VERSION_BUILDS.get(this.version);
161
+ return VERSION_BUILDS[this.version];
162
162
  }
163
163
  /**
164
164
  * Contains the full name of the Python distribution.
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@bjia56/portable-python\",\n \"version\": \"0.1.5\",\n \"description\": \"Portable Python\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"cp ../../README.md . && tsup\",\n \"prepublishOnly\": \"npm run build\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/bjia56/portable-python.git\"\n },\n \"keywords\": [\n \"python\"\n ],\n \"author\": \"Brett Jia\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/bjia56/portable-python/issues\"\n },\n \"homepage\": \"https://github.com/bjia56/portable-python\",\n \"dependencies\": {\n \"adm-zip\": \"^0.5.10\"\n },\n \"devDependencies\": {\n \"@types/adm-zip\": \"^0.5.5\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.0.1\",\n \"typescript\": \"^5.3.2\"\n },\n \"portablePython\": {\n \"versions\": [\n \"3.10.13\",\n \"3.9.18\",\n \"3.9.17\",\n \"3.8.18\",\n \"3.8.17\"\n ],\n \"versionBuilds\": {\n \"3.10.13\": \"v3.10.13-build.3\",\n \"3.9.18\": \"v3.9.18-beta.4\",\n \"3.9.17\": \"v3.9.17-build.4\",\n \"3.8.18\": \"v3.8.18-build.0\",\n \"3.8.17\": \"v3.8.17-build.3\"\n }\n }\n}\n","import { createWriteStream, existsSync, rm, rmSync, mkdirSync, chmodSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { platform, arch } from \"os\";\nimport { Readable } from 'stream';\nimport { finished } from 'stream/promises';\nimport { ReadableStream } from 'stream/web';\nimport AdmZip from \"adm-zip\";\n\nconst packageJson = require(\"../package.json\");\n\nconst DL_PLATFORM = (() => {\n if (platform() == \"win32\") {\n return \"windows\";\n }\n return platform();\n})();\n\nconst DL_ARCH = (() => {\n if (DL_PLATFORM == \"darwin\") {\n return \"universal2\";\n }\n\n switch (arch()) {\n case \"ia32\":\n return \"i386\";\n case \"x64\":\n return \"x86_64\";\n case \"arm64\":\n return \"aarch64\";\n }\n\n return arch();\n})();\n\nconst VERSIONS = packageJson.portablePython.versions;\nconst VERSION_BUILDS = packageJson.portablePython.versionBuilds;\n\nfunction pickVersion(version: string) {\n for (let i = 0; i < VERSIONS.length; ++i) {\n // TODO: This doesn't handle semver correctly, e.g. 3.8.17 will match 3.8.1\n if (VERSIONS[i].startsWith(version)) {\n return VERSIONS[i];\n }\n }\n return VERSIONS[0]\n}\n\n// https://stackoverflow.com/a/32134846\nasync function download(url: string, dest: string) {\n const res = await fetch(url);\n const file = createWriteStream(dest);\n await finished(Readable.fromWeb(res.body as ReadableStream).pipe(file));\n}\n\nexport class PortablePython {\n _version: string\n installDir = dirname(__dirname);\n\n constructor(version: string, installDir: string | null = null) {\n if (!version) {\n throw Error(\"version must not be empty\");\n }\n\n if (installDir) {\n this.installDir = installDir;\n }\n\n this._version = pickVersion(version);\n if (!this.releaseTag) {\n throw Error(\"no releases available for this version\");\n }\n }\n\n /**\n * Contains the path to the Python executable.\n */\n get executablePath() {\n return join(this.installDir, this.pythonDistributionName, \"bin\", \"python\" + (platform() === \"win32\" ? \".exe\" : \"\"));\n }\n\n /**\n * Contains the selected Python version.\n */\n get version() {\n return this._version;\n }\n\n /**\n * Contains the release tag that will be downloaded.\n */\n get releaseTag() {\n return VERSION_BUILDS.get(this.version) as string;\n }\n\n /**\n * Contains the full name of the Python distribution.\n */\n get pythonDistributionName() {\n return `python-${this.version}-${DL_PLATFORM}-${DL_ARCH}`;\n }\n\n /**\n * Contains the path to the extracted Python distribution folder.\n */\n get extractPath() {\n return join(this.installDir, this.pythonDistributionName);\n }\n\n /**\n * Checks if the selected Python version has been installed on the host platform.\n * @returns True if the installation exists, false otherwise.\n */\n isInstalled() {\n return existsSync(this.extractPath);\n }\n\n /**\n * Will download the compressed Python installation and extract it to\n * the installation directory.\n */\n async install() {\n if (this.isInstalled()) {\n return;\n }\n\n const url = `https://github.com/bjia56/portable-python/releases/download/${this.releaseTag}/${this.pythonDistributionName}.zip`\n const downloadPath = join(this.installDir, `${this.pythonDistributionName}.zip`);\n\n mkdirSync(this.installDir, { recursive: true });\n\n const installDir = this.installDir;\n await download(url, downloadPath);\n\n const zip = new AdmZip(downloadPath);\n zip.extractAllTo(installDir, true)\n\n rmSync(downloadPath);\n if (!this.isInstalled()) {\n throw Error(\"something went wrong and the installation failed\");\n }\n\n chmodSync(this.executablePath, 0o777);\n }\n\n /**\n * Uninstalls the Python distribution.\n */\n async uninstall() {\n if (!this.isInstalled()) {\n return;\n }\n await new Promise<void>((resolve, reject) => rm(this.extractPath, { force: true, recursive: true }, (e) => {\n if (e) {\n reject(e);\n } else {\n resolve();\n }\n }));\n }\n\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,QAAU;AAAA,MACV,OAAS;AAAA,MACT,OAAS;AAAA,QACP;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,gBAAkB;AAAA,QAClB,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,QAAU;AAAA,MACV,SAAW;AAAA,MACX,MAAQ;AAAA,QACN,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,MACZ,cAAgB;AAAA,QACd,WAAW;AAAA,MACb;AAAA,MACA,iBAAmB;AAAA,QACjB,kBAAkB;AAAA,QAClB,WAAW;AAAA,QACX,MAAQ;AAAA,QACR,YAAc;AAAA,MAChB;AAAA,MACA,gBAAkB;AAAA,QAChB,UAAY;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,eAAiB;AAAA,UACf,WAAW;AAAA,UACX,UAAU;AAAA,UACV,UAAU;AAAA,UACV,UAAU;AAAA,UACV,UAAU;AAAA,QACZ;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;ACrDA,SAAS,mBAAmB,YAAY,IAAI,QAAQ,WAAW,iBAAiB;AAChF,SAAS,MAAM,eAAe;AAC9B,SAAS,UAAU,YAAY;AAC/B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAEzB,OAAO,YAAY;AAEnB,IAAM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I,GAAG;AACH,iBAAO,CAAC;AAAA,QACZ,OAAO;AACH,kBAAQ;AAAA,QACZ;AAAA,MACJ,CAAC,CAAC;AAAA,IACN;AAAA;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../package.json","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@bjia56/portable-python\",\n \"version\": \"0.1.6\",\n \"description\": \"Portable Python\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"cp ../../README.md . && tsup\",\n \"prepublishOnly\": \"npm run build\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/bjia56/portable-python.git\"\n },\n \"keywords\": [\n \"python\"\n ],\n \"author\": \"Brett Jia\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/bjia56/portable-python/issues\"\n },\n \"homepage\": \"https://github.com/bjia56/portable-python\",\n \"dependencies\": {\n \"adm-zip\": \"^0.5.10\"\n },\n \"devDependencies\": {\n \"@types/adm-zip\": \"^0.5.5\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.0.1\",\n \"typescript\": \"^5.3.2\"\n },\n \"portablePython\": {\n \"versions\": [\n \"3.10.13\",\n \"3.9.18\",\n \"3.9.17\",\n \"3.8.18\",\n \"3.8.17\"\n ],\n \"versionBuilds\": {\n \"3.10.13\": \"v3.10.13-build.3\",\n \"3.9.18\": \"v3.9.18-beta.4\",\n \"3.9.17\": \"v3.9.17-build.4\",\n \"3.8.18\": \"v3.8.18-build.0\",\n \"3.8.17\": \"v3.8.17-build.3\"\n }\n }\n}\n","import { createWriteStream, existsSync, rm, rmSync, mkdirSync, chmodSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { platform, arch } from \"os\";\nimport { Readable } from 'stream';\nimport { finished } from 'stream/promises';\nimport { ReadableStream } from 'stream/web';\nimport AdmZip from \"adm-zip\";\n\nconst packageJson = require(\"../package.json\");\n\nconst DL_PLATFORM = (() => {\n if (platform() == \"win32\") {\n return \"windows\";\n }\n return platform();\n})();\n\nconst DL_ARCH = (() => {\n if (DL_PLATFORM == \"darwin\") {\n return \"universal2\";\n }\n\n switch (arch()) {\n case \"ia32\":\n return \"i386\";\n case \"x64\":\n return \"x86_64\";\n case \"arm64\":\n return \"aarch64\";\n }\n\n return arch();\n})();\n\nconst VERSIONS = packageJson.portablePython.versions;\nconst VERSION_BUILDS = packageJson.portablePython.versionBuilds;\n\nfunction pickVersion(version: string) {\n for (let i = 0; i < VERSIONS.length; ++i) {\n // TODO: This doesn't handle semver correctly, e.g. 3.8.17 will match 3.8.1\n if (VERSIONS[i].startsWith(version)) {\n return VERSIONS[i];\n }\n }\n return VERSIONS[0]\n}\n\n// https://stackoverflow.com/a/32134846\nasync function download(url: string, dest: string) {\n const res = await fetch(url);\n const file = createWriteStream(dest);\n await finished(Readable.fromWeb(res.body as ReadableStream).pipe(file));\n}\n\nexport class PortablePython {\n _version: string\n installDir = dirname(__dirname);\n\n constructor(version: string, installDir: string | null = null) {\n if (!version) {\n throw Error(\"version must not be empty\");\n }\n\n if (installDir) {\n this.installDir = installDir;\n }\n\n this._version = pickVersion(version);\n if (!this.releaseTag) {\n throw Error(\"no releases available for this version\");\n }\n }\n\n /**\n * Contains the path to the Python executable.\n */\n get executablePath() {\n return join(this.installDir, this.pythonDistributionName, \"bin\", \"python\" + (platform() === \"win32\" ? \".exe\" : \"\"));\n }\n\n /**\n * Contains the selected Python version.\n */\n get version() {\n return this._version;\n }\n\n /**\n * Contains the release tag that will be downloaded.\n */\n get releaseTag() {\n return VERSION_BUILDS[this.version] as string;\n }\n\n /**\n * Contains the full name of the Python distribution.\n */\n get pythonDistributionName() {\n return `python-${this.version}-${DL_PLATFORM}-${DL_ARCH}`;\n }\n\n /**\n * Contains the path to the extracted Python distribution folder.\n */\n get extractPath() {\n return join(this.installDir, this.pythonDistributionName);\n }\n\n /**\n * Checks if the selected Python version has been installed on the host platform.\n * @returns True if the installation exists, false otherwise.\n */\n isInstalled() {\n return existsSync(this.extractPath);\n }\n\n /**\n * Will download the compressed Python installation and extract it to\n * the installation directory.\n */\n async install() {\n if (this.isInstalled()) {\n return;\n }\n\n const url = `https://github.com/bjia56/portable-python/releases/download/${this.releaseTag}/${this.pythonDistributionName}.zip`\n const downloadPath = join(this.installDir, `${this.pythonDistributionName}.zip`);\n\n mkdirSync(this.installDir, { recursive: true });\n\n const installDir = this.installDir;\n await download(url, downloadPath);\n\n const zip = new AdmZip(downloadPath);\n zip.extractAllTo(installDir, true)\n\n rmSync(downloadPath);\n if (!this.isInstalled()) {\n throw Error(\"something went wrong and the installation failed\");\n }\n\n chmodSync(this.executablePath, 0o777);\n }\n\n /**\n * Uninstalls the Python distribution.\n */\n async uninstall() {\n if (!this.isInstalled()) {\n return;\n }\n await new Promise<void>((resolve, reject) => rm(this.extractPath, { force: true, recursive: true }, (e) => {\n if (e) {\n reject(e);\n } else {\n resolve();\n }\n }));\n }\n\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,QAAU;AAAA,MACV,OAAS;AAAA,MACT,OAAS;AAAA,QACP;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,gBAAkB;AAAA,QAClB,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,QAAU;AAAA,MACV,SAAW;AAAA,MACX,MAAQ;AAAA,QACN,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,MACZ,cAAgB;AAAA,QACd,WAAW;AAAA,MACb;AAAA,MACA,iBA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AK,YAAY,EAAE,WAAW,KAAK,CAAC;AAE9C,YAAM,aAAa,KAAK;AACxB,YAAM,SAAS,KAAK,YAAY;AAEhC,YAAM,MAAM,IAAI,OAAO,YAAY;AACnC,UAAI,aAAa,YAAY,IAAI;AAEjC,aAAO,YAAY;AACnB,UAAI,CAAC,KAAK,YAAY,GAAG;AACrB,cAAM,MAAM,kDAAkD;AAAA,MAClE;AAEA,gBAAU,KAAK,gBAAgB,GAAK;AAAA,IACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKM,YAAY;AAAA;AACd,UAAI,CAAC,KAAK,YAAY,GAAG;AACrB;AAAA,MACJ;AACA,YAAM,IAAI,QAAc,CAAC,SAAS,WAAW,GAAG,KAAK,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,GAAG,CAAC,MAAM;AACvG,YAAI,GAAG;AACH,iBAAO,CAAC;AAAA,QACZ,OAAO;AACH,kBAAQ;AAAA,QACZ;AAAA,MACJ,CAAC,CAAC;AAAA,IACN;AAAA;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bjia56/portable-python",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Portable Python",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",