DEV Community

Roman Rezinkin
Roman Rezinkin

Posted on

DPS909 - Lab 10


For lab 10 in the DPS open source project course, we are tasked with making an official release of our static site generators that we have worked on over the semester.

The Release

My static site generator (link) was basically ready for a release... or so I thought.
I began my adventure with choosing a release tool and package, which ended up being PyPi. I followed these steps in order to begin the process of packaging and release my static site generator.

In general, the steps were very easy to follow, and I was able to get a version 1.0.0 out in no time. Here is a link to V1.0.0.

After following the commands and installing my package, I ran into a massive issue. I had no main function to call, which would introduce a heap of usability issues for any users. So I decided my static site generator needed a few fixes, before I made new releases.

My Issues

Issue 1

The first issue that I faced was the fact that my static site generator had no official main function to call upon. Yes it had __main__ but that would be troublesome for a user to call instead of simply calling a main function.

Issue 2

The argument parsing was very specific for my tool, which introduces a heap of usability issues for the user. I wanted to rework my argument parsing, so that users can type any command in any order, and the program would still function correctly.

Issue 3

The last issue was refactoring my code, and organizing it with a folder structure. I noticed that in the main folder of my static site generator, I had test files, main logic files and other files. This would make the process of working on my repository a nightmare.

The Fixes

My program underwent many changes.

Issue 1 Fix

The remedy for issue 1 could be found here in this commit. Now with this, I was able to have a proper main function that any user of my static site generator package can utilize.

Issue 2 Fix

The remedy for issue 2 can be found here in this commit. As you can see I introduced a new way of parsing my arguments through the use of the argparser library that is available for python. What a relieve!!!

Issue 3 Fix

The remedy for this issue took a few commits.

  1. Commit 1
  2. Commit 2
  3. Commit 3
  4. Commit 4

The reason why there were so many commits, is because with refactoring it introduced new folders, which broke a lot of my integration tests that I had enabled, and since I am on a Windows machine, I could only address the Linux issues when I would push a change to Github.

User Testing

The user testing was done along side user a-rokay, who was nice enough to try to use my package in a test script. Ahmad's feedback was very positive, and the only change that was recommended was a slight change to my file.
Here is a screenshot of the feedback:
Image description

How to use my SSG

The instructions to use my static site generator could be found in my README.
This README will outline all of the instructions needed in order to get my SSG package up and running in your own script.

But to summarize, you need to run the following command:

pip install staticsg-rrezinkin
Enter fullscreen mode Exit fullscreen mode

This will install the static site generator into your libraries, and now you can easily utilize it in your own project.

To utilize the static site generator

from staticsg import romanssg

Enter fullscreen mode Exit fullscreen mode

As you can see, we need to import it into our python file, and then we can simply call the .main function, and pass it arguments. The list of arguments could be found here: Command List

Discussion (0)