Packaging my CLI

 Creating a Python Package

The first steps I had to take to package my python CLI was to reorganize my directory structure. This involved moving my main python files into a separate folder and after running into some errors I also had to change the import statements in those python files to match the changes made to the directory. Once that was done I was ready to begin packaging my CLI. In this guide I used the next steps were to update my setup.py so it could be used in the next steps to create my package. In my setup.py I had to include all the other packages that needed to be installed to run my CLI, as well as open and read my  README file to be included as well. Once my setup.py was ready I was no ready to create my package by using the setuptools and wheel package with the command python3 setup.py sdist bdist_wheel. This command created to files in a dist folder, the first file was the source distribution and the second file was the built distribution. Now my package was ready to be uploaded. 

Uploading my Python Package

First I needed to register at https://pypi.org. Once my account was created I needed to get an API Token and use this token with the command python -m twine upload dist/* which uploaded my CLI to the python package index which now allowed me to install my package with the command pip install deadOrNot. 

Issues, Bugs and Further Releases

Once I installed my first release and tried running in a different environment I ran into a few issues. The first was that I did not include all the needed dependencies in the setup.py file which caused the package to fail. Another was one I mentioned earlier where the import statements were not working correctly after changing my directory structure. Once I was able to fix these issues I uploaded two new versions of the package following the instructions above. 

User Testing

After updating my README file I tried to get my friend to install and run my CLI. Surprisingly this went pretty well and he was able to get it running fairly simply. The only issue was that I didn't make mention of installing python.

Comments

Popular posts from this blog

Adding Features and Pull Request

Planning for Release 0.4

Release 0.2 3rd Pull Request