You may use this template to create Python packages quickly.
- Clone this repo
https://github.com/richard-hajek/python-setuptools-package-template.git
- Run
make prepare
- Remove
.git
folder - In your setup.cfg
- Change install_requirements in
[options]
to fit your needs - Change console_scripts in
[options.entry_points]
to fit your needs ( or delete it ) - Change
name
,version
,author
,author_email
,description
,version
- Change install_requirements in
- Add your own README
- Add LICENSE
You have several options of running any source code you write. In any case, always source the venv before source venv/bin/activate
python main.py [args]
This will work if you never import from any other directory than from the same one. If you ever import a module from a different folder this will not work.
pip install -e . # Run at least once
python -m project_name.main [args]
This method will correctly construct the Python library tree, so you can import from any directory you like
See Full Installation and python - How to setup entry_points in setup.cfg - Stack Overflow