Session Ready
Exercise

Create the installer script

At this point you have completed the source code development of the mortgage_forecasts project. The next step is to write packaging scripts that will install the contents of the inner mortgage_forecasts directory into your Python environment. The packaging scripts define metadata about your package like the author, the license, and what subdirectories contain the package code.

There are multiple methods to package and deliver Python code. In this course we'll cover a hybrid method that utilizes the setuptools package and conda build recipes.

First, you're going to write a setup.py file. A template has been provided for you in the mortgage_forecasts directory.

Instructions 1/2
undefined XP
  • 1

    Edit the setup.py file to add the following string arguments to the setup function call.

    • name: the package name mortgage_forecasts
    • description: '30 year mortgage rate models'
    • author: your name
    • 2

      The final step is to specify what directories setuptools should use to find the package source files.

      The find_packages() function searches the directory where setup.py resides and returns a list of all subdirectories that have an __init__.py file.

      Add packages = find_packages() as an argument to setup.py.