-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from entropicalabs/dev_setup_change
Setup file Changes for OpenQAOA Plugins
- Loading branch information
Showing
243 changed files
with
4,954 additions
and
2,883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include src/* README.md requirements*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#This file stores instructions to install openqaoa in developer mode. | ||
# Currently can only install all packages together for developer mode. | ||
|
||
.PHONY: dev-install | ||
dev-install: | ||
pip install -e . | ||
pip install -e ./src/openqaoa-core | ||
pip install -e ./src/openqaoa-qiskit | ||
pip install -e ./src/openqaoa-pyquil | ||
pip install -e ./src/openqaoa-braket | ||
pip install -e ./src/openqaoa-azure | ||
|
||
.PHONY: dev-install-tests | ||
dev-install-tests: | ||
pip install -e . | ||
pip install -e ./src/openqaoa-core[tests] | ||
pip install -e ./src/openqaoa-qiskit | ||
pip install -e ./src/openqaoa-pyquil | ||
pip install -e ./src/openqaoa-braket | ||
pip install -e ./src/openqaoa-azure | ||
|
||
.PHONY: dev-install-docs | ||
dev-install-docs: | ||
pip install -e . | ||
pip install -e ./src/openqaoa-core[docs] | ||
pip install -e ./src/openqaoa-qiskit | ||
pip install -e ./src/openqaoa-pyquil | ||
pip install -e ./src/openqaoa-braket | ||
pip install -e ./src/openqaoa-azure | ||
|
||
.PHONY: dev-install-all | ||
dev-install-all: | ||
pip install -e . | ||
pip install -e ./src/openqaoa-core[all] | ||
pip install -e ./src/openqaoa-qiskit | ||
pip install -e ./src/openqaoa-pyquil | ||
pip install -e ./src/openqaoa-braket | ||
pip install -e ./src/openqaoa-azure | ||
|
||
.PHONY: dev-uninstall | ||
dev-uninstall: | ||
pip uninstall openqaoa -y | ||
pip uninstall openqaoa-core -y | ||
pip uninstall openqaoa-qiskit -y | ||
pip uninstall openqaoa-pyquil -y | ||
pip uninstall openqaoa-braket -y | ||
pip uninstall openqaoa-azure -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#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 | ||
modulesList=("openqaoa-core" "openqaoa-qiskit" "openqaoa-braket" "openqaoa-pyquil" "openqaoa-azure") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#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.) | ||
modulesList=("openqaoa-core" "openqaoa-qiskit" "openqaoa-azure") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "testing $entry" | ||
cd src/$entry | ||
pytest -n auto tests | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip uninstall -y $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
# TODO: Dynamically generate names (The order of installing is important here.) | ||
modulesList=("openqaoa-core" "openqaoa-braket") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "testing $entry" | ||
cd src/$entry | ||
pytest -n auto tests | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip uninstall -y $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#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.) | ||
modulesList=("openqaoa-core") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "testing $entry" | ||
cd src/$entry | ||
pytest -n auto tests | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip uninstall -y $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
# TODO: Dynamically generate names (The order of installing is important here.) | ||
modulesList=("src/openqaoa-core" "src/openqaoa-qiskit" "src/openqaoa-braket" "src/openqaoa-pyquil" "src/openqaoa-azure") | ||
|
||
pip install . | ||
pytest tests/ src/*/tests | ||
pip uninstall -y openqaoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#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.) | ||
modulesList=("openqaoa-core" "openqaoa-pyquil") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "testing $entry" | ||
cd src/$entry | ||
pytest -n auto tests | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip uninstall -y $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#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.) | ||
modulesList=("openqaoa-core" "openqaoa-qiskit") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing src/$entry/setup.py" | ||
cd src/$entry | ||
pip install . | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "testing $entry" | ||
cd src/$entry | ||
pytest -n auto tests | ||
cd "../.." | ||
done | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip uninstall -y $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#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.) | ||
modulesList=("src/openqaoa-core" "src/openqaoa-qiskit" "src/openqaoa-braket" "src/openqaoa-pyquil" "src/openqaoa-azure") | ||
|
||
python scripts/test_version.py | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing $entry/setup.py" | ||
cd $entry | ||
pip install . | ||
# python -m build | ||
python3 setup.py -q sdist | ||
python3 setup.py -q bdist_wheel | ||
twine upload --repository testpypi dist/* --username $1 --password $2 | ||
cd "../.." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
install_and_test_openqaoa_core.sh | ||
install_and_test_openqaoa_qiskit.sh | ||
install_and_test_openqaoa_pyquil.sh | ||
install_and_test_openqaoa_braket.sh | ||
install_and_test_openqaoa_azure.sh | ||
install_and_test_openqaoa_dev.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#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.) | ||
modulesList=("src/openqaoa-core" "src/openqaoa-qiskit" "src/openqaoa-braket" "src/openqaoa-pyquil" "src/openqaoa-azure") | ||
|
||
# This script checks that all internal plugins have the same version number | ||
python scripts/test_version.py | ||
|
||
for entry in "${modulesList[@]}"; do | ||
echo "processing $entry/setup.py" | ||
cd $entry | ||
pip install -e . | ||
python -m build | ||
cd "../.." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
modulesList=("openqaoa-core" "openqaoa-qiskit" "openqaoa-braket" "openqaoa-pyquil" "openqaoa-azure") | ||
|
||
for entry in "${modulesList[@]}"; do | ||
pip install -i https://test.pypi.org/simple/ --no-deps $entry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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() | ||
) | ||
else: | ||
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() | ||
] | ||
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 | ||
) | ||
) |
Oops, something went wrong.