diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index c32a555e5..788f790b5 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -166,6 +166,9 @@ * Fix checkout command in test workflows for rc branches. [(#777)](https://github.com/PennyLaneAI/pennylane-lightning/pull/777) +* Point to the right Lightning root folder independently from the invocation location, when configuring the project. + [(#874)](https://github.com/PennyLaneAI/pennylane-lightning/pull/874) + ### Contributors This release contains contributions from (in alphabetical order): diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 2531895cc..30103c25a 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.38.0-dev51" +__version__ = "0.38.0-dev52" diff --git a/scripts/configure_pyproject_toml.py b/scripts/configure_pyproject_toml.py index 99b184d91..e8bdecb3f 100755 --- a/scripts/configure_pyproject_toml.py +++ b/scripts/configure_pyproject_toml.py @@ -22,7 +22,9 @@ import toml from backend_support import backend, device_name -path_to_version = Path("pennylane_lightning").absolute() / "core" / "_version.py" +path_to_project = Path(__file__).parent.parent.absolute() + +path_to_version = path_to_project / Path("pennylane_lightning") / "core" / "_version.py" with open(path_to_version, encoding="utf-8") as f: version = f.readlines()[-1].split()[-1].strip("\"'") @@ -50,6 +52,10 @@ def parse_args(): if __name__ == "__main__": parsed_args = parse_args() + + if parsed_args.path.strip() == "": + parsed_args.path = path_to_project.as_posix() + pyproject_path = os.path.join(parsed_args.path, "pyproject.toml") pyproject = toml.load(pyproject_path)