So I have a Python package following the project structure outlined by the Python Packaging User Guide (Without the tests/ directory). Let’s call it Package A.

This package can be used alongside another package, Package B, however no proper compatibility exists in Package A to support Package B’s rendering system.

I want to make a compatibility package, Package AB, to make Package B’s systems work with Package A. It shares the same dependencies as Package A, however it has Package B as a dependency.

How should I setup my project structure for Package AB? Should it be its own project directory? Should it be nested inside Package A’s src directory?

Additionally, I have Sphinx /w Hatch setup with Package A for documentation. Depending on the setup chosen above, how should I setup documentation for Package AB?

Some things to note:

  • Package AB would use classes and methods from Package A and Package B
  • Package B’s license (MIT) is compatible with Package A (GPLv3). Package AB would be licensed under the same as Package A

If more details are required, let me know.

  • one_old_coder@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 days ago

    Stupid questions:

    • What is this “rendering system”? Is it optional or mandatory?
    • Why not put the compatibility layer/class/thing inside Package A?
    • AstroLightzOP
      link
      fedilink
      arrow-up
      1
      ·
      19 days ago

      What is this “rendering system”?

      Basically, it’s a TUI library for getting user input. It has different types of prompts, like text and multiple choice.

      Is it optional or mandatory?

      For use with Package A: Optional. However with Package AB: Mandatory, as this compatibility package would essentially replace certain functions in Package B.

      Why not put the compatibility layer/class/thing inside Package A?

      I don’t want Package A having Package B as a dependency when it’s not being used. I only want Package B as a dependency when using Package A with Package B (AB).