-- Distribution
Here we present the most basic technique to share, for more information look at Python Packaging User Guide.
setup.py file¶
In the first step, create setup.py file to the top-level of your project:
# setup.py
import setuptools
setuptools.setup(
name="mypachage",
version="0.0.1",
author="Saeid Amiri",
author_email="saeid.amiri1@gmail.com",
description="Training course on python",
packages=setuptools.find_packages(),
)
Create requirements.txt and put the necessary package there. Now you can install the package
If you want to share the source as a ZIP archive, run the command below. It will create a dist/ directory and store a .tar.gz file there.
You can use it to install the package.
Github¶
You can share the source on GitHub and share it with others. To install from GitHub, you only need the repository's path.
If you want to import a module instead of the entire package, you can do so by.