jimmymathews / graph-path

Explore graph structure at the command line
0 stars 0 forks source link

File breakup and packaging/distribution #10

Closed jimmymathews closed 4 years ago

jimmymathews commented 4 years ago

To make development more manageable, the codebase should perhaps be split into several relatively independent units and placed into separate files. This is useful for working on multiple changes at once; alterations in one file won't (immediately) affect or be affected by changes in another file.

Doing this, however, changes the distribution mechanism, since we can't just use a single executable Python file anymore. I read about a simple method:

  1. Break into multiple files, with a single point of entry, __main__.py. (Use import statements to use the other files). While we're at it, let's look into bringing in the Python dependencies here, reducing the end-users' burden.
  2. Make a zip archive of all these files.
  3. Prepend the python shebang line to the zip file (this is apparently allowed by the zip file format).
  4. Distribute the resulting zip in the same way we are currently distributing the single executable.
jimmymathews commented 4 years ago

Done. All steps, 1-4. Note: I switched to #!/bin/bash (for the install/uninstall scripts), and #!/usr/bin/env python in place of the previous call to which python (for the zip executable). Seems more portable for POSIX-compliance systems.