-
Notifications
You must be signed in to change notification settings - Fork 1
CONTRIBUTING
This guide includes steps assuming you're starting a project. If this is not your first project in the environment, you may have already completed many of these steps.
See Creating a Repository from a template
Mac Users: Congratulations. You have a Unix prompt.
Windows Users:
- Install Debian or Ubuntu under WSL through the Windows store.
- Or SSH into a remote Linux development system.
Tip: I had to set my WSL user
edwardpassword from PowerShell outside WSL, due to this bug https://github.com/microsoft/terminal/issues/1823PS> wsl -d Debian -u root passwd edward New password: Retype new password: passwd: password updated successfully
These steps are all completed inside of a Linux/Unix command prompt.
Tip: Windows WSL tips in this guide are not needed on Mac or remote Linux systems.
These steps were captured on Debian WSL2 on Windows 10.
Tip: Some commands, specifically
apt, will differ on a Mac computer. Sometimesaptcan be replaced withbrewfor Mac use.
-
Install common packages
These packages are necessary to install
brewand to install versions ofPythononcepyenvhas been installed.sudo apt-get update; sudo apt-get -y install \ git make build-essential libssl-dev zlib1g-dev \ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \ libffi-dev liblzma-dev -
Install Brew (without
sudo)Use the
curlcommand provided athttps://https://brew.shto run the installer provided in theHEADcommit of theHomebrewproject./bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Tip: Run the commands recommended by
brewto update~/.profileConfirm that
brewis installed and available withwhich brew:$ which brew /home/linuxbrew/.linuxbrew/bin/brew
-
Install PyEnv:
brew update && brew upgrade && brew install pyenv
Tip: Create a file
/etc/wsl.confwith the following to remove Windows executables from the path inWSL. This prevents errors from running the wrong copy of tools, likegitthat may be installed both inside and outsideWSL.[interop] appendWindowsPath = falseAnd Consider adding these aliases to
~/.bashrcfor convenience:alias code="/mnt/c/Program\ Files/Microsoft\ VS\ Code/bin/code" alias clip="/mnt/c/Windows/system32/clip.exe" alias paste="/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -noprofile -command Get-Clipboard"Alias usage:
cat ./text.txt | copy # Copy to the Windows Copy/Paste buffer paste > ./text.txt # Paste from Windows code ./text.txt # Open a file in Windows VSCode editor code . # Open the current folder in Windows VSCode
Install and set the Python version for the current project
# Install the needed Python version
pyenv install 3.9.11
# Set the local folder to use the needed Python version
cd /data/src/project1
pyenv local 3.9.11
# Confirm the Python version in use before creating a virtual environment
python -V
python -m venv venv
source ./venv/bin/activate
# Install required packages for the local project
pip install -f requirements.txtTip: Check the project
Makefilefor helper commands. Oncepython -Vreturns the correct version, theMakefilemay be able to do the rest.
Check your .bashrc for stray additions. At one point we had CC set.