Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added warnings to top level compile function for trying to import non… #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ucc/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
from qbraid.transpiler import transpile
from .transpilers.ucc_defaults import UCCDefault1


import sys
import warnings

# Specify the supported Python version range
REQUIRED_MAJOR = 3
MINOR_VERSION_MIN = 12
MINOR_VERSION_MAX = 13

current_major = sys.version_info.major
current_minor = sys.version_info.minor

if current_major != REQUIRED_MAJOR or not (MINOR_VERSION_MIN <= current_minor <= MINOR_VERSION_MAX):
warnings.warn(
f"Warning: This package is designed for Python {REQUIRED_MAJOR}.{MINOR_VERSION_MIN}-{REQUIRED_MAJOR}.{MINOR_VERSION_MAX}. "
f"You are using Python) {current_major}.{current_minor}.")
supported_circuit_formats = ConversionGraph().nodes()


Expand Down
Loading