Template for a minimal Python 3 tool/package that can be installed and packaged with setuptools.
TODO (usr) This section and its header can be removed once the instructions have been followed.
Follow the following steps:
-
Create a new template repository from this repository.
-
Rename the
src/minimal_python_templatedirectory with your python package namemv src/minimal_python_template src/$PROJECT_NAME- Place your own package source code in this directory
-
Replace "minimal_python_template" and "minimal-python-template" in all files with your python tool/package name.
# Update the below lines with your project name PROJECT_NAME=my_cool_project PROJECT_NAME_HYPHENATED=my-cool-project find . -not -path "./.git/*" -type f \ -exec sed -i "s/minimal_python_template/$PROJECT_NAME/g" {} + find . -not -path "./.git/*" -type f \ -exec sed -i "s/minimal-python-template/$PROJECT_NAME_HYPHENATED/g" {} +
-
Grep project files for "TODO (usr)" and follow instructions for customising the template
grep -R "TODO (usr)" ./
- pip (tested with pip v25.2)
Create and activate a virtual environment, then run:
pip install .minimal_python_templateActivate your virtual environment, install the Python
build package, move to the base of this
directory, then run:
python -m build