Skip to content

Define the scope of this project more clearly #24

@pfmoore

Description

@pfmoore

As discussed in #20, the precise scope of this project - in other words, the question "what is an editable install" needs to be clarified.

At a basic level, this project is intended to implement the machinery to expose a (subset of a) project's files via Python's import system, as if the project is installed, but still allowing the user to edit the files in place, and have the changes visible.

The following restrictions apply:

  1. Files that need any sort of "build step" (such as source code for compiled modules) cannot be exposed in an "editable" form.
  2. The source layout must be suitable. Defining what counts as "suitable" will be an important factor here.
  3. Only capabilities supported by the import system are guaranteed. So, for example, locating data files by reference to __file__ may not be supported (or may only be supported under certain types of editable install).

To set expectations, a pure Python project, created using a src layout (where all of the project code, and nothing else, is stored under the src directory) with everything installed under the name it has in the project source, is cleanly and simply exposed by installing a single .pth file containing the absolute path of the src directory. That is the baseline use case, and should be considered the default and standard approach when using this library (it is exposed via the add_to_path method).

All other approaches must be supported by use cases, which need to address the following questions:

  1. Why doesn't the src layout approach work for you?
  2. How did you handle your project before now?
  3. If the answer to (2) is that you haven't used editable installs before, why must you use them now? And if you're changing your processes to use editable installs, why can't you change your project layout to support existing editable install methods at the same time?
  4. Can the backend support this use case with the existing machinery? There is some leeway here, because every use case can be supported using a directory full of links plus a .pth file. Links aren't necessarily ideal, though, so this question should be viewed as more of a trade-off than an absolute.

Note in particular that "what build backend are you using" is not a question. If you have a valid use case, we can support it. On the other hand, if your problem is "we're switching backends", then that is not a justification - "compatibility with backend X" is not a goal here1.

TODO: Write up the use cases supporting the existing methods in the library. [Edit: Done]

Suggestions for extensions to the existing scope should be written up in a similar format to the use cases presented here for the current scope.

Footnotes

  1. One of the arguments for the editable install mechanism was to allow backends to choose what capabilities they offered, rather than forcing users to live with whatever their installer provides, as there's more choice of backend than of installer. As a consequence of that, what editable install capabilities are available should be a factor in choosing your backend, not an argument for all backends to provide everything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions