Skip to content
Snippets Groups Projects
Commit 840430c4 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

add setup.sh

parent c6da061e
No related branches found
No related tags found
2 merge requests!10Add pre commit improve tox setup,!9Draft: Add pre-commit hook and improve with better linting
Pipeline #110033 failed
Pipeline: Python Binary Wheel Package

#110035

    Pipeline: Python Binary Wheel Package

    #110034

      #! /usr/bin/env bash
      #
      # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
      # SPDX-License-Identifier: Apache-2.0
      #
      # This file's directory is used to determine the station control directory
      # location.
      if [ -z ${BASH_SOURCE} ]; then
      BASH_SOURCE=${(%):-%x}
      fi
      ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
      # Create a virtual environment directory if it doesn't exist
      VENV_DIR="${ABSOLUTE_PATH}/.venv"
      if [ ! -d "$VENV_DIR" ]; then
      echo "Creating virtual environment..."
      python3 -m venv "$VENV_DIR"
      fi
      # Activate the virtual environment
      source "$VENV_DIR/bin/activate"
      python -m pip install pre-commit
      python -m pip install "tox>=4.21.0"
      # Install git pre-commit pre-push hook
      if [ ! -f "${ABSOLUTE_PATH}/.git/hooks/pre-push.legacy" ]; then
      source "${ABSOLUTE_PATH}/bin/install-hooks/pre-commit.sh"
      fi
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Please register or to comment