Skip to content

bluebones.net

Adventures in Computer Programming – bakert@gmail.com

Month: April 2024

Posted on April 24, 2024

Automatially Activate venv When Found in Directory

# Function to activate virtualenv if present                                    
auto_activate_virtualenv() {                                                    
  if [ -f "bin/activate" ]; then                                                
    source bin/activate                                                         
  fi                                                                            
}                                                                               
# Add the function to chpwd hooks                                               
add-zsh-hook chpwd auto_activate_virtualenv
Posted on April 8, 2024

How to indicate that a single file module is typed to mypy

You can’t. Repackage your module as the only module in a package.

mypy needs a py.typed in the package’s directory and if you have a single module at the top level of your repo there’s no way to get setuptools to package that in such a way that the wheel will contain the py.typed in a useful place.

Example of the changes needed: github.com/wheerd/multiset/pull/127/files

Recent Posts

  • Are your Fellow Human Beings your Comrades?
  • muted, accent and secondary are all the same color in default shadcn/ui themes
  • Running a dozen Next.js devservers without losing your mind
  • Rebase a whole stack at once
  • shadcn/ui v3/v4 and –destructive theme variables
  • Psychopathic Git Shortcuts
  • Sort committers by average length of commit message
  • Gradient Borders with Transparent Background
  • How to keep your input and dismiss/cancel atuin
  • Starting more than one dev webserver each in its own terminal window (Mac)
Java Update Proudly powered by WordPress