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

def PythonDetermine in setup.py #3975

Merged
merged 2 commits into from
Jan 22, 2025
Merged
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
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
COMMITID = 'none'


def determine_python_version():
"""
Determine the current python version. The function return a string such as '3.7'.
"""
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
return python_version


def determine_opencc_version():
# get gcc version
gcc_version = None
Expand All @@ -53,7 +61,7 @@ def determine_opencc_version():

def determine_scipy_version():
# get python version
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
python_version = determine_python_version()

# determine scipy version
if python_version == "3.8":
Expand All @@ -63,7 +71,7 @@ def determine_scipy_version():

def determine_matplotlib_version():
# get python version
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
python_version = determine_python_version()

# determine matplotlib version
if python_version == "3.8" or python_version == "3.9":
Expand Down