Skip to content
Notes & thoughts on clean Python package design
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/package_cheat_sheet
tests/package_cheat_sheet
.coveragerc
.gitignore
LICENSE
README.md
pytest.ini
setup.cfg
setup.py

README.md

python-package-cheat-sheet

Notes & thoughts on clean Python package design.

Understand the concepts behind this code

A Python Package Developer’s Cheat Sheet @ Better Programming / Medium

Core files

  • setup.py: the package’s descriptor file, consists of a Python script where multiple properties can be set declaratively. Properties declared in this file are recognized by package managers such as pip and IDEs such as PyCharm, which means this is a must-have for any package.

  • setup.cfg: used to customize setup scripts, such as setting pytest as the default runner for python setup.py test command.

  • pytest.ini: contains parameters for pytest execution. For example, presenting coverage results both in the console and HTML files.

  • .coveragerc: controls the coverage script scope. This is pretty useful when you have folders in your project that don’t need to be monitored by the tool. In the proposed clean structure, only the src folder needs to be covered.

You can’t perform that action at this time.