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#100 The big 100 with special guests
Currently unavailable

#100 The big 100 with special guests

FromPython Bytes


Currently unavailable

#100 The big 100 with special guests

FromPython Bytes

ratings:
Length:
42 minutes
Released:
Oct 19, 2018
Format:
Podcast episode

Description

Sponsored by DigitalOcean: pythonbytes.fm/digitalocean

Special guests:


Anthony Shaw
Dan Bader
Brett Cannon
Nina Zakharenko


Brian #1: poetry


“poetry is a tool to handle dependency installation as well as building and packaging of Python packages. It only needs one file to do all of that: the new, standardized pyproject.toml.
In other words, poetry uses pyproject.toml to replace setup.py, requirements.txt, setup.cfg, MANIFEST.in and the newly added Pipfile.”
poetry

can be used for both application and library development
handles dependencies and lock files
strongly encourages virtual environment use (need specifically turn it off)
can be used within an existing venv or be used to create a new venv
automates package build process
automates deployment to PyPI or to another repository
CLI and the use model is very different than pipenv. Even if they produced the same files (which they don’t), you’d still want to try both to see which workflow works best for you. For me, I think poetry matches my way of working a bit more than pipenv, but I’m still in the early stages of using either.

From Python's New Package Landscape

“PEP 517 and PEP 518—accepted in September 2017 and May 2016, respectively—changed this status quo by enabling package authors to select different build systems. Said differently, for the first time in Python, developers may opt to use a distribution build tool other than **distutils** or **setuptools**. The ubiquitous **setup.py** file is no longer mandatory in Python libraries.”

PEP 517 -- A build-system independent format for source trees
PEP 518 -- Specifying Minimum Build System Requirements for Python Projects
Another project that utilizes pyproject.toml is flit, which seems to overlap quite a bit with poetry, but I don’t think it does the venv, dependency management, dependency updating, etc.
See also:

Clarifying PEP 518 (a.k.a. pyproject.toml) - From Brett

Question for @Brett C 517 and 518 still say “provisional” and not “final”. What’s that mean?

We are still allowed to tweak it as necessary before it

Biggest difference is poetry uses pyproject.toml (PEP518) instead of Pipfile. Replaces all others (setup.py, setup.cfg, requirements*.txt, manifest.IN)

Even its lock file is in TOML

Author “does not like” pipenv, or some of the decisions it has made. Note that Kenneth has recently made some calls to introduce more discussion and openness with a PEP-style process called PEEP (PipEnv Enhancement Proposals).

E.g. uses a more extensive dependency resolver

Pipenv does not support multiple environments (by design) making it useless for library development. Poetry makes this more open. See https://medium.com/@DJetelina/pipenv-review-after-using-in-production-a05e7176f3f0
Wait. Why am I doing your notes for you @Brian O ! (awesome. Thanks Ant.)
Brett has had initial discussions on Twitter with both pipenv and poetry about possibly standardizing on a lockfile format so that’s the artifact these tools produce and everything else is tool preference


Anthony Shaw #2: pylama and radon


Have been investigating tools for measuring complexity and performance of code and how that relates to test
If you can refactor your code so the tests still pass, the customers are still happy AND it’s simpler then that’s a good thing - right?
Radon is a Python tool that leverages the AST to give statistics on Cyclomatic Complexity (number of decisions — nested if’s are bad), maintainability index (LoC & Halstead) and Halstead (number of operations an complexity of AST).
Radon works by adding a ComplexityVisitor to the AST.
Another option is Ned Batchelder’s McCabe tool which measures the number of possible branches (similar to cyclomatic)
All of these tools are combined in pylama - a code linter for Python and Javascript. Embeds pycodestyle, mccabe, radon, gjslint and pyflakes.
Final goal is to have a pytest plugin that fails tests if you make your code more complicated


Nina Zakharenko #3: Tools for teaching Python


T
Released:
Oct 19, 2018
Format:
Podcast episode