-
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
3 changed files
with
106 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -x "$(command -v pyenv)" ]]; then | ||
echo "Please install pyenv" | ||
exit 1 | ||
fi | ||
|
||
{{- if eq .nrel_cluster "eagle" }} | ||
module load gcc | ||
module load binutils | ||
module load git | ||
module load gnutls | ||
module load libtool | ||
module load bzip2 | ||
module load libffi | ||
module load openssl | ||
module load sqlite | ||
export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" | ||
export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" | ||
{{- else if eq .nrel_cluster "ellis" }} | ||
module load gcc | ||
module load binutils | ||
module load git | ||
module load gnutls | ||
module load libtool | ||
module load bzip2 | ||
module load libffi | ||
module load sqlite | ||
export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" | ||
export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" | ||
{{- end }} | ||
export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" | ||
export PYTHON_CFLAGS="-mtune=native" | ||
|
||
|
||
PYTHON_VERSION="${1}" | ||
if [ ! -z "$python_version" ] | ||
then | ||
pyenv install | ||
else | ||
pyenv install -s ${PYTHON_VERSION} | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
# start clean | ||
# rm -rf $(pyenv root) | ||
# curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - --uninstall | ||
|
||
|
||
# Make sure python3 installation worked | ||
if ! command -v python3 >/dev/null 2>&1; then | ||
echo "Please install python3" | ||
exit 1 | ||
fi | ||
|
||
# Install pyenv and a sane python | ||
if [[ ! -x "$(command -v pyenv)" ]]; then | ||
curl https://pyenv.run | bash | ||
fi | ||
|
||
export PYENV_ROOT="${HOME}/.pyenv" | ||
if [ -d "${PYENV_ROOT}" ]; then | ||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
fi | ||
|
||
PYTHON_VERSION="3.11.1" | ||
${HOME}/bin/pyenv_python_install ${PYTHON_VERSION} | ||
|
||
# Install poetry with the pyenv python | ||
if [[ ! -x "$(command -v poetry)" ]]; then | ||
curl -sSL https://install.python-poetry.org | PYENV_VERSION=${PYTHON_VERSION} POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - | ||
fi | ||
|
||
# Create a sane dotfiles venv | ||
export PYENV_VERSION=${PYTHON_VERSION} | ||
export WORKON_HOME=${HOME}/.virtualenvs | ||
venv_name="dotfiles" | ||
venv_location="${WORKON_HOME}/${venv_name}" | ||
|
||
echo "Installing dotfiles venv at ${venv_location} with $(python --version)" | ||
|
||
python -m venv "${venv_location}" | ||
source ${venv_location}/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install --requirement=/dev/stdin <<EOF | ||
autopep8 | ||
black | ||
flake8 | ||
jedi | ||
matplotlib | ||
numpy | ||
pandas | ||
pycodestyle | ||
pydocstyle | ||
pyflakes | ||
python-lsp-black | ||
python-lsp-server | ||
pyls-flake8 | ||
pylint | ||
scikit-learn | ||
scipy | ||
seaborn | ||
rope | ||
yapf | ||
EOF |