Last active
January 13, 2024 01:18
-
-
Save blakeNaccarato/5c0c3043f21b846b1a3188782908438f to your computer and use it in GitHub Desktop.
An older version of my PowerShell profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * -------------------------------------------------------------------------------- * # | |
# * ENVIRONMENT | |
# If there is an `.env` file in the PWD, load environment variables from it | |
Set-PsEnv | |
# If there is a Python virtual environment in the PWD, activate it | |
if (Test-Path ".\.venv\Scripts\Activate.ps1") {& ".\.venv\Scripts\Activate.ps1"} | |
# * -------------------------------------------------------------------------------- * # | |
# * FUNCTIONS | |
function Get-HelpBrief | |
{ | |
<# | |
.SYNOPSIS | |
Get just the synopsis of a function. | |
#> | |
(Get-Help $args[0]).Synopsis | |
} | |
function Install-PipDevTools | |
{ | |
<# | |
.SYNOPSIS | |
Update pip and setuptools. Install wheel. Install development requirements. | |
#> | |
pip install -U pip # throws [WinError 5], but still works on its own | |
pip install -U setuptools # update bundled setuptools | |
pip install wheel # speed up subsequent package installs | |
pip install -r $HOME\.dev_requirements.txt # packages for development | |
} | |
function Install-PipDevToolsEditable | |
{ | |
<# | |
.SYNOPSIS | |
Update pip and setuptools. Install wheel. Install development requirements. Also use | |
`setup.py` in the current directory to install a package in editable fashion. | |
#> | |
Install-PipDevTools | |
pip install -e . | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment