<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhinav</title>
    <description>The latest articles on DEV Community by Abhinav (@abhinavintech).</description>
    <link>https://dev.to/abhinavintech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3482209%2F28f99ec3-8cbb-4abc-8a7e-54746b866a0f.png</url>
      <title>DEV Community: Abhinav</title>
      <link>https://dev.to/abhinavintech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhinavintech"/>
    <language>en</language>
    <item>
      <title>Shipping 1.0.0: From Local Repo to a Published Python Package</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Mon, 24 Nov 2025 23:48:16 +0000</pubDate>
      <link>https://dev.to/abhinavintech/shipping-100-from-local-repo-to-a-published-python-package-59n3</link>
      <guid>https://dev.to/abhinavintech/shipping-100-from-local-repo-to-a-published-python-package-59n3</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;This post documents releasing version 1.0.0 of the project to Python’s ecosystem. It covers: tooling choice, release steps, lessons learned, user testing feedback, required code changes, and installation/usage instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tooling &amp;amp; Registry Choices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Build backend: setuptools (standard &lt;code&gt;pyproject.toml&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Build helper: &lt;a href="https://pypi.org/project/build/" rel="noopener noreferrer"&gt;&lt;code&gt;build&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Upload tool: &lt;a href="https://pypi.org/project/twine/" rel="noopener noreferrer"&gt;&lt;code&gt;twine&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Staging registry: TestPyPI (&lt;a href="https://test.pypi.org" rel="noopener noreferrer"&gt;https://test.pypi.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Production registry: PyPI (&lt;a href="https://pypi.org" rel="noopener noreferrer"&gt;https://pypi.org&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Release Workflow (Detailed)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clean repo
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update version in &lt;code&gt;pyproject.toml&lt;/code&gt; (set to 1.0.0).&lt;/li&gt;
&lt;li&gt;Run tests
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python &lt;span class="nt"&gt;-m&lt;/span&gt; pytest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;(Optional) Add or confirm &lt;code&gt;__all__&lt;/code&gt; exports and &lt;code&gt;__init__.py&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Build distributions
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--upgrade&lt;/span&gt; build twine
   python &lt;span class="nt"&gt;-m&lt;/span&gt; build
   &lt;span class="nb"&gt;ls &lt;/span&gt;dist/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Validate artifacts
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python &lt;span class="nt"&gt;-m&lt;/span&gt; twine check dist/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Tag release
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.0.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Release 1.0.0"&lt;/span&gt;
   git push origin v1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Upload to TestPyPI
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python &lt;span class="nt"&gt;-m&lt;/span&gt; twine upload &lt;span class="nt"&gt;--repository-url&lt;/span&gt; https://test.pypi.org/legacy/ dist/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Fresh environment install test
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv-test
   &lt;span class="nb"&gt;source&lt;/span&gt; .venv-test/bin/activate
   python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--index-url&lt;/span&gt; https://test.pypi.org/simple &lt;span class="nt"&gt;--extra-index-url&lt;/span&gt; https://pypi.org/simple your-package-name
   python &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"import your_package; print(your_package.__version__)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Upload to PyPI&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; twine upload dist/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update README: add install, usage, changelog section.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optional: create a GitHub Release referencing tag.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Minimal &lt;code&gt;pyproject.toml&lt;/code&gt; Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[project]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your-package-name"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.0.0"&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Concise description of the package."&lt;/span&gt;
&lt;span class="py"&gt;readme&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"README.md"&lt;/span&gt;
&lt;span class="py"&gt;requires-python&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="py"&gt;"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;3.9&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="py"&gt;license&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"MIT"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="py"&gt;authors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Your Name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"you@example.com"&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;keywords&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"context"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"repository"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"utility"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;classifiers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s"&gt;"Programming Language :: Python :: 3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"License :: OSI Approved :: MIT License"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"Operating System :: OS Independent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"Development Status :: 5 - Production/Stable"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[project.optional-dependencies]&lt;/span&gt;
&lt;span class="py"&gt;dev&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"pytest"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"twine"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[tool.setuptools]&lt;/span&gt;
&lt;span class="py"&gt;packages&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"your_package"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Adjustments
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Added project metadata in &lt;code&gt;pyproject.toml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ensured package has &lt;code&gt;your_package/__init__.py&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Exposed &lt;code&gt;__version__&lt;/code&gt; inside package to avoid duplication.&lt;/li&gt;
&lt;li&gt;Expanded README for install and usage.
No functional logic changes required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example &lt;code&gt;__init__.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;__version__&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1.0.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.core&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;main_tool&lt;/span&gt;  &lt;span class="c1"&gt;# example public API
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  User Testing Session Notes
&lt;/h2&gt;

&lt;p&gt;Observed issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing virtual environment usage (user attempted global install).&lt;/li&gt;
&lt;li&gt;Initial confusion about required Python version.&lt;/li&gt;
&lt;li&gt;User looked for quick start; added a “5‑line usage” block.
Resolutions:&lt;/li&gt;
&lt;li&gt;Added explicit venv commands.&lt;/li&gt;
&lt;li&gt;Added Python version badge.&lt;/li&gt;
&lt;li&gt;Clarified import path with a minimal working snippet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation (Users)
&lt;/h2&gt;

&lt;p&gt;Production (PyPI):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;your-package-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TestPyPI (staging validation):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--index-url&lt;/span&gt; https://test.pypi.org/simple &lt;span class="nt"&gt;--extra-index-url&lt;/span&gt; https://pypi.org/simple your-package-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upgrade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-U&lt;/span&gt; your-package-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uninstall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip uninstall your-package-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;your_package&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;main_tool&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;main_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI example (if provided):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;your-package-name &lt;span class="nt"&gt;--help&lt;/span&gt;
your-package-name run &lt;span class="nt"&gt;--input&lt;/span&gt; data.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Release Checklist (Reusable)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ] Bump version
[ ] Run tests
[ ] Build sdist + wheel
[ ] twine check
[ ] Tag and push
[ ] TestPyPI upload
[ ] Fresh env install test
[ ] PyPI upload
[ ] Update README/changelog
[ ] Announce
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Useful Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org" rel="noopener noreferrer"&gt;https://pypi.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;TestPyPI: &lt;a href="https://test.pypi.org" rel="noopener noreferrer"&gt;https://test.pypi.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;build: &lt;a href="https://pypi.org/project/build/" rel="noopener noreferrer"&gt;https://pypi.org/project/build/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;twine: &lt;a href="https://pypi.org/project/twine/" rel="noopener noreferrer"&gt;https://pypi.org/project/twine/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Packaging User Guide: &lt;a href="https://packaging.python.org/" rel="noopener noreferrer"&gt;https://packaging.python.org/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>cli</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Building Robust CI/CD Pipeline</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Sat, 15 Nov 2025 03:55:57 +0000</pubDate>
      <link>https://dev.to/abhinavintech/building-robust-cicd-pipeline-3kkg</link>
      <guid>https://dev.to/abhinavintech/building-robust-cicd-pipeline-3kkg</guid>
      <description>&lt;p&gt;In this post, I'll share my experience implementing a comprehensive CI/CD pipeline using GitHub Actions, writing tests for an existing codebase, and the valuable lessons learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up GitHub Actions: From Zero to Production-Ready
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Challenge:
&lt;/h3&gt;

&lt;p&gt;When I first approached this project, I was working with repo-contextr, a Python CLI tool that analyzes git repositories and packages their content for sharing with Large Language Models (LLMs). The project already had a solid foundation but lacked automated testing and continuous integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing the CI Workflow
&lt;/h2&gt;

&lt;p&gt;In this, I made sure that I opt a robust approach to maintain the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-platform&lt;/strong&gt; compatibility (Linux, Windows, macOS)&lt;/li&gt;
&lt;li&gt;Code quality through &lt;strong&gt;linting and formatting&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Type safety with static analysis&lt;/li&gt;
&lt;li&gt;Comprehensive &lt;strong&gt;test coverage&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Successful package building&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the GitHub Actions workflow I implemented:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main, develop ]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: ['3.12']

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
        cache: 'pip'

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install "ruff&amp;gt;=0.8.0" "mypy&amp;gt;=1.17.1" "pytest&amp;gt;=8.4.2" "pytest-cov&amp;gt;=6.0.0"
        pip install --editable .

    - name: Verify installation
      run: |
        python -c "import contextr; print('Package imported successfully')"
        python -c "from contextr.cli import app; print('CLI imported successfully')"

    - name: Run ruff linting
      run: |
        ruff check src tests

    - name: Run ruff formatting check
      run: |
        ruff format --check src tests

    - name: Run mypy type checking
      run: |
        mypy src
      continue-on-error: true

    - name: Run tests with coverage
      run: |
        pytest --cov=src --cov-report=xml --cov-report=term

  build:
    runs-on: ubuntu-latest
    needs: test

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.12'

    - name: Install build dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build

    - name: Build package
      run: python -m build

    - name: Upload artifacts
      uses: actions/upload-artifact@v4
      with:
        name: dist-packages
        path: dist/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Writing Tests for Someone Else's Code: A Different Perspective
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Understanding the perspective:
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://github.com/dharamghevariya/repo-contextr" rel="noopener noreferrer"&gt;Repo-Contextor&lt;/a&gt; already had a modular architecture as displayed below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/contextr/
├── commands/          # CLI command implementations
├── config/           # Configuration management
├── discovery/        # File discovery logic
├── git/             # Git operations
├── processing/      # File reading and processing
└── statistics/      # Token counting and stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  My Approach:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File Discovery Module&lt;/strong&gt;:
The file discovery system needed comprehensive testing for various scenarios:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def test_discover_files_with_pattern(self, temp_dir):
    """Test discovering files with include pattern."""
    (temp_dir / "file1.py").write_text("# python")
    (temp_dir / "file2.js").write_text("// javascript")
    (temp_dir / "file3.py").write_text("# python")

    result = discover_files([temp_dir], include_pattern="*.py")
    assert len(result) == 2
    assert all(f.suffix == ".py" for f in result)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Git Operations&lt;/strong&gt;:
Git integration required careful mocking to test various scenarios:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def test_get_git_info_valid_repo(self, sample_git_repo):
    """Test getting git info from valid repository."""
    result = get_git_info(sample_git_repo)

    assert result is not None
    assert isinstance(result, dict)
    assert "commit" in result
    assert "branch" in result
    assert "author" in result
    assert "date" in result

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CLI Interface:&lt;/strong&gt;
Testing the CLI required understanding the Typer framework and proper mocking:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def test_basic_execution(self, mock_config, mock_package):
    """Test basic CLI execution without errors."""
    # Mock configuration
    mock_config_obj = Mock()
    mock_config_obj.paths = ["."]
    mock_config_obj.include = None
    mock_config_obj.recent = False
    mock_config_obj.output = None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Outcome:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test count:&lt;/strong&gt; Increased from 108 to 160 tests (+48% increase)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code coverage:&lt;/strong&gt; Improved from 35.72% to 78.03% (+42.31% improvement)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Module coverage:&lt;/strong&gt; Several modules went from 0% to 95%+ coverage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Implementing CI/CD isn't just about automation—it's about adopting a mindset of continuous improvement and quality assurance. The process taught me several valuable lessons: Quality Gates Matter, Fast Feedback Loops, Documentation Through Code, Confidence in Changes. &lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Refactoring: A way to write better Code</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Sat, 11 Oct 2025 02:00:22 +0000</pubDate>
      <link>https://dev.to/abhinavintech/refactoring-a-way-to-write-better-code-45fg</link>
      <guid>https://dev.to/abhinavintech/refactoring-a-way-to-write-better-code-45fg</guid>
      <description>&lt;p&gt;As I have landed in the Week 6, I got introduced to the new practice and that is &lt;a href="https://refactoring.com/" rel="noopener noreferrer"&gt;Refactoring&lt;/a&gt;, which literally means to make changes in the internal structure keep the functionality not only intact but also enhancing it to scale when it comes to some projects. I applied onto my project i.e. &lt;a href="https://github.com/Abhinavintech/Repo-Contextor" rel="noopener noreferrer"&gt;Repository-Contextor&lt;/a&gt; and enhanced its actual working so as to scale well and come up with better tweeks&lt;/p&gt;

&lt;p&gt;I start with focusing on the function extraction- by pulling out th  reusable logic for the verbose logging, rendering and processing. Then I collected and joined the shared utilities- like language mapping and data building. I then created a single source to get the constants such as file extensions and skip directories. I then encapsulated the data and its analysis into the &lt;a href="https://github.com/Abhinavintech/Repo-Contextor/blob/main/src/rcpack/repository_analyzer.py" rel="noopener noreferrer"&gt;&lt;code&gt;Repository_Analyzer&lt;/code&gt;&lt;/a&gt; class to make the code following the object-Oriented pattern.&lt;/p&gt;

&lt;p&gt;I addressed naming hygiene, replacing ambiguous variables like &lt;code&gt;f&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; with descriptive names like &lt;code&gt;discovered_file&lt;/code&gt;and &lt;code&gt;resolved_path&lt;/code&gt;, making the code self-documenting. Improvement made were incremental. &lt;/p&gt;

&lt;h2&gt;
  
  
  Using Git: Rebasing, Squashing
&lt;/h2&gt;

&lt;p&gt;Working on the &lt;code&gt;refactoring&lt;/code&gt; branch was not a new challenge for me but when I interactively rebase my branch with the main using &lt;code&gt;git rebase -i main&lt;/code&gt;, I squashed all the small incremental changes into one &lt;a href=""&gt;commit&lt;/a&gt; without cluttering the log.Merging back to main via fast-forward ensured a clean integration, and pushing to GitHub made the work visible. I faced issues while I was making changes. Inconsistent language mappings, issues arose during file reading consolidation, and subtle path-handling errors arose during extraction part. Talking about the issues- Yesss, alot of them. Import errors during code splitting and parameter mismatches in class refactoring caused brief disruptions. Ultimately, refactoring invests in code quality. Follow iterative patterns—extract, consolidate, encapsulate, refine—to transform technical debt into scalable excellence.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>From 0 to 0.1</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Sat, 20 Sep 2025 03:48:55 +0000</pubDate>
      <link>https://dev.to/abhinavintech/from-0-to-01-4ki6</link>
      <guid>https://dev.to/abhinavintech/from-0-to-01-4ki6</guid>
      <description>&lt;p&gt;When developers ask for help from ChatGPT or other LLMs, they usually struggle to share their code effectively. Copy-pasting individual files loses important context: the project structure, related files, and the big picture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo-Contextor&lt;/strong&gt; solves this problem by scanning a local Git repository and producing a well-structured text file with the repository’s contents. This file can then be shared with an LLM for debugging, explanation, or collaboration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Details
&lt;/h2&gt;

&lt;p&gt;Repo-Contextor is written in Python, structured as a CLI tool. The repo is organized under src/rcpack/ with separate modules for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cli.py – command-line interface using click.&lt;/li&gt;
&lt;li&gt;discover.py – logic to walk the file system and collect files.&lt;/li&gt;
&lt;li&gt;gitinfo.py – gathers repository metadata.&lt;/li&gt;
&lt;li&gt;treeview.py – builds the project tree structure.&lt;/li&gt;
&lt;li&gt;renderers/ – handles output formats (Markdown, JSON/YAML).&lt;/li&gt;
&lt;li&gt;This modular design makes it easier to add features in future
releases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Working on Release 0.1 taught me a lot about:&lt;/p&gt;

&lt;p&gt;1.Project structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to lay out a Python CLI tool using pyproject.toml and src/ layout.&lt;/li&gt;
&lt;li&gt;Why separating concerns into modules makes code more maintainable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Git and GitHub workflows&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to set up a new repository properly (with README, LICENSE, etc.).&lt;/li&gt;
&lt;li&gt;How to manage issues, commits, and releases in GitHub.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Packaging for LLMs&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The challenges of providing enough context without overwhelming the model.&lt;/li&gt;
&lt;li&gt;Why tree views and filtered file outputs are more useful than raw dumps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In challenges, I faced merging issues, lots of conflict as well as some basic issues such as .vscode/ and rcpack.egg_info/ got checked in and had to re-read some basics of removing it while dealing with multiple folders.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Commitment</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Sat, 20 Sep 2025 03:40:34 +0000</pubDate>
      <link>https://dev.to/abhinavintech/commitment-2kh6</link>
      <guid>https://dev.to/abhinavintech/commitment-2kh6</guid>
      <description>&lt;p&gt;It's been 3 weeks and the word open-source and to practice has become part of my life. I have taken a short step towards it by contributing in my peer's repository &lt;a href="https://github.com/hsachdeva9/share-my-repo" rel="noopener noreferrer"&gt;share-my-repo&lt;/a&gt;, where I added a feature. As everybody says every step count so this is out of the whole journey.&lt;br&gt;
I tried many tools and played with many commands. Stackoverflow and other guiding websites became my favourite. I did it by skimming through the code and then filling the &lt;a href="https://github.com/hsachdeva9/share-my-repo/issues/4" rel="noopener noreferrer"&gt;issue&lt;/a&gt; requesting to add the feature into it.&lt;/p&gt;

&lt;p&gt;Once the issue was filed, I forked the repo, cloned it locally, and created a new branch:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout -b issue-X&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, In &lt;code&gt;cli.py&lt;/code&gt;, I added a new &lt;code&gt;--recent/-r&lt;/code&gt; flag using the existing click options. This was straightforward once I understood how the CLI arguments were being handled.&lt;/p&gt;

&lt;p&gt;The main technical challenge was in &lt;code&gt;file_processor.py&lt;/code&gt;&lt;br&gt;
. I created an &lt;code&gt;is_recent(file, days=7)&lt;/code&gt; helper function that checks the file’s last modified timestamp with Python’s &lt;code&gt;os.stat().st_mtime&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The logic works by comparing the file’s modification time to the &lt;code&gt;current time (via time.time())&lt;/code&gt;, and converting the difference into days. If the difference is less than or equal to 7, the file is considered “recent.”&lt;/p&gt;

&lt;p&gt;Edge cases included:&lt;/p&gt;

&lt;p&gt;Non-existent files → handled with a try/except FileNotFoundError.&lt;/p&gt;

&lt;p&gt;Empty repositories → the function returns an empty list gracefully.&lt;/p&gt;

&lt;p&gt;Finally, in formatter.py, I added a new section &lt;code&gt;"## Recent Changes".&lt;/code&gt; This section outputs each recent file along with how many days ago it was modified.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Example:

## Recent Changes
- src/main.py (modified 2 days ago)
- README.md (modified 5 days ago)`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I updated the README.md to explain the new flag, its usage, and examples.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>python</category>
    </item>
    <item>
      <title>Code Review: As a Beginner</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Sat, 13 Sep 2025 01:57:53 +0000</pubDate>
      <link>https://dev.to/abhinavintech/code-review-as-a-beginner-2bh5</link>
      <guid>https://dev.to/abhinavintech/code-review-as-a-beginner-2bh5</guid>
      <description>&lt;p&gt;When it comes to the code review,  I would choose asynchronous approach other as the reviewer is free of any pressure and skim thoroughly the whole codebase keeping the technical stuff in the mind  .This is helpful in understanding the design and working of the project.Reviewing Someone else’s code was bit new experience is to me as I have never did this before. &lt;br&gt;
Though the &lt;a href="https://github.com/OleksandraKordonets/Repository-Context-Packager/tree/main/src" rel="noopener noreferrer"&gt;code&lt;/a&gt; was structured well but one key aspect i.e. the output was not getting generating well. Concept of Modularity made it easy for me to jump from one part to another without me feeling lost into it.&lt;br&gt;
The project had no tests whatsoever, making it impossible to verify functionality or catch regressions. And this matters because Without tests, every change becomes a potential breaking change. The developer can't be confident that modifications work correctly, and contributors can't verify their changes don't break existing functionality.&lt;br&gt;
The project &lt;a href="https://github.com/OleksandraKordonets/Repository-Context-Packager/issues/8" rel="noopener noreferrer"&gt;lacked any build system&lt;/a&gt; (Makefile, CMake, etc.) and had minimal documentation for setup and usage.A project without proper build instructions is essentially unusable by others. It creates a barrier to entry that prevents adoption and contribution.&lt;br&gt;
To perform the review of any project one must have to have wide range of knowledge regarding that language as well as its practical implementation. Insights from this were - Without tests, fundamental issues can go unnoticed and Approaching code from a user's perspective reveals usability issues that developers might overlook.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Open-Source: lets Unleash it</title>
      <dc:creator>Abhinav</dc:creator>
      <pubDate>Fri, 05 Sep 2025 22:30:57 +0000</pubDate>
      <link>https://dev.to/abhinavintech/open-source-lets-unleash-it-1dnf</link>
      <guid>https://dev.to/abhinavintech/open-source-lets-unleash-it-1dnf</guid>
      <description>&lt;p&gt;Hi readers, this blog is going to be the foundational stone of my open-source journey as from now onwards I will be working closely to build in public which is often overlooked by most of computer science beginners. I have taken the open-source development as a course under the mentorship of &lt;a href="https://blog.humphd.org/author/david/" rel="noopener noreferrer"&gt;David Humphrey&lt;/a&gt; who have dived deep in open source world. &lt;br&gt;
I have been aware about this way of learning and applying on industry level codebase but didn't walk forward to it and now I believe the following 4 months will be full of grind and to prove that things are achievable with positive intent.&lt;br&gt;
I am drawn towards this because of recognition and rewarding nature it come up within thin the developers community which open the gates to the brilliant minds who aims to make an impact in the society via tech. &lt;/p&gt;

&lt;h2&gt;
  
  
  ProtonMail - Privacy for All
&lt;/h2&gt;

&lt;p&gt;I want to draw your attention towards one of the renown open source project &lt;a href="https://github.com/protonmail" rel="noopener noreferrer"&gt;Proton Mail&lt;/a&gt;. I got to about this platform in search of reliable mailing application and privacy it provides is strong. Pardon me if I don't sound technical at this stage but sooner I will figure out the underlying technolgy and my contribution to the open-source community. &lt;br&gt;
I would be highly thankful for all the comments and would like to learn from the best.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>buildinpublic</category>
    </item>
  </channel>
</rss>
