Python wheels and packages
A Python wheel file is a ZIP file that holds a Python package, which is another way to say it is ready to install and use. Often, when you use something from pip
, it is a wheel. When you build a Python application and store it on a PyPI server, it’s a wheel.
Anatomy of a package
The typical entry point for your Python application is __main__.py
.
The __init__.py
file is found in every folder you use. It can have special purposes such as holding the version – for example, __version__ = "
1.0.0"
.
An alternative to setup.py
is pyproject.toml
; both are central places to put project-wide configurations. You can specify requirements, among other things. Here is an example:
PACKAGE_REQUIREMENTS = ["pyyaml"] LOCAL_REQUIREMENTS = [ "pyspark==3.2.1", "delta-spark==1.1.0", "scikit-learn", "pandas...