Common clean logic made available to plugins? #1366
Replies: 3 comments 1 reply
-
I would much prefer authors to handle that which is why I made that part of the interface. Can you explain a bit what might assist you? |
Beta Was this translation helpful? Give feedback.
-
What might assist is if Hatch plugins could call code provided by Hatch that cleans artifacts created by the plugin, and optionally their build directories. Is it possible I'm misunderstanding, or not seeing something in the bigger picture? |
Beta Was this translation helpful? Give feedback.
-
I'm asking whether it makes sense for Hatch to provide plugin authors a routine to call to clean artifacts created by plugins that is run when Why this is useful: build artifacts like man pages, localisation files, and desktop integration files are built somewhere within subdirectories of the project directory, ready for consumption by (for example) Linux packaging tools that could relocate them to somewhere on the target system, outside of the source distribution directory. These artifacts are not needed during project development, so it makes sense to clean them after a build and publish sequence. By the way, just to make sure I am understanding what the meaning of an artifact is, by artifact I mean something output by a plugin for incorporation in an source distribution. I assume that's what Hatch takes them to be also. If not, that might be why we are confused! |
Beta Was this translation helpful? Give feedback.
-
Hi Ofek, I now have two plugins, one for gettext that you recently saw, and now another to automatically generate a manual page from an ArgumentParser object. I haven't yet release this new one, but I will do so shortly (the code is done).
Both plugins share common code to clean output files such that they delete the output files they create, and also the build directories if and only if the build directories contain nothing other than the output files the plugin created. If I make a third plugin (no plans at this stage), then I imagine I would have to do that code again.
Does Hatch already have an interface to help with this cleanup work? Or is this one of those things where you would prefer plugin authors to write their own code to handle the unique needs?
Beta Was this translation helpful? Give feedback.
All reactions