Tools for packaging and publishing to pypi for those who just don not want to deal with it
Tools for packaging and publishing to pypi for those who just don't want to deal with it
To install (for example):
pip install wads
We're going to assume you pointed "pack" to "wads/pack.py" and "populate" to "wads/populate.py",
because it's convenient for us to do so. You can achieve this in various ways
(for example, putting the contents:
python /Users/Thor.Whalen/Dropbox/dev/p3/proj/i/wads/wads/pack.py "$@"
in a file named "pack" contained in your OS's script path.)
When? When you got a new project and you want to quickly set it up with the packaging goodies.
or, assuming you're using the terminal and you're in the
PKG_DIR root folder of the project, you can just do:
What that will do is create and populate some files for you. Namely, it will ensure your package directory has the following files (if not present already)
PKG_NAME will be taken to be the same as the name of the
That will work, it will be minimal and will choose defaults for you. You can overwrite many of these, of course. For example,
populate -r https:///github.com/i2mint --description "Something about my project..."
Here are the following options:
-h, --help show this help message and exit
"There is a bit of an air of mystery around this project..."
-r ROOT_URL, --root-url ROOT_URL
-a AUTHOR, --author AUTHOR
-l LICENSE, --license LICENSE
-k KEYWORDS, --keywords KEYWORDS
-v, --verbose True
-o OVERWRITE, --overwrite OVERWRITE
Note that by default, populate will not overwrite files that all already there.
It will edit the
setup.cfg file if it's present (and missing some entries).
Configuring the defaults of
defaults-from option in the
That's probably the most convenient argument of all.
Go check out a file named
wads_confgis.json in the root directory of the project.
(If you don't know how to find that file, try this command:
python -c "import wads; print(wads)" to get a clue).
wads_confgis.json file contains key-value entries that are used in the wads package.
"populate_dflts" key is used by the populate script.
If you edit that, you'll get different defaults out of the box.
But you can also add your own key-value pairs if you work on different kinds of projects that need
different kinds of defaults.
For your convenience we added a
"custom_dflts_example_you_should_change" key to illustrate this.
The typical sequence of the methodical and paranoid could be something like this:
python pack.py current-configs # see what you got
python pack.py increment-configs-version # update (increment the version and write that in setup.cfg
python pack.py current-configs-version # see that it worked
python pack.py current-configs # ... if you really want to see the whole configs again (you're really paranoid)
python pack.py run-setup # see that it worked
python pack.py twine-upload-dist # publish
# and then go check things work...
If you're are great boilerplate hater you could just do:
pack go PKG_DIR
pack go --version 0.0.0 PKG_DIR if it's the very first release).
But we suggest you get familiar with what the steps are doing, so you can bend them to your liking.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.