Is it possible to ignore files with Cloudflare Pages?

I’m experimenting with Cloudflare Pages, but am having some difficulty getting the site to build.

It’s a Gatsby site but I have some Python and Ruby scripts in the repo that perform tasks that aren’t related to building the website.

Cloudflare Pages reads the requirements.txt and Gemfile and tries to install the dependencies. The build process uses Python 2, which crashes the build because the packages that I use are only available for Python 3.

Ideally, I’d like Cloudflare Pages to completely ignore the requirements.txt and Gemfile, because there is nothing in them that is needed for the build, so it will slow down the builds even if I can get it to work.

Is there a way to ignore those files, or at least tell Cloudflare Pages to use Python 3 so the build doesn’t crash?

Edit: I just found these instructions for changing the Python version. That should work for now. Being able to ignore those files would probably speed up the build though.

Edit 2:

It doesn’t like PYTHON_VERSION set to 3.8.

15:13:01.133	Initializing build environment. This may take up to a few minutes to complete
15:13:33.529	Success: Finished initializing build environment
15:13:33.529	Cloning repository...
15:13:37.284	Success: Finished cloning repository files
15:13:38.072	Installing dependencies
15:13:38.072	/opt/build/bin/run-build-functions.sh: line 168: /opt/buildhome/python3.8/bin/activate: No such file or directory
15:13:38.072	Error setting python version from the PYTHON_VERSION environment variable
15:13:38.072	Please see https://github.com/netlify/build-image/#included-software for current versions
15:13:38.072	Failed: build command exited with code: 1

Edit 3: I got it to build by renaming requirements.txt to __requirements.txt. I think I’d ideally prefer to build my sites locally and then deploy only the static files.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.