-
Notifications
You must be signed in to change notification settings - Fork 158
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
3 changed files
with
30 additions
and
5 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 |
---|---|---|
@@ -1,3 +1,28 @@ | ||
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
# This file is part of the Acts project. | ||
# | ||
# Copyright (C) 2021-2022 CERN for the benefit of the Acts project | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
export PYTHONPATH=$python_dir:$PYTHONPATH | ||
# This script sets up the ACTS Python bindings in the environment in a somewhat | ||
# robust way. | ||
|
||
if [ -n "$ZSH_VERSION" ]; then | ||
export PYTHONPATH=${0:a:h}:$PYTHONPATH | ||
elif [ -n "$BASH_VERSION" ]; then | ||
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
export PYTHONPATH=$python_dir:$PYTHONPATH | ||
else | ||
# If the current shell is not ZSH or Bash, we can't guarantee that the | ||
# script will work, so we throw an error. | ||
echo "ERROR: neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified." | ||
exit 1 | ||
fi | ||
|
||
# This message might seem excessive, but the Acts bindings are only installed | ||
# for one Python version, and it is not trivial for the user to find out which. | ||
# Thus, we let them know explicitly so they can more easily debug any potential | ||
# import errors. | ||
echo "INFO: Acts Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ bindings setup complete." |