If you have just stumbled upon my OSD600 series of blog posts, it has been created to document and share my learnings as I progress through my Open Source Development college course.
In this blog post, I want to go over the steps I took to publish my CLI tool - /
See a demo of the functionality on YouTube: ).
1. Install the tool using pip
pip install addcom
2. Default: Create an account and generate the API key here:
I welcome feedback/ for dependency management and packaging into my project, replacing the good old setuptools. This decision was inspired by recommendations from peers and various blog posts highlighting Poetry’s simplicity and modern features.
I removed the setup.py file, which handled the tools' packaging. Then, moved the metadata from __init__.py into a pyproject.toml file, which I created a couple of labs back to add configs for the source code formatter and linter.
Additionally, I did a bit of refactoring to make the project's structure a bit cleaner. To do so I moved all source code files into a single app package and updated the imports across the project.
For guidance, I referred to , updated the tool’s documentation, and went on to publishing my tool to
Steps to publish
1. Tagging the Release
I started by tagging the release using an annotated Git tag to mark the version:
CODE
git tag -a v1.0.0 -m"my version 1.0.0"
2. Configuring PyPI Credentials
Next, I configured Poetry to use my PyPI credentials (this step required obtaining a PyPI API token):
CODE
poetry config pypi-token.pypi <your-pypi-token>
To generate a PyPI token, I created an account on PyPI, navigated to Account Settings, and selected Add API Tokens.
You can find my release here: , generate an API key, and run the tool with the following command:
CODE
addcom FILE_PATH(S)-a"your_api_key"
For detailed information on the tool's functionality, usage, and instructions, visit the release page on PyPI.
Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR