Skip to content

Commit

Permalink
create virtualenv for python dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rehan892 committed Dec 23, 2024
1 parent 35af246 commit 492cef0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scaf
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,25 @@ command_exists() {
if ! command_exists pip; then
echo "pip is not installed. Installing pip..."
curl -sS https://bootstrap.pypa.io/get-pip.py | $PYTHON_CMD
PIP_ROOT_USER_ACTION=ignore
fi

if ! command_exists uv; then
echo "Installing uv..."
$PYTHON_CMD -m pip install --user uv
fi

# Create a virtual environment with uv
echo "Creating a virtual environment using uv..."
uv venv .venv --python $PYTHON_CMD

# Activate the virtual environment
echo "Activating the virtual environment..."
source .venv/bin/activate

# Install dependencies
echo "Installing cookiecutter and other dependencies..."
uv pip install --system black isort cookiecutter --prefix "/home/$USERNAME/.local/"
PIP_ROOT_USER_ACTION=ignore
uv pip install black isort cookiecutter

echo "Creating your project..."
cookiecutter $COOKIECUTTER_OPTIONS $REPO_URL --directory="$DEFAULT_DIRECTORY" project_slug="$COOKIECUTTER_SLUG" _challenge="$SCAF_CHALLENGE"
Expand Down

0 comments on commit 492cef0

Please sign in to comment.