This is a starting project that demonstrate how to create a distribution package from a regular package
This project use a src layout
├── src
│ └── mypackage
│ ├── __init__.py
│ └── mod1.py
├── setup.py
└── setup.cfgthat is declared in the setup.py file
packages=setuptools.find_packages(where='src'),
package_dir={'': 'src'}, # tell distutils packages are under src- Get this (distribution package|project) locally
- Install Python
- Install the setuptools
python -m pip install --upgrade pip setuptools wheel
- Then
cd directory/of/the/project
pip install .
This will install the hello script defines in the setup.py file
at the entry_points property as the function main of the module hello_cli
where hello
C:\Python37-32\Scripts\hello.exe- Running the script
hello nico
>>> Arguments passed in: ['nico']
>>> Flags detected: <args []>
>>> Files detected: []
>>> NOT Files detected: <args ['nico']>
>>> Grouped Arguments: {'_': <args ['nico']>}
>>> Your IP: 143.176.206.81The dependencies are defined in the install_requires property of the setup.py file.
- Code from the article How to distribute a regular python package
- Mix between the pipenv article