forked from entropicalabs/openqaoa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
44 additions
and
25 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
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
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
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,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 | ||
) | ||
) |