Skip to content

Convert codebase to pip-installable Python package#4

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/convert-codebase-to-python-package
Closed

Convert codebase to pip-installable Python package#4
Copilot wants to merge 4 commits into
mainfrom
copilot/convert-codebase-to-python-package

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 16, 2025

Transforms the repository into a standalone Python package distributable via pip, enabling installation without cloning the entire repository.

Package Structure

  • src layout: Moved core modules to src/robocorp_adapters_custom/
  • pyproject.toml: Modern build configuration with hatchling backend
  • Dependencies: Core (robocorp>=1.0.0) + optional extras for redis, mongodb, postgresql
  • Python support: 3.9+

Public API (14 exports)

from robocorp_adapters_custom import (
    # Adapters
    SQLiteAdapter, RedisAdapter, DocumentDBAdapter,
    # Functions
    get_adapter_instance, initialize_adapter, load_adapter_class,
    # Types & Exceptions
    BaseAdapter, State, EmptyQueue, AdapterError,
)

Installation

# Basic (includes SQLite)
pip install robocorp-adapters-custom

# With optional backends
pip install robocorp-adapters-custom[redis]
pip install robocorp-adapters-custom[mongodb]
pip install robocorp-adapters-custom[all]

Usage

import os
from robocorp_adapters_custom import get_adapter_instance, State

os.environ["RC_WORKITEM_ADAPTER"] = "robocorp_adapters_custom._sqlite.SQLiteAdapter"
os.environ["RC_WORKITEM_DB_PATH"] = "work_items.db"

adapter = get_adapter_instance()
item_id = adapter.reserve_input()
payload = adapter.load_payload(item_id)
adapter.release_input(item_id, State.DONE)

Documentation

  • INSTALLATION.md: Installation guide with all methods
  • USAGE_EXAMPLES.md: 19KB of practical examples for all adapters
  • PACKAGE_CONVERSION_SUMMARY.md: Technical conversion details

Changes

  • Relocated scripts/config.pysrc/robocorp_adapters_custom/config.py
  • Updated workitems_integration.py imports to use relative paths
  • Added MANIFEST.in, LICENSE (MIT), updated .gitignore
  • Repository files (scripts/, devdata/, yamls/) remain for development

Package operates independently of repository structure while maintaining backward compatibility with existing Robocorp work-item integration points.

Original prompt

Title: Convert Existing Codebase into an Installable Python Package

Objective: Define the steps and structure needed to transform the current codebase into a standalone Python package that can be installed via pip and used as a drop-in replacement for existing Robocorp work-item functionality.

Instructions:

  1. Identify the specific modules and functionality that will become the public API of the package.
  2. Create a standardized Python package layout (e.g., src/<package_name>/ plus required metadata files).
  3. Add a pyproject.toml with proper build configuration, dependencies, and package metadata.
  4. Implement an import path and module structure that mirrors the interfaces currently expected by Robocorp work items.
  5. Include any initialization logic, configuration hooks, or adapters needed for seamless plug-in replacement.
  6. Prepare a local installation workflow (pip install .) and validate that the package can be used without cloning or including the entire repository in downstream projects.
  7. Document usage instructions, including how to import and substitute the new package in place of the existing Robocorp components.

Constraints:

  • The package must operate independently of the original repository structure.
  • All external dependencies must be clearly declared.
  • The public API should remain backward-compatible with the current Robocorp work-item integration points.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 16, 2025 09:49
Co-authored-by: joshyorko <54248591+joshyorko@users.noreply.github.com>
Co-authored-by: joshyorko <54248591+joshyorko@users.noreply.github.com>
Co-authored-by: joshyorko <54248591+joshyorko@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert existing codebase into an installable Python package Convert codebase to pip-installable Python package Nov 16, 2025
Copilot AI requested a review from joshyorko November 16, 2025 09:58
@joshyorko
Copy link
Copy Markdown
Owner

@copilot you need to clean this up i noticed you moved everything to SRC but you left copies in the root of the project?

@joshyorko joshyorko closed this Nov 16, 2025
@joshyorko joshyorko deleted the copilot/convert-codebase-to-python-package branch November 16, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants