Repository navigation
Replies: 1 comment
|
Thanks for starting this. Happy to review a PR for part 1. For part 2, maybe we can get feedback from more users of towncrier and check what they want. Otherwise, feel free to implemnt something that is useful and works for you. Thanks again |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The monorepo docs recommend one shared
towncrier.tomlwithpackageandnameleft empty, and passing--config,--dirand--versionon every call. That works, but each app still has to feed its own version in by hand, even though it already sits in that app'spyproject.toml.Where the current behaviour comes from
PR #687 (issue #685) added a fallback: when no
name/packageis configured, use[project].namefrompyproject.toml. That fallback lives inload_config(the auto-discovery path) only. With--config, towncrier goes straight toload_config_from_fileand never looks at the--dirpyproject.toml, so:Also, even in the discovery path the version is never read from
[project].version.[project].namebecomespackage, and the version comes from installed metadata or__version__. With static PEP 621 versions that means towncrier has to run inside the app's environment.Proposal
I see two independent pieces.
1. Read
[project].version(andname) from the--dirpyproject.toml.When
--configand--dirare both given, apply the same[project]fallback that discovery already applies, and use[project].versiondirectly when it is static. This is a small change, useful outside monorepos too, and a subset of #347. On its own it already removes--versionfrom every monorepo invocation.2. Config inheritance, like ruff's
extend.Per-app config can then point at the shared file and only override what differs:
With the layout from the docs:
Semantics: the child replaces keys wholesale, including
[[tool.towncrier.type]], so there is no list-merging to define.templateanddirectoryresolve relative to the file that sets them, which also addresses #641.Result:
towncrier create,buildandcheckrun from any app directory with no--config,--diror--version, and the type list lives in one place.Happy to discuss further. I have time to implement this, and would start with piece 1 as a standalone PR if that sounds acceptable.
All reactions