diff --git a/.gitignore b/.gitignore index f1b2e1bc..a5abbd73 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ celerybeat.pid # Environments .env .venv +.venv_wsl env/ venv/ ENV/ diff --git a/docs/source/contribute/development/developer_guide.rst b/docs/source/contribute/development/developer_guide.rst index fb4fb2fd..f934bb0f 100644 --- a/docs/source/contribute/development/developer_guide.rst +++ b/docs/source/contribute/development/developer_guide.rst @@ -9,6 +9,7 @@ Developer guide :hidden: developer_guide/dev_installation + developer_guide/wsl_setup developer_guide/git_workflow developer_guide/ci developer_guide/coding_standards @@ -35,6 +36,20 @@ Developer guide Installation + .. grid-item-card:: WSL Setup + :text-align: center + + Set up Ubuntu WSL for development. + + +++ + + .. button-ref:: developer_guide/wsl_setup + :color: primary + :click-parent: + :expand: + + WSL Setup + .. grid-item-card:: Git Workflow :text-align: center diff --git a/docs/source/contribute/development/developer_guide/wsl_setup.rst b/docs/source/contribute/development/developer_guide/wsl_setup.rst new file mode 100644 index 00000000..8e5b9f9f --- /dev/null +++ b/docs/source/contribute/development/developer_guide/wsl_setup.rst @@ -0,0 +1,73 @@ +.. _wsl_setup: + +========= +WSL Setup +========= + +If you are a Windows user and prefer developing in a Linux environment, +you can use the Windows Subsystem for Linux (WSL). This guide will help +you set up ``skbase`` for development in Ubuntu WSL. + +Prerequisites +------------- + +1. **Install WSL**: Ensure you have WSL and the Ubuntu distribution + installed on your Windows machine. If not, you can install it by + running the following command in PowerShell as administrator: + + .. code-block:: powershell + + wsl --install + +2. **Clone the Repository**: Clone the ``skbase`` repository to your + Windows filesystem (e.g., ``C:\code\skbase``). WSL can access your + Windows files via ``/mnt/c/``. + + Alternatively, you can clone it directly inside the WSL filesystem + for better performance: + + .. code-block:: bash + + git clone https://github.com/sktime/skbase.git + cd skbase + +Automated Setup +--------------- + +We provide a script to automate the setup of your development +environment in Ubuntu WSL. + +1. Open your Ubuntu terminal. +2. Navigate to the root directory of the cloned ``skbase`` repository. +3. Run the setup script: + + .. code-block:: bash + + bash scripts/setup_wsl.sh + +This script will: + +- Update your package lists. +- Install ``python3-venv`` and ``python3-pip``. +- Create a virtual environment named ``.venv_wsl``. +- Install ``skbase`` in editable mode with development + and test dependencies. + +Manual Activation +----------------- + +After the setup is complete, you can activate the environment whenever +you open a new terminal: + +.. code-block:: bash + + source .venv_wsl/bin/activate + +Verifying the Installation +-------------------------- + +To verify that everything is set up correctly, you can run the tests: + +.. code-block:: bash + + pytest diff --git a/scripts/setup_wsl.sh b/scripts/setup_wsl.sh new file mode 100644 index 00000000..e9e8de72 --- /dev/null +++ b/scripts/setup_wsl.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Exit on error +set -e + +echo "Starting Ubuntu WSL setup for skbase..." + +# Update package lists +echo "Updating package lists..." +sudo apt update + +# Install necessary system dependencies +echo "Installing python3-venv and python3-pip..." +sudo apt install -y python3-venv python3-pip + +# Create virtual environment +if [ ! -d ".venv_wsl" ]; then + echo "Creating virtual environment .venv_wsl..." + python3 -m venv .venv_wsl +else + echo ".venv_wsl already exists, skipping creation." +fi + +# Activate virtual environment +echo "Activating virtual environment..." +source .venv_wsl/bin/activate + +# Upgrade pip +echo "Upgrading pip..." +pip install --upgrade pip + +# Install skbase in editable mode with development and test dependencies +echo "Installing skbase with [dev,test] dependencies..." +pip install -e ".[dev,test]" + +echo "Setup complete! To activate the environment, run: source .venv_wsl/bin/activate"