Best Practice Clean Code Code Analysis Static Analysis Tooling
See in schedule Download SlidesDid you write a cool and useful Python script? Would you like to share it with the community, but you're not sure how to go about that? If so, then this talks is for you. We'll go over a list of simple steps which can turn your script into a fully fledged open-source project.
The Python community has a rich set of tools which can help verify the quality of your code through automated code-review and linting. You can benefit by taking advantage of this ecosystem. Complete the steps in this checklist, and your project will be easier to maintain, you'll be ready to take contributions from the community and those contributions will be up to high standards. Your project will also keep up with other projects on PyPI and you will be alerted if any new release causes an incompatibility with your code.
The same checklist can be used for non open-source projects as well.
The project maturity checklist includes:
* Properly structure your code
* Use a setup.py file
* Add entry_points for your script command
* Create a requirements.txt file
* Use Black to format your code
* Create a tox.ini config and include code linters
* Set up a Git repo
* Refactor your code to be unit-testable and add tests
* Add missing docstrings
* Add type annotations and a MyPy verification step
* Upload to GitHub
* Add a continuous integration service (e.g. Travis)
* Add a requirements updater (e.g. pyup.bot)
* Add test coverage checker (e.g. coveralls)
* Add a Readme file and documentation
* Publish your project on PyPI
* Advertise your project
Type: Talk (30 mins); Python level: Advanced; Domain level: Beginner
Michal Karzynski has a scientific research background in the areas of molecular biology and bioinformatics. He is currently working as a Machine Learning software engineer, tech lead and consultant. He also has web development experience and spent many years writing code in Python and JavaScript.
Michal loves Linux and everything open source. He's currently working on nGraph, Intel's runtime and graph compiler for Deep Learning. He wrote "Webmin Administrator's Cookbook", a book on Linux server administration. As consultant he was responsible for designing and deploying cloud infrastructure for a number of companies.
Michal is currently employed as a tech lead at Intel. He also runs the consulting company Atarnia.com. He writes a blog, which can be found at http://michal.karzynski.pl