Skip to content

feat: Support optional installation extras for MCP server and class-generator #2627

@myakove

Description

@myakove

Summary

The package currently installs all components (core, MCP server, class-generator) together. Users should be able to install only the components they need.

Proposed Installation Options

Installation Command Components
Core only pip install openshift-python-wrapper ocp_resources, fake_kubernetes_client
Core + MCP pip install openshift-python-wrapper[mcp] Core + mcp_server
Core + Class Generator pip install openshift-python-wrapper[class-generator] Core + class_generator
All components pip install openshift-python-wrapper[all] Core + MCP + Class Generator

Dependency Analysis

Core dependencies (required for ocp_resources):

  • jsonschema
  • kubernetes
  • packaging
  • python-benedict
  • python-simple-logger
  • requests
  • timeout-sampler
  • xmltodict

Class-generator specific (NOT used by core):

  • cloup - CLI framework
  • colorlog - Colored logging
  • deepdiff - Diff comparisons
  • jinja2 - Template rendering
  • pyhelper-utils - Shell command utilities
  • rich - Rich console output
  • ruff - Code formatting for generated files

MCP specific:

  • fastmcp - MCP server framework

Implementation

[project.optional-dependencies]
class-generator = [
    "cloup>=3.0.5",
    "colorlog>=6.8.2",
    "deepdiff>=8.0.1",
    "jinja2>=3.1.4",
    "pyhelper-utils>=0.0.42",
    "rich>=13.9.2",
    "ruff>=0.6.9",
]
mcp = [
    "fastmcp>=2.10.4",
]
all = [
    "openshift-python-wrapper[mcp,class-generator]",
]

Benefits

  1. Smaller default install - Core package goes from 16 dependencies to 8
  2. Flexibility - Install only what you need
  3. Reduced dependency conflicts - Fewer dependencies = fewer potential conflicts

Tasks

  • Move class-generator dependencies to [class-generator] extra
  • Move fastmcp to [mcp] extra
  • Update [tool.hatch.build.targets.wheel] to conditionally include packages
  • Update documentation with new installation options
  • Update README with installation variants

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions