#117 Is this the end of Python virtual environments?
Python Bytes - A podcast by Michael Kennedy and Brian Okken - Lunedì
Categorie:
Sponsored by pythonbytes.fm/datadog
- by Chad Smith
- venv’s are great but they introduce some problems as well:
- Learning curve: explaining “virtual environments” to people who just want to jump in and code is not always easy
- Terminal isolation: Virtual Environments are activated and deactivated on a per-terminal basis
- Cognitive overhead: Setting up, remembering installation location, activating/deactivating
- PEP 582 — Python local packages directory
- This PEP proposes to add to Python a mechanism to automatically recognize a
__pypackages__
directory and prefer importing packages installed in this location over user or global site-packages. This will avoid the steps to create, activate or deactivate “virtual environments”. Python will use the__pypackages__
from the base directory of the script when present.
- This PEP proposes to add to Python a mechanism to automatically recognize a
- Try it now with pythonloc
- pythonloc is a drop in replacement for
python
andpip
that automatically recognizes a__pypackages__
directory and prefers importing packages installed in this location over user or global site-packages. If you are familiar with node,__pypackages__
works similarly tonode_modules
. - Instead of running
python
you runpythonloc
and the__pypackages__
path will automatically be searched first for packages. And instead of runningpip
you runpiploc
and it will install/uninstall from__pypackages__
.
- pythonloc is a drop in replacement for
- Bundles and minifies CSS & JS files
- Been doing a lot of work to rank higher on the sites
- That lead me to Google’s Lighthouse
- Despite 25ms response time to the network, Google thought my site was “kinda slow”, yikes!
- webassets has integration for the big three: Django, Flask, & Pyramid.
- But I prefer to just generate them and serve them off disk
def build_asset(env: webassets.Environment,
files: List[str],
filters: str,
output: str):
bundle = webassets.Bundle(
*files,
filters=filters,
output=output,
env=env
)
bundle.build(force=True)
- 3 part series by Bernat Gabor
- Maintainer of tox and virtualenv Python packages.
- The State of Python Packaging
- Python packaging - Past, Present, Future
- Python packaging - Growing Pains
- Nice introduction
- Some examples
@mock.patch('work.os')
def test_using_decorator(self, mocked_os):
work_on()
mocked_os.getcwd.assert_called_once()
And
def test_using_context_manager(self):
with mock.patch('work.os') as mocked_os:
work_on()
mocked_os.getcwd.assert_called_once()
- By Saron Yitbarek
- Jeff Atwood of CodingHorror noted “The people who can write and communicate effectively are, all too often, the only people who get heard. They get to set the terms of the debate.”
- Effectively presenting is part of effective communication.
- I love the focus of this article. Focused on one little aspect of improving the performance of a tech talk.
- Our new leaders are
- Barry Warsaw
- Brett Cannon
- Carol Willing
- Guido van Rossum
- Nick Coghlan
- Via Joe Carey
- We both think it’s great Guido is on the council.
- Brian: Got interviewed on IT Energizer Podcast:
- The one with Brian: https://itcareerenergizer.com/e123/
- The one with Michael: https://itcareerenergizer.com/e83/
- PyCon LATAM
- August 29, Puerto Vallarta, Mexico
- We should go. Anyone want to sponsor our travel/hotel to this event?
- CFP open till May 31, 2019, https://www.pylatam.org/en/speaking/
From the list from Ant, my votes.
Q: What's the second movie about a database engineer called? A: The SQL.
!false It's funny 'cause it's true.
A programmer's spouse tells them, "Run to the store and pick up a loaf of bread. If they have eggs, get a dozen." The programmer comes home with 12 loaves of bread.