Tuesday, May 19, 2020

Python Bytes: #182 PSF Survey is out!

<p>Sponsored by Datadog: <a href="https://pythonbytes.fm/datadog">pythonbytes.fm/datadog</a></p> <p><strong>Michael #1:</strong> <a href="https://www.jetbrains.com/lp/python-developers-survey-2019/"><strong>PSF / JetBrains Survey</strong></a></p> <ul> <li>via Jose Nario</li> <li>Let’s talk results:</li> <li>84% of people who use Python do so as their primary language [unchanged]</li> <li>Other languages: JavaScript (down), Bash (down), HTML (down), C++ (down)</li> <li>Web vs Data Science languages: <ul> <li>More C++ / Java / R / C# on Data Science side</li> <li>More SQL / JavaScript / HTML</li> </ul></li> <li>Why do you mainly use Python? 58% work and personal</li> <li>What do you use Python for? <ul> <li>Average answers was 3.9</li> <li>Data analysis [59% / 59% — now vs. last year]</li> <li>Web Development [51% / 55%]</li> <li>ML [40% / 39%]</li> <li>DevOps [39% / 43%]</li> </ul></li> <li>What do you use Python for the most? <ul> <li>Web [28% / 29%]</li> <li>Data analysis [18% / 17%]</li> <li>Machine Learning [13% / 11%]</li> </ul></li> <li>Python 3 vs Python 2: 90% Python 3, 10% Python 2</li> <li>Widest disparity of versions (pro 3) is in data science.</li> <li>Web Frameworks: <ul> <li>Flask [48%]</li> <li>Django [44%]</li> </ul></li> <li>Data Science <ul> <li>NumPy 63%</li> <li>Pandas 55%</li> <li>Matplotlib 46%</li> </ul></li> <li>Testing <ul> <li>pytest 49%</li> <li>unittest 30%</li> <li>none 34%</li> </ul></li> <li>Cloud <ul> <li>AWS 55%</li> <li>Google 33%</li> <li>DigitalOcean 22%</li> <li>Heroku 20%</li> <li>Azure 19%</li> </ul></li> <li>How do you run code in the cloud (in the production environment) <ul> <li>Containers 47%</li> <li>VMs 46%</li> <li>PAAS 25%</li> </ul></li> <li>Editors <ul> <li>PyCharm 33%</li> <li>VS Code 24%</li> <li>Vim 9%</li> </ul></li> <li>tool use <ul> <li>version control 90%</li> <li>write tests 80%</li> <li>code linting 80%</li> <li>use type hints 65%</li> <li>code coverage 52%</li> </ul></li> </ul> <p><strong>Brian #2:</strong> <strong>Hypermodern Python</strong></p> <ul> <li>Claudio Jolowicz, <a href="https://twitter.com/cjolowicz/">@cjolowicz</a></li> <li>An opinionated and fun tour of Python development practices.</li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-01-setup">Chapter 1: Setup</a> <ul> <li>Setup a project with pyenv and Poetry, src layout, virtual environments, dependency management, click for CLI, using requests for a REST API.</li> </ul></li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-02-testing">Chapter 2: Testing</a> <ul> <li>Unit testing with pytest, using coverage.py, nox for automation, pytest-mock. Plus refactoring, handling exceptions, fakes, end-to-end testing opinions.</li> </ul></li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-03-linting">Chapter 3: Linting</a> <ul> <li>Flake8, Black, import-order, bugbear, bandit, Safety. Plus more on managing dependencies, and using pre-commit for git hooks.</li> </ul></li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-04-typing">Chapter 4: Typing</a> <ul> <li>mypy and pytype, adding annotations, data validation with Desert &amp; Marshmallow, Typeguard, flake8-annotations, adding checks to test suite</li> </ul></li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-05-documentation">Chapter 5: Documentation</a> <ul> <li>docstrings, linting docstrings, docstrings in nox sessions and test suites, darglint, xdoctest, Sphinx, reStructuredText, and autodoc</li> </ul></li> <li><a href="https://cjolowicz.github.io/posts/hypermodern-python-06-ci-cd">Chapter 6: CI/CD</a> <ul> <li>CI with GithHub Actions, reporting coverage with Codecov, uploading to PyPI, Release Drafter for release documentation, single-sourcing the package version, using TestPyPI, docs on RTD</li> </ul></li> <li>The series is worth it even for just the artwork.</li> <li>Lots of fun tools to try, lots to learn.</li> </ul> <p><strong>Michael #3:</strong> <a href="https://openai.com/blog/jukebox/"><strong>Open AI Jukebox</strong></a></p> <ul> <li>via Dan Bader</li> <li>Listen to the songs under “Curated samples.”</li> <li>A neural net that generates music, including rudimentary singing, as raw audio in a variety of genres and artist styles. </li> <li>Code is available on <a href="https://github.com/openai/jukebox/">github</a>.</li> <li>Dataset: To train this model, we crawled the web to curate a new dataset of 1.2 million songs (600,000 of which are in English), paired with the corresponding lyrics and metadata from <a href="https://lyrics.fandom.com/wiki/LyricWiki">LyricWiki</a>.</li> <li>The top-level transformer is trained on the task of predicting compressed audio tokens. We can provide additional information, such as the artist and genre for each song. </li> <li>Two advantages: first, it reduces the entropy of the audio prediction, so the model is able to achieve better quality in any particular style; second, at generation time, we are able to steer the model to generate in a style of our choosing.</li> </ul> <p><strong>Brian #4:</strong> <a href="https://rednafi.github.io/digressions/python/2020/03/26/python-contextmanager.html"><strong>The Curious Case of Python's Context Manager</strong></a></p> <ul> <li>Redowan Delowar, <a href="https://twitter.com/rednafi">@rednafi</a></li> <li>A quick tour of context managers that goes deeper than most introducitons.</li> <li>Writing custom context managers with <code>__init__</code>, <code>__enter__</code>, <code>__exit__</code>.</li> <li>Using the decorator <code>contextlib.contextmanager</code></li> <li>Then it gets even more fun <ul> <li>Context managers as decorators</li> <li>Nesting contexts within one <code>with</code> statement.</li> <li>Combining context managers into new ones</li> </ul></li> <li>Examples <ul> <li>Context managers for SQLAlchemy sessions</li> <li>Context managers for exception handling</li> <li>Persistent parameters across http requests</li> </ul></li> </ul> <p><strong>Michael #5:</strong> <a href="https://pypi.org/project/nbstripout/"><strong>nbstripout</strong></a></p> <ul> <li>via ClĂ©ment Robert</li> <li>In the latest episode, you praised NBDev for having a git hook that strips out notebook outputs.</li> <li>strip output from Jupyter and IPython notebooks</li> <li>Opens a notebook, strips its output, and writes the outputless version to the original file.</li> <li>Useful mainly as a git filter or pre-commit hook for users who don’t want to track output in VCS.</li> <li>This does mostly the same thing as the Clear All Output command in the notebook UI.</li> <li>Has a nice youtube tutorial right in the pypi listing</li> <li>Just do <code>nbstripout</code> <code>--``install</code> in a git repo!</li> </ul> <p><strong>Brian #6:</strong> <strong>Write ups for</strong> <a href="http://pyfound.blogspot.com/2020/04/the-2020-python-language-summit.html"><strong>The 2020 Python Language Summit</strong></a></p> <ul> <li>Guido talked about this in <a href="https://pythonbytes.fm/episodes/show/179/guido-van-rossum-drops-in-on-python-bytes">episode 179</a></li> <li>But these write-ups are excellent and really interesting. <ul> <li><a href="https://pyfound.blogspot.com/2020/04/all-strings-become-f-strings-python.html"><strong>Should All Strings Become f-strings?</strong></a>, Eric V. Smith</li> <li><a href="https://pyfound.blogspot.com/2020/04/replacing-cpythons-parser-python.html"><strong>Replacing CPython’s Parser with a PEG-based parser</strong></a>, Pablo Galindo, Lysandros Nikolaou, Guido van Rossum</li> <li><a href="https://pyfound.blogspot.com/2020/04/a-formal-specification-for-cpython.html"><strong>A Formal Specification for the (C)Python Virtual Machine</strong></a>, Mark Shannon</li> <li><a href="https://pyfound.blogspot.com/2020/04/hpy-future-proof-way-of-extending.html"><strong>HPy: a Future-Proof Way of Extending Python?</strong></a>, Antonio Cuni</li> <li><a href="https://pyfound.blogspot.com/2020/04/cpython-documentation-next-5-years.html"><strong>CPython Documentation: The Next 5 Years</strong></a>, Carol Willing, Ned Batchelder</li> <li><a href="https://pyfound.blogspot.com/2020/04/lightning-talks-part-1.html"><strong>Lightning talks (pre-selected)</strong></a> <ul> <li>What do you need from pip, PyPI, and packaging?, Sumana Harihareswara</li> <li>A Retrospective on My "Multi-Core Python" Project, Eric Snow</li> </ul></li> <li><a href="https://pyfound.blogspot.com/2020/04/the-path-forward-for-typing-python.html"><strong>The Path Forward for Typing,</strong></a> Guido van Rossum</li> <li><a href="https://pyfound.blogspot.com/2020/05/property-based-testing-for-python.html"><strong>Property-Based Testing for Python Builtins and the Standard Library,</strong></a> Zac Hatfield-Dodds</li> <li><a href="https://pyfound.blogspot.com/2020/05/core-workflow-updates-python-language.html"><strong>Core Workflow Updates,</strong></a> Mariatta Wijaya</li> <li><a href="https://pyfound.blogspot.com/2020/05/cpython-on-mobile-platforms.html"><strong>CPython on Mobile Platforms,</strong></a> Russell Keith-Magee</li> </ul></li> <li>Wanted to bring this up because Python is a living language and it’s important to pay attention and get involved, or at least pay attention to where Python might be going.</li> </ul> <p>Also, another way to get involved is to become a member of the PSF board of directors</p> <ul> <li><a href="https://www.youtube.com/watch?v=ZLKj6FaQA4M">What’s a PSF board of directors member do? video</a></li> <li>There are some open seats, <a href="https://www.python.org/nominations/elections/">Nominations are open until May 31</a></li> </ul> <p>Extras:</p> <p>Michael:</p> <ul> <li>Updated search engine for better result ranking</li> <li>Windel Bouwman wrote a nice little script for speedscope https://ift.tt/2yhSYC3 (follow up from Austin profiler)</li> </ul> <p>Jokes:</p> <ul> <li>“Due to social distancing, I wonder how many projects are migrating to UDP and away from TLS to avoid all the handshakes?” - From <a href="https://twitter.com/webKnjaZ">Sviatoslav Sydorenko</a> </li> <li>“A chef and a vagrant walk into a bar. Within a few seconds, it was identical to the last bar they went to.” - From <a href="https://twitter.com/bluefiddleguy">Benjamin Jones</a>, crediting <a href="https://twitter.com/luvcraft">@lufcraft</a></li> <li>Understanding both of these jokes is left as an exercise for the reader.</li> </ul>

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...