Repository navigation
Conversation
In a specification 2 repository.toml, the towncrier table is now shared by [repository.towncrier] and every [[package]], with the keys settings and section and different defaults per location. In a package the table is optional: settings defaults to the towncrier.toml or pyproject.toml found in the package path, in towncrier's own lookup order, and section to the package name. The flat towncrier_settings and section keys are rejected with a message naming their replacement. In the repository, the table being present turns the repository-level news fragments on, with towncrier.toml and Project as defaults; enabled is no longer accepted. Unknown keys and empty values are errors in both places, so a typo cannot silently fall back to a default. settings migrate writes the dotted form, drops enabled, and removes a [repository.towncrier] table that named no settings file, since specification 1 treated it as off. Specification 1 files are read as before. The schema copy published by pytest-jsonschema 1.1.0 predates the table, so the checks against it are strict xfails until a release carries the change.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #112
In a specification 2
repository.toml, Towncrier options live in atowncriertable, shared by[repository.towncrier]and every[[package]]. Only 2.0.0a1 has shipped specification 2, so the flat keys are replaced outright.settingsdefaultsectiondefault[[package]]towncrier.toml, elsepyproject.toml, in the package path (towncrier's own lookup order)[repository.towncrier]towncrier.toml"Project"Validation
At load time, with the package named in the message:
towncrier_settingsandsectionon a package are rejected, and the message gives the new spelling.enabledin[repository.towncrier]is rejected.The schema now has one shared
towncrierdefinition.settings migratetowncrier.settings/towncrier.sectionas dotted keys and leaves out empty values.enabled.[repository.towncrier]table that named no settings file. Specification 1 treated it as off, and keeping it would turn it on.Specification 1 files are read as before.
pytest-jsonschema
The schema copy published by pytest-jsonschema 1.1.0 predates the table. The checks against it are strict xfails, and the test pinning how the two copies differ now covers both pending changes. A follow-up PR there will update the published schema.
Testing
make lintis clean.tests/settings/test_towncrier.py(76 tests) and 16 migrate cases.