1. Makefiles and classifiers
There are two last things you should know about before you start developing packages in the wild. Makefiles which will speed up your development, and classifiers which will help people find your package.
2. Classifiers
Inside the setup-dot-py file you will notice that cookiecutter has filled in the classifiers parameter. This is a list of categories for each release of your package. Users on PyPI can search through packages, and filter based on classifiers. Like if they are looking for packages for Python 2, or with a particular license type.
Here we have classified that the mysklearn package is currently intended for developers, and is in pre-alpha stage, meaning it's not ready to be used by general users. We state the type of license, the language used in the package, and the versions of Python it is compatible with. This package is for Python 3, so we add this classifier. We also add classifiers for the minor versions 3.6 to 3.8, since these are the specific versions of Python 3 that the package works with.
There are lots more classifiers you can use for your package, but you should always include these as a minimum. You can see a full list of classifiers here.
3. What are Makefiles for?
You will notice that cookiecutter also created a Makefile from the template.
Throughout this course you were using a lot of terminal commands. Sometimes these commands can be very repetitive, and sometimes hard to remember. Can you remember exactly what terminal commands you used to upload your distributions to PyPI? This is where the Makefile comes in.
4. What is in a Makefile?
Makefiles are kind of like Python modules. You can write functions inside them, but these functions are used from the terminal.
Inside the Makefile, cookiecutter has added a bunch of functions like this dist function. This function runs the setup-dot-py file to build source and wheel distributions for your package.
There is also a clean-build function, which deletes the old distribution files so you can safely create new ones for a new release.
There is also the test function, which simply runs pytest, and the release function which uploads your newest distributions to PyPI.
5. How do I use the Makefile?
You can use the makefile functions by navigating to the top of your package and using the command make followed by the function name.
6. How do I use the Makefile?
So to build new source and wheel distributions, you would type make dist into the terminal and run this.
7. Makefile summary
You can also get a summary of the commands available in the Makefile by using the make help command. This lists the functions in the makefile as well as what they do.
8. Let's practice!
Okay, let's go on to the final practice!