[Python] Organizing Python source files for two related projects with some shared code in one...

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    I'm writing a system in Python that has to components: a compiler and a runtime. I could organize the files like:

    project/
    compiler/
    runtime/


    When a user uses the runtime, the compiler is not needed at all and doesn't even need to be installed.

    However, I'd like to share some code between the two components, e.g., a util directory with various .py files for utility code that's common. Where can/should I put util?

    If it matters, the runtime code is not something users will use really directly. I intend to eventually have scripts that package up the runtime and user code and builds a container that's deployed.

    Note: I did look at some of the similar questions, but it seems that they're all 10+ years old and I assume thoughts on packaging Python has changed somewhat in the last decade.

    Continue reading...

Compartilhe esta Página