DPS909 - Lab 10
Published: 2021-11-26 00:06:00

# Introduction
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](https://github.com/roman-rezinkin/RomanStaticSG)) 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](https://packaging.python.org/tutorials/packaging-projects/) 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](https://test.pypi.org/project/staticsg-rrezinkin/1.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](https://github.com/roman-rezinkin/RomanStaticSG/commit/0c95cc843028be0f6d1d19521171fbe5c2b3e65a). 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](https://github.com/roman-rezinkin/RomanStaticSG/commit/369e77ba6e6a84ad82506f8e76c4b94a09cb3db5). 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](https://github.com/roman-rezinkin/RomanStaticSG/commit/f6beacc8ee007008a9a7d15cb99cb96416ad98f5)
 2. [Commit 2](https://github.com/roman-rezinkin/RomanStaticSG/commit/ac7f3c2acbedd9814e406c569b6e190c0ec36707)
 3. [Commit 3](https://github.com/roman-rezinkin/RomanStaticSG/commit/a4449710f2c6c39fc6844c385607c08cf572ebba)
 4. [Commit 4](https://github.com/roman-rezinkin/RomanStaticSG/commit/295bec98c3aec80e20071b4f0e43a819c1c95219)

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](https://github.com/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 README.md file.
Here is a screenshot of the feedback: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v3h1ywq7x3mqzy7bzo46.png)

# How to use my SSG
The instructions to use my static site generator could be found in my [README](https://github.com/roman-rezinkin/RomanStaticSG#how-to-use-romanstaticsg).
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:
```c
pip install staticsg-rrezinkin
```
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
```c
from staticsg import romanssg

romanssg.main(sys.argv[1:])
```
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](https://github.com/roman-rezinkin/RomanStaticSG#command-list)