To create a project that other people can use and contribute to, you need to
follow a specific directory structure. Moreover, releasing a new version should
be as simple and painless as possible. For my projects, I use a template that
has the structure already in place, and comes with automation for almost every
part of a release.

What does it include? A whole lot of things. Documentation, Sphinx
configuration, a simple test suite, a setup.py file, some AUR stuff, and
perhaps the most important part — the release script. It can automate a lot
of tasks that are part of a release.

You see, releasing a package is error-prone. There are a lot of things that can go wrong:

Version numbers. They may appear in code comments, Sphinx configuration,
README files and documentation, and setup.py. Some people claim to have
“solutions” for this. Most of those solutions don’t work right — either they
import a file from the project (which may break if __init__.py is too
magical), read a file from that place (which might not get included
properly), or use some setuptools extension to get the version from VCS or
whatever (which needs to be installed before the package). Using sed to
fix the version numbers is much simpler.

Forgetting about changelogs.

Not updating translations or other important files.

We’ve had quite a few botched releases in the Nikola project. I wrote a
checklist to prevent things like those. You may notice that the most
prominent step is to run a release script. This step replaced 21 others —
now the checklist only talks about writing announcements, sending e-mails,
updating the website, and doing some GitHub stuff that is not yet automated.

The template promotes a release early, release often workflow: since making a
new release requires almost no human intervention, you might as well do it
every time you make a bunch of changes. In my projects, everything gets
automated, and it might as well be possible in yours.

That’s all!

Hopefully, the guide worked for you and your Python project is now well-structured and automated. If so, great! Otherwise, make sure you did everything as stated in this guide. If you are still stuck, ask for help in the comments.