PYTHON_VERSION = null?

there is some python code in my repo, that doesn't have anything to do with the sveltekit app i'm building. installing python takes a long time and is a waste of resources - how can i override this automatically-detected dependency? can i set the version to null as an env var?
8 Replies
rawwerks
rawwerks10mo ago
Installing python null
11:13:43.488 python-build null /opt/buildhome/.asdf/installs/python/null
11:13:43.521 python-build: definition not found: null
11:13:43.530 Error: Exit with error code: 1
11:13:43.530 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
11:13:43.531 at Object.onceWrapper (node:events:652:26)
11:13:43.531 at ChildProcess.emit (node:events:537:28)
11:13:43.531 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
11:13:43.540 Failed: build command exited with code: 1
11:13:44.417 Failed: error occurred while running build command
Installing python null
11:13:43.488 python-build null /opt/buildhome/.asdf/installs/python/null
11:13:43.521 python-build: definition not found: null
11:13:43.530 Error: Exit with error code: 1
11:13:43.530 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
11:13:43.531 at Object.onceWrapper (node:events:652:26)
11:13:43.531 at ChildProcess.emit (node:events:537:28)
11:13:43.531 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
11:13:43.540 Failed: build command exited with code: 1
11:13:44.417 Failed: error occurred while running build command
is there a better way to prevent pages from installing python?
Cyb3r-Jak3
Cyb3r-Jak310mo ago
I don't think you can prevent it but if you set the PYTHON_VERSION environment variable to 3.11.5 (the default) then it shouldn't install a different version.
rawwerks
rawwerks10mo ago
yeah i don't need a different version, i don't nee python at all but i can't override the auto-detect without moving my python code to .gitignore (which i don't want to do because i need to develop the backend in the same repo.) is there a way i can cache the python install so it doesn't take up so much time with every new build?
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Yeah what I suggested should work and not install a different version but use the one already there
rawwerks
rawwerks10mo ago
oh, got it. so it's already got that installed lemme try now. is there some default variable i can use so that i don't need to check forever what the default is? like $DEFAULT_PYTHON? hardsetting to 3.11.5 worked btw, thank you so much @Cyb3r-Jok3 ! saves me like 2 mins every build.
Cyb3r-Jak3
Cyb3r-Jak310mo ago
I don't think there is a enviroment variable for it but I got the version from https://developers.cloudflare.com/pages/configuration/language-support-and-tools/
rawwerks
rawwerks10mo ago
got it, i just am hoping to avoid having to re-check that every time they change it.
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Definitely not ideal. You should make a suggestion in #pages-feature-suggestions
Want results from more Discord servers?
Add your server