Python semi-automatic package building script
A minimal setup.py
setup(
name='MyPackageName',
version='1.0.0',
description='Description of my package',
py_modules=["mymodule"] # Single modules project,
package_dir={"":"src"} # Telling setuptools our code is in ./src directory
)
-
Edit the
./templates/setup.py
with your data and Add your LICENSE if you want to:- More for setting up at its official site python-packaging
-
Run the script like
./build my_remote_git_repo
- It will clone it and create your package at
./cloned_package/dist/
- It will clone it and create your package at
Now your project is ready to be deployed or used anywhere else you need to :)
templates
MANIFEST.in
setup.py
README.md
...
- [OPTIONAL] Edit the MANIFEST.in with the includes,excludes you need.
- If you happen to use MANIFEST.in you better add it in the line 56 from the build script to enable the copy of this file for packaging.
Example of MANIFEST.in
include src/my_package/main.py
include src/my_package/requirements.txt
recursive-include src/my_package/libs *
recursive-exclude src/my_package/tests *
recursive-exclude .DS_Store *
-
[OPTIONAL] pyproject.toml for telling which backend build system we're using.
- More at setuptools - toml
- Creatre a windows-like script (or make it different)
- Make the process of setup.py automatic (cli for example)
- Automatic fetching a LICENSE or creating it
- Download/scrape from opensource.org
- Have some templates and make the subtitution using a cli