Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
b1226961
Commit
b1226961
authored
6 years ago
by
Antoine Regimbeau
Browse files
Options
Downloads
Patches
Plain Diff
ENH: warn user using python.X with X!=5
parent
44e4642f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Packaging/Files/setup_python.sh
+22
-5
22 additions, 5 deletions
Packaging/Files/setup_python.sh
with
22 additions
and
5 deletions
Packaging/Files/setup_python.sh
+
22
−
5
View file @
b1226961
...
...
@@ -37,10 +37,12 @@ if [ ! -f "$OTB_PYTHON_EXE" ] ; then
fi
fi
python_major_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[0])"
)
python_minor_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[1])"
)
python_patch_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[2])"
)
python_version
=
"
$python_major_version
.
$python_minor_version
.
$python_patch_version
"
python_version_check
()
{
python_major_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[0])"
)
python_minor_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[1])"
)
python_patch_version
=
$(
$OTB_PYTHON_EXE
-c
"import sys;print(sys.version_info[2])"
)
python_version
=
"
$python_major_version
.
$python_minor_version
.
$python_patch_version
"
}
python_check_failed
()
{
printf
%s
\\
n
"*****Error occurred during installation******"
...
...
@@ -52,7 +54,22 @@ python_check_failed() {
}
# Do we need the exact version of python?
if
[
"
$python_major_version
"
-lt
3
]
;
then
python_check_failed
OTB_PYTHON_EXE
=
$(
which python3
)
if
[!
-f
"
$OTB_PYTHON_EXE
"
]
;
then
python_check_failed
else
python_version_check
()
if
[
"
$python_major_version
"
-lt
3
]
;
then
python_check_failed
fi
fi
fi
# test for 3.5 only ! and warn user if not!
if
[
"
$python_major_version
"
-eq
5
]
;
then
printf
%s
\\
n
"*****Warning******"
printf
%s
\\
n
"OTB python bindings require python3.5 but current detected python version is
$python_version
"
printf
%s
\\
n
"This case is undefined!"
fi
python_INSTSONAME
=
$(
$OTB_PYTHON_EXE
-c
"import sys; from distutils import sysconfig; print (sysconfig.get_config_var('INSTSONAME'));"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment