Friday, June 26, 2020

Python Bytes: #187 Ready to find out if you're git famous?

<p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://t.co/AKfVKcveg6?amp=1"><strong>Brian’s pytest book</strong></a></li> </ul> <p>Brian #1: <a href="https://www.lego.com/en-gb/aboutus/news/2020/june/lego-mindstorms-robot-inventor"><strong>LEGO Mindstorms Robot Inventor supports Python</strong></a></p> <ul> <li>Past <ul> <li>NXT 2006</li> <li>NXT 2.0 2009</li> <li>EV3 2013 (plus, weird post apocalypse thing going on)</li> </ul></li> <li>Robot Inventor will be available Autumn 2020 (not sure what that means). <ul> <li>Controllable with both Scratch and Python</li> <li>Great updates to help with STEM education</li> <li>Instructions for 5 different robots</li> <li>interesting: <ul> <li>5x5 LED matrix</li> <li>6 input/output ports for connecting a variety of sensors and motors.</li> <li>6 axis gyro/accelerometer</li> <li>color sensor</li> <li>distance sensor</li> <li>and Python!</li> <li>Can be programmed with Windows &amp; Mac, of course. But also iOS &amp; Android tablets and phones and even some FireOS devices.</li> </ul></li> </ul></li> <li>Related: <a href="https://github.com/IBM/MicroscoPy">MicroscoPy</a> - IBM open source, motorized, modular microscope built using LEGO bricks, Arduino, Raspberry Pi and 3D printing.</li> </ul> <p>Michael #2: <a href="https://www.dataschool.io/how-to-contribute-on-github/"><strong>Step-by-step guide to contributing on GitHub</strong></a></p> <ul> <li>by Kevin Markham</li> <li>Want to contribute to an open source project? Follow this detailed visual guide to make your first contribution TODAY</li> <li>Although there are other guides like it out there, mine is (1) up-to-date with the latest GitHub interface, (2) much more detailed, and (3) highly visual. Includes 16 annotated screenshots + 2 workflow diagrams.</li> <li>The only prerequisite is that the reader has a tiny bit of Git knowledge. They don't even have to be a great coder, because what I suggest is that they start by fixing a typo or broken link in the documentation. That way they can focus on learning the contribution workflow!</li> <li>Steps:</li> <li><strong>choose a project to contribute to</strong></li> <li><strong>fork the project</strong></li> <li><strong>clone your fork locally</strong></li> <li><strong>load your local copy in an editor</strong></li> <li><strong>make sure you have an "origin" remote</strong></li> <li><strong>add the project repository as the "upstream" remote</strong></li> <li><strong>pull the latest changes from upstream into your local repository</strong></li> <li><strong>create a new branch</strong></li> <li><strong>make changes in your local repository</strong></li> <li><strong>commit your changes</strong></li> <li><strong>push your changes to your fork</strong></li> <li><strong>create the pull request</strong></li> <li><strong>review the pull request</strong></li> <li><strong>add more commits to your pull request</strong></li> <li><strong>discuss the pull request</strong></li> <li><strong>delete your branch from your fork</strong></li> <li><strong>synchronize your fork with the project repository</strong></li> <li>Nice Tips for contributing code section too.</li> </ul> <p>Brian #3: <a href="https://sneklang.org/"><strong>sneklang</strong></a></p> <ul> <li>Snek: A Python-inspired Language for Embedded Devices</li> <li>An even smaller footprint than MicroPython or CircuitPython</li> <li>Can’t wait for Robot Inventor? Snek supports Lego EV3.</li> <li>“Snek is a tiny embeddable language targeting processors with only a few kB of flash and ram. … These processors are too small to run <a href="https://micropython.org/">MicroPython</a>.”</li> <li>Can develop using Mu editor</li> <li>Custom Snekboard runs either Snek or CircuitPython.</li> <li>Or run Snek on Lego EV3.</li> <li>Smaller language than Python, but intended to have all learning of Snek transferable to later development with Python.</li> <li>“The goals of the Snek language are: <ul> <li><strong>Text-based.</strong> A text-based language offers a richer environment for people comfortable with using a keyboard. It is more representative of real-world programming than building software using icons and a mouse.</li> <li><strong>Forward-looking.</strong> Skills developed while learning Snek should be transferable to other development environments.</li> <li><strong>Small.</strong> This is not just to fit in smaller devices: the Snek language should be small enough to teach in a few hours to people with limited exposure to software.</li> </ul></li> <li>Snek is Python-inspired, but it is not Python. It is possible to write Snek programs that run under a full Python system, but most Python programs will not run under Snek.”</li> </ul> <p>Michael #4: <a href="https://wizardzines.com/zines/oh-shit-git/"><strong>Oh sh*t git</strong></a></p> <ul> <li>via Andrew Simon, by Julia Evans</li> <li>Does cost $10, no affiliations</li> <li>This zine explains git fundamentals (what’s a SHA?)</li> <li>How to fix a lot of common git mistakes (I committed to the wrong branch!!).</li> <li>Fundamentals</li> <li>Mistakes and how to fix them</li> <li>Merge conflicts</li> <li>Committed the wrong file</li> <li>Going back in time</li> </ul> <p>Brian #5: <a href="https://snarky.ca/why-i-dont-like-semver/"><strong>Why I don't like SemVer anymore</strong></a></p> <ul> <li>Brett Cannon</li> <li>Interesting thoughts on SemVer <ul> <li>SemVer isn't as straightforward as it sounds; we don't all agree on what a major, minor, or micro change really is. <ul> <li>Is adding a depreciation warning a bug fix? or a major interface break?</li> <li>What if projects depending on your project have CI with warnings as errors? </li> </ul></li> <li>Your version number represents your branching strategy, so you choose a versioning scheme that's appropriate your branching and release strategy. <ul> <li>While maintaining multiple branches, x.y.z might make sense: <ul> <li>x - current release</li> <li>x.y - current development</li> <li>x.y.z - bug fixes</li> <li>x+1 - crazy new stuff</li> </ul></li> </ul></li> <li>If you aren’t maintaining 3+ branches at all times, that might be overkill</li> <li>Maybe x.y is enough</li> <li>Maybe just x is enough</li> <li>Rely on CI, potentially on a cron job, to detect when a project breaks for you instead of leaving it up to the project to try and make that call based on their interpretation of SemVer; will inevitably disagree</li> <li>Remember to pin your dependencies in your apps if you really don't want to have to worry about a dependency breaking you unexpectedly</li> <li>Libraries/packages should be setting a floor, and if necessary excluding known buggy versions, but otherwise don't cap the maximum version as you can't predict future compatibility</li> </ul></li> </ul> <p>Michael #6: <a href="https://github.com/casperdcl/git-fame"><strong>git fame</strong></a></p> <ul> <li>via Björn Olsson</li> <li>Pretty-print <code>git</code> repository collaborators sorted by contributions.</li> <li>Install via pip: <code>pip install --user git-fame</code></li> <li>Register with git: <code>git config --global alias.fame "!python -m gitfame``"</code></li> <li>Run in a repo directory: <code>git fame</code></li> <li>Get a table of contributors including: Author, Lines of Code, Files, Distribution (stats), sorted by most contributions.</li> </ul> <p>Extras:</p> <p>Patreon Shoutout:</p> <ul> <li>We have 26 supporters at https://ift.tt/2NzZdVW> <li>Many donate $1 a month, and that’s awesome.</li> <li>A few go above and beyond with more than that:</li> <li>Special shout out to those above a buck: <ul> <li>Brent Kincer</li> <li>Brian Cochrane</li> <li>Bert Raeymaekers</li> <li>Richard Stonehouse</li> <li>Jeff Keifer </li> </ul></li> <li>Thank you</li> </ul> <p>Michael: </p> <ul> <li><code>__pypackages__</code> <a href="https://twitter.com/kushaldas/status/1261307240255913985"><strong>follow up</strong></a> from Kushal Das</li> </ul> <p>Joke:</p> <p><a href="https://www.commitstrip.com/en/2017/02/28/definitely-not-lazy/">https://www.commitstrip.com/en/2017/02/28/definitely-not-lazy/</a></p>

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...