1. Tools#
This section describes a full set of tools for clean Python development.
Note
1.1. Mandatory tools#
1.1.1. Text editor#
Use softwares like Sublime Text or Notepad++ for basic editing tasks. For more performances, using an Integrated Development Environment (IDE) such as PyCharm or VSCode will help to increase development speed by automating some tasks and integrating other tools in a common interface.
1.1.2. git#
- git
git is a popular Version Control System (VCS) that allows, among other features, to save the work state and navigate in history.
- GitHub / Gitlab
Central repositories that host the git files. Although central repositories can be self-hosted, we prefer to use turnkey solutions such as GitHub or Gitlab
1.1.3. poetry#
Poetry is a modern package manager for Python. A Python installation (for example at C:Program FilesPython310) manages its python packages through pip
1.1.4. pylint#
pylint is code linter for Python. It statically analyses your code at normalizing
$ poetry add pylint
1.1.5. pytest#
pytest runs your Python tests together and output a report.
$ poetry add pytest
1.1.6. black#
black formats your Python code.
$ poetry add black
Blackened code looks the same regardless of the project you’re reading. You will save time and mental energy for more important matters.
1.2. Optional tools#
1.2.1. mypy#
mypy is an optional static type checker for Python.
$ poetry add mypy
1.2.2. Sphinx#
Sphinx is a Python documentation generator.
$ poetry add -D sphinx sphinx-autobuild myst-parser
Write your project documentation using reStructuredText or Markdown syntax, Sphinx builds a beautiful documentation in the form of a static site (HTML, CSS) that you can open in a web browser or publish as a website (for example on a GitHub Page).