Minimal Python Package
What does it take to create an installable python package that can be hosted on pypi? What is the minimal python package # setup.py my_module.py This post is somewhat inspired by the bottle framework, which is famously created as a single python module. Yes, a whole web framework is written in one file. Directory structure # setup.py # name # The name of the package can contain any letters, numbers, “_”, or “-”. Even if it’s for internal/personal consumption only I usually check for discrepancy with pypi so that you don’t run into conflicts. Note that pypi treats “-” and “_” as the same thing, beware of name clashes version # This is the version number of your package. Most packages follow semver. At a high level its three numbers separated by a that follow the format. It’s a common courtesy to only break APIs on major changes, new releases on minor, and fixes on patch. This can become much more blurry in practice so checkout semver.org. py_modules # Typically most packages use the arg…