Watch the live stream:
Watch on YouTube
About the show
Sponsored by the IRL Podcast from Mozilla
Brian #1: Pip constraints files
requirements.txt syntax--constraint constraints.txt right at the top of your requirements.txt filepip install --constraint constraints.txt -r requirements.txtrequirements.in file.pip-compile correctly handles constraints when generating requirements.txt.Example
pip-compile requirements.in```
click==8.1.2 # via # -c constraints.txt # typer typer==0.6.1 # via -r requirements.in
```
Michael #2: async-cache
```
from cache import AsyncTTL
@AsyncTTL(time_to_live=60, maxsize=1024) async def func(args, *kwargs): """ time_to_live : max time for which a cached result is valid maxsize : max number of results that are cached. if max limit is reached the oldest result is deleted. """ pass
```
Brian #3: Organize Python code like a PRO
Recommendations of note
src dir.__name__ == "__main__" trick for modules.__main__.py entry point trick for modules/packages so that -m mymodule does something.Michael #4: keyring
Extras
Brian:
Michael:
Joke: