Skip to content

Instantly share code, notes, and snippets.

View coryvirok's full-sized avatar

Cory Virok coryvirok

  • Rollbar
  • San Francisco
View GitHub Profile
@mmellison
mmellison / grpc_asyncio.py
Last active August 6, 2024 01:23
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
@Flushot
Flushot / Makefile
Created June 14, 2013 19:50
Makefile for Python virtualenv and pip dependency manifest. Assumes virtual environment will be created in a 'venv' subdirectory.
.PHONY: init_venv deps freeze clean_venv
all: init_venv deps
PYTHONPATH=venv ; . venv/bin/activate
init_venv:
if [ ! -e "venv/bin/activate_this.py" ] ; then PYTHONPATH=venv ; virtualenv --clear venv ; fi
deps:
PYTHONPATH=venv ; . venv/bin/activate && venv/bin/pip install -U -r requirements.txt && if [ "$(ls requirements)" ] ; then venv/bin/pip install -U -r requirements/* ; fi