Examples¶
Just a few examples to get you an idea of how easy PyScaffold is to use:
putup my_little_projectThe 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_projectIf you are unsure on how to use PyScaffold, or keep typing
putup --helpall the time, the experimental--interactive(or simply-i), is your best friend. It will open your default text editor with a file containing examples and explanations on how to useputup(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 withgit rebase -i, including the capacity of choosing a different text editor by setting theEDITOR(orVISUAL) environment variable in your terminal.putup skynet -l GPL-3.0-only -d "Finally, the ultimate AI!" -u http://sky.netThis 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-ClauseThis 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 insetup.cfgwill be set and a file.pre-commit-config.yamlis created with a default setup for pre-commit.putup thoroughly_tested --cirrusThis will create a project and package thoroughly_tested with files
tox.iniand.cirrus.ymlfor Tox and Cirrus CI.putup my_zope_subpackage --name my-zope-subpackage --namespace zope --package subpackageThis will create a project under the
my_zope_subpackagedirectory with the installation name ofmy-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.
- 1
Notice the usage of SPDX identifiers for specifying the license in the CLI
- 2
Requires the installation of pyscaffoldext-django.