How to ignore __pycache__ and other directories during up project build
Last updated: July 29, 2026
When running Python-based unit tests (e.g., with pytest), Python generates __pycache__ directories. The up CLI may attempt to treat these as buildable functions, causing a build failure like the following:
❯ up project build
✓ Checking dependencies
✓ Generating language schemas
ERROR Building functions
up: error: failed to build function "__pycache__": failed to find a builder: no suitable builder foundAs of up CLI v0.52.0, you can configure the up CLI to explicitly ignore specific paths during a project build. This is done by adding a spec.ignore field to your project file.
Configuring the ignore list
Open your project's manifest file (e.g., upbound.yaml or similar) and add the paths you want to ignore under spec.ignore. For example:
apiVersion: meta.dev.upbound.io/v2alpha1
kind: Project
metadata:
name: my-project
spec:
ignore:
- functions/__pycache__
dependsOn:
- apiVersion: pkg.crossplane.io/v1
kind: Provider
package: xpkg.upbound.io/upbound/provider-aws-s3
version: v2.6.2Adjust the path under spec.ignore to match wherever the __pycache__ directories are being generated within your project structure. Once configured, up project build will skip those paths entirely, eliminating the need for manual cleanup.
Requirements
This feature requires up CLI v0.52.0 or later. See the up CLI release notes for more details.