#!/bin/bash python_version=$1 gitlab_user=$2 gitlab_personal_access_token=$3 # cookiecutter https://gitlab.knecon.com/knecon/research/template-python-project.git --checkout master # latest_dir=$(ls -td -- */ | head -n 1) # should be the dir cookiecutter just created # cd $latest_dir pyenv install $python_version pyenv local $python_version pyenv shell $python_version # install poetry globally (PREFERRED), only need to install it once # curl -sSL https://install.python-poetry.org | python3 - # remember to update poetry once in a while poetry self update # install poetry in current python environment, can lead to multiple instances of poetry being installed on one system (DISPREFERRED) # pip install --upgrade pip # pip install poetry poetry config virtualenvs.in-project true poetry config installer.max-workers 10 poetry config repositories.gitlab-research https://gitlab.knecon.com/api/v4/groups/19/-/packages/pypi poetry config http-basic.gitlab-research ${gitlab_user} ${gitlab_personal_access_token} poetry config repositories.gitlab-red https://gitlab.knecon.com/api/v4/groups/12/-/packages/pypi poetry config http-basic.gitlab-red ${gitlab_user} ${gitlab_personal_access_token} poetry config repositories.gitlab-fforesight https://gitlab.knecon.com/api/v4/groups/269/-/packages/pypi poetry config http-basic.gitlab-fforesight ${gitlab_user} ${gitlab_personal_access_token} poetry env use $(pyenv which python) poetry install --with=dev poetry update source .venv/bin/activate pre-commit install pre-commit autoupdate