Skip to content

Avoid hard-coding "quantum" in scripts/ scripts #1082

@mhucka

Description

@mhucka

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/devopsInvolves build systems, Make files, Bazel files, continuous integration, and/or other DevOps topicshelp wantedHelp with this would be appreciatedno QC knowledge neededDoes not require knowledge of quantum computingpriority/for-0.7.7To be done before releasing TFQ version 0.7.7

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions