Q. I'm trying to add a custom tool for `towncrier`...
# plugins
r
Q. I'm trying to add a custom tool for
towncrier
like: https://github.com/lablup/backend.ai/pull/427/files but it does not appear to be included in exported venv generation and I cannot find out how to "execute" it. I've referred the
flake8
&
twine
subsystem implementation. I think it may be because
towncrier
does not belong to specific builtin goals such as lint, check, etc. Should I add a new goal that specifically executes towncrier (which could be named as
update-changelog
)?
https://www.pantsbuild.org/docs/rules-api-goal-rules this doc describes a generic "goal subsystem" case, but i'd like to know how to apply this to a
PythonToolBase
subclass.
If a subclass both
PythonToolBase
and
GoalSubsystem
, it seems to work to some extent, e.g., listing goals shows "Towncrier" goal. But if I tries to run it,
image.png
image.png
even after changing the name to all lower cases, it's same
hmm adding a separate
Goal
subclass and
goal_rule
looks same
h
would it make sense to use the
package
plugin hook? That modeling seems to make sense to me, you're creating a specific asset at the end this is how we did Sphinx https://github.com/pantsbuild/pants/pull/15512
r
hm.. the result is just updated
CHANGELOG.md
towncrier also automatically
git add
the changes
and towncrier must be run before making a new release where
./pants package
is invoked
and sometimes we manually edit the changelog after running towncrier and before packaging
towncrier is a just auxiliary indenepdent tool
i just want to run it as a standalone goal
(with all the goodies of
PythonToolBase
such as separate lockfiles and exports)
ah, the clue to resolve missing export is
Copy code
UnionRule(ExportPythonToolSentinel, SphinxExportSentinel),