Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 23054

Python Bytes: #297 I AM the documentation

$
0
0
<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=RNrwpaG_bMk' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by the <a href="https://pythonbytes.fm/irl"><strong>IRL Podcast from Mozilla</strong></a></p> <p><strong>Michael #1:</strong> <a href="https://github.com/agronholm/sqlacodegen"><strong>SQLCodeGen</strong></a></p> <ul> <li>via Josh Thurston</li> <li>This is a tool that reads the structure of an existing database and generates the appropriate SQLAlchemy model code, using the declarative style if possible.</li> <li>This tool was written as a replacement for <a href="http://code.google.com/p/sqlautocode/">sqlautocode</a>, which was suffering from several issues (including, but not limited to, incompatibility with Python 3 and the latest SQLAlchemy version).</li> <li>Features: <ul> <li>Supports SQLAlchemy 1.4.x</li> <li>Produces declarative code that almost looks like it was hand written</li> <li>Produces <a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> compliant code</li> <li>Accurately determines relationships, including many-to-many, one-to-one</li> <li>Automatically detects joined table inheritance</li> <li>Excellent test coverage</li> </ul></li> </ul> <p><strong>Brian #2:</strong> <strong>The death of setup.py*, long live pyproject.toml</strong> </p> <ul> <li>for Python-only projects</li> <li><a href="https://twitter.com/juanluisback/status/1557734536586625025?s=20&amp;t=OxIrS2c-blRHouZygbCjCQ">Juan Luis Cano Rodriguez tweet</a></li> <li><code>pip install</code> <code>--``editable .</code> <a href="https://setuptools.pypa.io/en/latest/userguide/development_mode.html">now works with setuptools, as of version 64.0.0</a></li> <li>To be clear, <code>setup.cfg</code> also not required.</li> <li>So everything can be in <code>pyproject.toml</code></li> <li>The * part: projects with non-Python bits may still need <code>setup.py</code></li> <li>See also the newly updated tutorial by the <a href="https://packaging.python.org/en/latest/tutorials/packaging-projects/">PyPA: Packaging Python Projects</a> <ul> <li>Now with absolutely no mention of <code>setup.py</code> or <code>setup.cfg</code></li> <li>It’s all <code>pyproject.toml</code></li> </ul></li> <li>Commentary: <ul> <li>For Python only projects, is setuptools a decent flit contender???</li> <li>stay tuned</li> </ul></li> </ul> <p><strong>Michael #3:</strong> <a href="https://pypi.org/project/aiocache/"><strong>aiocache</strong></a></p> <ul> <li>via <a href="https://twitter.com/owenrlamont">Owen Lamont</a></li> <li>In the same vein as async-cache you might also be interested in <a href="https://t.co/V1uGBlDzYS">aiocache</a>. </li> <li>It has some cool functionality like an optional Redis backend for multi process caching.</li> <li>his library aims for simplicity over specialization. All caches contain the same minimum interface which consists on the following functions: <ul> <li>add: Only adds key/value if key does not exist.</li> <li>get: Retrieve value identified by key.</li> <li>set: Sets key/value.</li> <li>multi_get: Retrieves multiple key/values.</li> <li>multi_set: Sets multiple key/values.</li> <li>exists: Returns True if key exists False otherwise.</li> <li>increment: Increment the value stored in the given key.</li> <li>delete: Deletes key and returns number of deleted items.</li> <li>clear: Clears the items stored.</li> <li>raw: Executes the specified command using the underlying client.</li> </ul></li> </ul> <p><strong>Brian #4:</strong> <a href="https://hatch.pypa.io/latest/"><strong>Hatch : a modern, extensible Python project manager</strong></a></p> <ul> <li>Another flit contender?</li> <li>While reading <a href="https://packaging.python.org/en/latest/tutorials/packaging-projects/">Packaging Python Projects</a> tutorial update, I noticed some examples for <code>hatchling</code>, as an alternative to <code>setuptools</code>, <code>flit-core</code>, and <code>pdm</code>.</li> <li>Played with it some, but still have some exploring to do.</li> <li>features <ul> <li>Standardized <a href="https://hatch.pypa.io/latest/build/#packaging-ecosystem">build system</a> with reproducible builds by default</li> <li>Robust <a href="https://hatch.pypa.io/latest/environment/">environment management</a> with support for custom scripts</li> <li>Easy <a href="https://hatch.pypa.io/latest/publish/">publishing</a> to PyPI <strong>or other sources</strong> <ul> <li>includes <code>--repo</code> flag to be able to publish to alternative indices. </li> <li>Awesome for internal systems.</li> </ul></li> <li><a href="https://hatch.pypa.io/latest/version/">Version management</a></li> <li>Configurable <a href="https://hatch.pypa.io/latest/config/project-templates/">project generation</a> with sane defaults</li> <li>Responsive <a href="https://hatch.pypa.io/latest/cli/about/">CLI</a>, ~2-3x faster than equivalent tools <ul> <li>This sounds great. I haven’t verified this</li> </ul></li> </ul></li> <li>Commentary: <ul> <li>Good to see more packaging tools and user workflow explorations around packaging.</li> </ul></li> </ul> <p><strong>Extras</strong> </p> <p>Michael:</p> <ul> <li><a href="https://www.pypy.org/posts/2022/07/m1-support-for-pypy.html"><strong>M1 Support for PyPy Announced</strong></a> (via PyCoders)</li> </ul> <p><strong>Joke:</strong> <a href="https://twitter.com/PR0GRAMMERHUM0R/status/1557109490775883778"><strong>I am the docs</strong></a></p>

Viewing all articles
Browse latest Browse all 23054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>