tensorflow/quantum

Avoid hard-coding "quantum" in `scripts/` scripts

Open

#1.082 geöffnet am 5. Juni 2026

Auf GitHub ansehen
 (1 Kommentar) (1 Reaktion) (0 zugewiesene Personen)Python (653 Forks)github user discovery
area/devopshelp wantedno QC knowledge neededpriority/before-0.7.7

Repository-Metriken

Stars
 (2.145 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

scripts/ci_validate_tutorials.sh has a hard-coded assumption that the user's local git working directory is named "quantum":

cd ..
examples_output=$(python3 quantum/scripts/test_tutorials.py)

This fails for developers who (like me) have multiple copies of the TFQ source tree, with different names for different concurrent development projects. Instead of assuming the directory is quantum, the scripts in the scripts/ directory should get the correct name using code such as the following:

thisdir=$(CDPATH="" cd -- "$(dirname -- "${0}")" && pwd -P)
repo_dir=$(git -C "${thisdir}" rev-parse --show-toplevel 2>/dev/null)

Contributor Guide