Skip to content

Commit

Permalink
updated script error comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-ph committed May 7, 2023
1 parent 9781868 commit 732b695
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 25 deletions.
20 changes: 12 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# sys.path.insert(0, os.path.abspath("../../"))
sys.path.insert(0, os.path.abspath("../.."))
for each_folder_name in os.listdir(os.path.abspath("../../src")):
sys.path.insert(0, os.path.abspath("../../src/"+each_folder_name))
sys.path.insert(0, os.path.abspath("../../src/" + each_folder_name))
# sys.path.insert(0, os.path.abspath("../../src/openqaoa-core"))
# sys.path.insert(0, os.path.abspath("../../src/openqaoa-qiskit"))
# sys.path.insert(0, os.path.abspath("../../src/openqaoa-pyquil"))
Expand Down Expand Up @@ -58,13 +58,17 @@
"sphinx.ext.intersphinx",
]

autodoc_mock_imports = ["botocore",
"qiskit_aer",
"pyquil",
"azure",
"boto3",
"qcs_api_client",
"qiskit_ibm_provider", "qiskit", "braket"]
autodoc_mock_imports = [
"botocore",
"qiskit_aer",
"pyquil",
"azure",
"boto3",
"qcs_api_client",
"qiskit_ibm_provider",
"qiskit",
"braket",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
1 change: 1 addition & 0 deletions scripts/install_all_subpackages.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Exit immediately if a command exits with a non-zero status.
set -e

# The order of install is important therefore the list cannot be dynamically generated
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_azure.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_braket.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_core.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_dev.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_pyquil.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_and_test_openqaoa_qiskit.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/push_package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_build_dist.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The script will stop if any intermediate file raises an error.
#Exit immediately if a command exits with a non-zero status.
set -e

# TODO: Dynamically generate names (The order of installing and pushing is important here.)
Expand Down
32 changes: 23 additions & 9 deletions scripts/test_version.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import os
import importlib

version_dict={}
for each_file in os.listdir('src'):
if each_file.startswith('openqaoa-'):
__version__=''
if not each_file=='openqaoa-core':
exec(open('./src/'+each_file+'/'+each_file.replace('-', '_')+'/_version.py').read())
version_dict = {}
for each_file in os.listdir("src"):
if each_file.startswith("openqaoa-"):
__version__ = ""
if not each_file == "openqaoa-core":
exec(
open(
"./src/"
+ each_file
+ "/"
+ each_file.replace("-", "_")
+ "/_version.py"
).read()
)
else:
exec(open('./src/'+each_file+'/openqaoa/_version.py').read())
exec(open("./src/" + each_file + "/openqaoa/_version.py").read())
version_dict.update({each_file: __version__})

version_check = [each_item==version_dict['openqaoa-core'] for each_item in version_dict.values()]
version_check = [
each_item == version_dict["openqaoa-core"] for each_item in version_dict.values()
]
for each_check in version_check:
if not each_check:
raise Exception('All Plugins should have the same version as the core version of OQ. {}'.format(version_dict))
raise Exception(
"All Plugins should have the same version as the core version of OQ. {}".format(
version_dict
)
)

0 comments on commit 732b695

Please sign in to comment.