Just a few examples to get you an idea of how easy PyScaffold is to use:
The simplest way of using PyScaffold. A directory
my_little_projectis created with a Python package named exactly the same. The MIT license will be used.
putup -i my_little_project
If you are unsure on how to use PyScaffold, or keep typing
putup --helpall the time, the experimental
-i), is your best friend. It will open your default text editor with a file containing examples and explanations on how to use
putup(think of it as an “editable”
--helptext, once the file is saved and closed all the values you leave there are processed by PyScaffold). You might find some familiarities in the way this option works with
git rebase -i, including the capacity of choosing a different text editor by setting the
VISUAL) environment variable in your terminal.
putup skynet -l GPL-3.0-only -d "Finally, the ultimate AI!" -u http://sky.net
This will create a project and package named skynet licensed under the GPL3. The description inside
setup.cfgis directly set to “Finally, the ultimate AI!” and the homepage to http://sky.net.
putup Scikit-Gravity -p skgravity -l BSD-3-Clause
This will create a project named Scikit-Gravity but the package will be named skgravity with license new-BSD 1.
putup youtub --django --pre-commit -d "Ultimate video site for hot tub fans"
This will create a web project and package named youtub that also includes the files created by Django’s
django-admin2. The description in
setup.cfgwill be set and a file
.pre-commit-config.yamlis created with a default setup for pre-commit.
putup thoroughly_tested --cirrus
putup my_zope_subpackage --name my-zope-subpackage --namespace zope --package subpackage
This will create a project under the
my_zope_subpackagedirectory with the installation name of
my-zope-subpackage(this is the name used by pip and PyPI), but with the following corresponding import statement:
from zope import subpackage # zope is the namespace and subpackage is the package name
To be honest, there is really only the Zope project that comes to my mind which is using this exotic feature of Python’s packaging system. Chances are high, that you will never ever need a namespace package in your life. To learn more about namespaces in the Python ecosystem, check PEP 420.