lektor icon indicating copy to clipboard operation
lektor copied to clipboard

Features/dependencies on files on pyton path

Open dwt opened this issue 4 years ago • 0 comments

Issue(s) Resolved

Fixes #499 - or at least makes it much more manageable.

Description of Changes

None of this has happened yet, because this is a draft pull request to spark discussion.

  • [ ] Wrote at least one-line docstrings (for any new functions)
  • [ ] Added unit test(s) covering the changes (if testable)
  • [ ] Included a screenshot or animation (if affecting the UI, see Licecap)
  • [ ] Link to corresponding documentation pull request for getlektor.com

I have relaxed the requirement for the path cache that every file be below the env.root_path but can also be below any of the paths in sys.path. This allows source files in plugins to work, even if the plugin is not a source install, but instead a normal dependency.

What do you think? I am kind of surprised that this worked at all. Also I have no ideas about the ramifications.

So - what do you guys think, what would be a better way to support source files that are not below env.root_path and what ramifications does a change like this have?

One thing I don't like about this, is that before this AFAIK no absolute paths where stored in the build-state, making the entire project eminently relocatable (even between machines). Not sure if that is actually a design goal though.

dwt avatar Mar 19 '21 19:03 dwt