The setup is designed for an Ubuntu/Linux (recommended) or Manjaro/Linux setup with VS Code installed. For a generalised step-by-step setup for different OS environments, please refer to the Documentation channel on Teams, otherwise continue to see the following summarised steps (please note that the VS Code extensions are optional):
- Generate and add an SSH key for the device this repo is to be downloaded in on GitHub.
- Clone this repository via SSH.
- On a terminal, cd into this repo's directory, and run the following command “source ./setup/_venv-setup.sh”, where is the operating system being used by the dev. A prompt will be displayed to enter the sudo password (if applicable). Please enter this to run the rest of the script. This will create and setup a virtual environment for the repo via the poetry method, and will also install pre-commit.
- Now the terminal is ready to run project scripts.
These instructions are written for non Ubuntu OS environments
- Install git, Python 3, and curl that can be run on a terminal. rsync are optionally required to run some tests.
- Create an SSH key for the device to link it to the dev’s GitHub account.
- Clone the mytardis_ingestion repo in the desired directory. This can be achieved on the terminal by first changing into the desired directory, then running the command “git clone [email protected]:UoA-eResearch/mytardis_ingestion.git”
- On the terminal, run the following command “curl -sSL https://install.python-poetry.org | python3 –“. This will install Poetry in the OS.
- Add the Poetry to the PATH environment variable.
- Run the following commands in this order (the explanation for each command is defined in the line above that command that start with #, and has been written to be friendly with terminal/bash):
# create a local virtual environment in the project directory
poetry config virtualenvs.in-project true
# in this case this command sets up the poetry file for installation
poetry lock
# installs all the relevant libraries for Python
poetry install
# installs git pre-commit
poetry run pre-commit install
# updates any relevant dependencies, used to avoid dependency issues
poetry run pre-commit autoupdate
- Run the command “poetry shell” to activate the virtual environment and the repo is now setup and ready to run the project.
- Open the “vscode_extensions.txt” file (found in the ./setup folder) and copy the commands for installing the extensions.
- Using the terminal (or VS Code's terminal), paste the commands here and press the Enter key to install the relevant extensions required for VS Code.