-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config location separate from directory containing news file and frag…
…ments (#548) * Build command supports multiple projects with one config The create command already supports this. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Full documented support for sharing config between multiple projects * Apply suggestions from code review Co-authored-by: Adi Roiban <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adi Roiban <[email protected]> Co-authored-by: Adi Roiban <[email protected]>
- Loading branch information
1 parent
3f24b6e
commit 0b023fa
Showing
10 changed files
with
226 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Narrative | |
|
||
tutorial | ||
markdown | ||
monorepo | ||
|
||
|
||
Reference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Multiple Projects Share One Config (Monorepo) | ||
============================================= | ||
|
||
Several projects may have independent release notes with the same format. | ||
For instance packages in a monorepo. | ||
Here's how you can use towncrier to set this up. | ||
|
||
Below is a minimal example: | ||
|
||
.. code-block:: text | ||
repo | ||
├── project_a | ||
│ ├── newsfragments | ||
│ │ └── 123.added | ||
│ ├── project_a | ||
│ │ └── __init__.py | ||
│ └── NEWS.rst | ||
├── project_b | ||
│ ├── newsfragments | ||
│ │ └── 120.bugfix | ||
│ ├── project_b | ||
│ │ └── __init__.py | ||
│ └── NEWS.rst | ||
└── towncrier.toml | ||
The ``towncrier.toml`` looks like this: | ||
|
||
.. code-block:: toml | ||
[tool.towncrier] | ||
# It's important to keep these config fields empty | ||
# because we have more than one package/name to manage. | ||
package = "" | ||
name = "" | ||
Now to add a fragment: | ||
|
||
.. code-block:: console | ||
towncrier create --config towncrier.toml --dir project_a 124.added | ||
This should create a file at ``project_a/newsfragments/124.added``. | ||
|
||
To build the news file for the same project: | ||
|
||
.. code-block:: console | ||
towncrier build --config towncrier.toml --dir project_a --version 1.5 | ||
Note that we must explicitly pass ``--version``, there is no other way to get the version number. | ||
The ``towncrier.toml`` can only contain one version number and the ``package`` field is of no use for the same reason. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Initial support was added for monorepo-style setup. | ||
One project with multiple independent news files stored in separate sub-directories, that share the same towncrier config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters