Discover this podcast and so much more

Podcasts are free to enjoy without a subscription. We also offer ebooks, audiobooks, and so much more for just $11.99/month.

Unavailable#117 Is this the end of Python virtual environments?
Currently unavailable

#117 Is this the end of Python virtual environments?

FromPython Bytes


Currently unavailable

#117 Is this the end of Python virtual environments?

FromPython Bytes

ratings:
Length:
28 minutes
Released:
Feb 14, 2019
Format:
Podcast episode

Description

Sponsored by pythonbytes.fm/datadog

Brian #1: Goodbye Virtual Environments?


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.

Try it now with pythonloc

pythonloc is a drop in replacement for python and pip 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 to node_modules.
Instead of running python you run pythonloc and the __pypackages__ path will automatically be searched first for packages. And instead of running pip you run piploc and it will install/uninstall from __pypackages__.



Michael #2: webassets


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)


Brian #3: Bernat on Python Packaging


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


Michael #4: What the mock? — A cheatsheet for mocking in Python


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()


Brian #5: Transitions: The easiest way to improve your tech talk


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.


Michael #6: Steering council announced


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.
Released:
Feb 14, 2019
Format:
Podcast episode