pinokiod 7.3.0 → 7.3.1

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.
@@ -1,8 +1,27 @@
1
1
  const semver = require('semver')
2
2
 
3
+ const CONDA_PIN_VERSION = "25.5.1"
4
+ const DEFAULT_SQLITE_PIN_VERSION = "3.47.2"
5
+ const WINDOWS_SQLITE_PIN_VERSION = "3.53.2"
3
6
  const WINDOWS_PYTHON_SSL_FIX_SPEC = "python=3.10.20=*_1_cpython"
4
7
  const WINDOWS_PYTHON_SSL_FIX_VERSION = "3.10.20"
5
8
 
9
+ const sqlitePinVersion = (platform) => {
10
+ return platform === "win32" ? WINDOWS_SQLITE_PIN_VERSION : DEFAULT_SQLITE_PIN_VERSION
11
+ }
12
+
13
+ const sqliteInstallSpec = (platform) => {
14
+ return `sqlite=${sqlitePinVersion(platform)}`
15
+ }
16
+
17
+ const sqlitePinnedSpec = (platform) => {
18
+ return `sqlite ==${sqlitePinVersion(platform)}`
19
+ }
20
+
21
+ const isExpectedSqlitePinned = (platform, version) => {
22
+ return String(version) === sqlitePinVersion(platform)
23
+ }
24
+
6
25
  const condaBuildNumber = (build) => {
7
26
  const chunks = String(build || "").split("_").reverse()
8
27
  const buildNumber = chunks.find((chunk) => /^\d+$/.test(chunk))
@@ -25,6 +44,10 @@ const isWindowsPythonSslFixed = (version, build) => {
25
44
  }
26
45
 
27
46
  module.exports = {
47
+ CONDA_PIN_VERSION,
28
48
  WINDOWS_PYTHON_SSL_FIX_SPEC,
49
+ isExpectedSqlitePinned,
29
50
  isWindowsPythonSslFixed,
51
+ sqliteInstallSpec,
52
+ sqlitePinnedSpec,
30
53
  }
@@ -5,9 +5,13 @@ const { glob } = require('glob')
5
5
  const semver = require('semver')
6
6
  const { buildCondaListFromMeta } = require('./conda-meta')
7
7
  const {
8
+ CONDA_PIN_VERSION,
8
9
  WINDOWS_PYTHON_SSL_FIX_SPEC,
10
+ isExpectedSqlitePinned,
9
11
  isWindowsPythonSslFixed,
10
- } = require('./conda-python')
12
+ sqliteInstallSpec,
13
+ sqlitePinnedSpec,
14
+ } = require('./conda-pins')
11
15
 
12
16
  class Conda {
13
17
  description = "Pinokio uses Conda to install various useful programs in an isolated manner."
@@ -53,6 +57,12 @@ class Conda {
53
57
  win32: ["miniconda/etc/profile.d", "miniconda/bin", "miniconda/Scripts", "miniconda/condabin", "miniconda/lib", "miniconda/Library/bin", "miniconda/pkgs", "miniconda"],
54
58
  linux: ["miniconda/etc/profile.d", "miniconda/bin", "miniconda/condabin", "miniconda/lib", "miniconda/Library/bin", "miniconda/pkgs", "miniconda"]
55
59
  }
60
+ pinnedPackages() {
61
+ return [
62
+ `conda ==${CONDA_PIN_VERSION}`,
63
+ sqlitePinnedSpec(this.kernel.platform),
64
+ ].join("\n")
65
+ }
56
66
  env() {
57
67
  let base = {
58
68
  // CONDA_ROOT: this.kernel.bin.path("miniconda"),
@@ -134,7 +144,7 @@ report_errors: false`)
134
144
  let pinned_exists = await this.kernel.exists("bin/miniconda/conda-meta")
135
145
  if (pinned_exists) {
136
146
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda ==24.11.3`)
137
- await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "conda ==25.5.1\nsqlite ==3.47.2")
147
+ await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), this.pinnedPackages())
138
148
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "")
139
149
  //sqlite ==3.47.2`)
140
150
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.9.0`)
@@ -201,7 +211,7 @@ report_errors: false`)
201
211
  // Use sqlite to check if `conda update -y --all` went through successfully
202
212
  // sometimes it just fails silently so need to check
203
213
  if (name === "sqlite") {
204
- if (String(version) === "3.47.2") {
214
+ if (isExpectedSqlitePinned(this.kernel.platform, version)) {
205
215
  conda_check.sqlite = true
206
216
  }
207
217
  //let coerced = semver.coerce(version)
@@ -278,7 +288,7 @@ report_errors: false`)
278
288
  if (pinned_exists) {
279
289
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.11.1`)
280
290
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda ==24.11.3`)
281
- await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "conda ==25.5.1\nsqlite ==3.47.2")
291
+ await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), this.pinnedPackages())
282
292
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "sqlite ==3.47.2")
283
293
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "")
284
294
  //sqlite ==3.47.2`)
@@ -313,7 +323,7 @@ report_errors: false`)
313
323
  console.log("Conda dependencies to install", { mods })
314
324
 
315
325
  let condaPackages = [
316
- `"sqlite=3.47.2"`,
326
+ `"${sqliteInstallSpec(this.kernel.platform)}"`,
317
327
  `"conda-libmamba-solver>=25.4.0"`,
318
328
  ]
319
329
  if (this.kernel.platform === "win32") {
@@ -22,7 +22,10 @@ const VS = require("./vs")
22
22
  const Cuda = require("./cuda")
23
23
  const Torch = require("./torch")
24
24
  const { buildCondaListFromMeta } = require('./conda-meta')
25
- const { isWindowsPythonSslFixed } = require('./conda-python')
25
+ const {
26
+ isExpectedSqlitePinned,
27
+ isWindowsPythonSslFixed,
28
+ } = require('./conda-pins')
26
29
  const { glob } = require('glob')
27
30
  const fakeUa = require('fake-useragent');
28
31
  const fse = require('fs-extra')
@@ -409,7 +412,7 @@ class Bin {
409
412
  // Use sqlite to check if `conda update -y --all` went through successfully
410
413
  // sometimes it just fails silently so need to check
411
414
  if (name === "sqlite") {
412
- if (String(version) === "3.47.2") {
415
+ if (isExpectedSqlitePinned(this.platform, version)) {
413
416
  conda_check.sqlite = true
414
417
  }
415
418
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {