Skip to content

Commit 218d8a1

Browse files
authored
Merge pull request #3989 from jobh/release-rst-example
Sample RELEASE.rst
2 parents 049ca7d + ff5a4c9 commit 218d8a1

File tree

6 files changed

+54
-3
lines changed

6 files changed

+54
-3
lines changed

CONTRIBUTING.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Just tell me how to make a pull request
1010

1111
1. Make your change and ensure it has adequate tests
1212
2. Create ``hypothesis-python/RELEASE.rst`` with ``RELEASE_TYPE: patch``
13-
for small bugfixes, or ``minor`` for new features. See recent PRs for examples.
13+
for small bugfixes, or ``minor`` for new features. See ``RELEASE-sample.rst``
14+
as an example.
1415
3. Add yourself to the list in ``AUTHORS.rst`` and open a PR!
1516

1617
For more detail, read on; for even more, continue to the ``guides/`` directory!

hypothesis-python/RELEASE-sample.rst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
RELEASE_TYPE: patch
2+
3+
This patch improves import-detection in :doc:`the Ghostwriter <ghostwriter>`
4+
(:issue:`3884`), particularly for :func:`~hypothesis.strategies.from_type`
5+
and strategies from ``hypothesis.extra.*``.
6+
7+
Thanks to <contributor's name or handle> for this <contribution/fix/feature>!
8+
9+
---
10+
11+
In the example above, "patch" on the first line should be replaced by
12+
"minor" if changes are visible in the public API, or "major" if there are
13+
breaking changes. Note that only maintainers should ever make a major
14+
release.
15+
16+
The remaining lines are the actual changelog text for this release,
17+
which should:
18+
19+
- concisely describe what changed _in the public API_, and why.
20+
Internal-only changes can be documented as e.g. "This release improves
21+
an internal invariant." (the complete changelog for version 6.99.11)
22+
- use ``double backticks`` for verbatim code,
23+
- use Sphinx cross-references to any functions or classes mentioned:
24+
- :pypi:`package` for links to external packages,
25+
- :func:`package.function` for link to functions, where the link text will
26+
be ``package.function``, or :func:`~package.function` to show ``function``,
27+
- :class:`package.class` for link to classes (abbreviated as above),
28+
- :issue:`issue-number` for referencing issues,
29+
- :doc:`link text <chapter#anchor>` for documentation references
30+
(``https://hypothesis.readthedocs.io/en/latest/<chapter>.html#<anchor>``)
31+
- finish with a note of thanks from the maintainers. If this is your first
32+
contribution, don't forget to add yourself to AUTHORS.rst!
33+
34+
After the PR is merged, the contents of this file (except the first line)
35+
are automatically added to ``docs/changes.rst``. More examples can be found
36+
in that file.

hypothesis-python/RELEASE.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RELEASE_TYPE: patch
2+
3+
Internal developer documentation, no user-visible changes.

tooling/src/hypothesistooling/projects/hypothesispython.py

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
DOMAINS_LIST = PYTHON_SRC / "hypothesis" / "vendor" / "tlds-alpha-by-domain.txt"
3333

3434
RELEASE_FILE = HYPOTHESIS_PYTHON / "RELEASE.rst"
35+
RELEASE_SAMPLE_FILE = HYPOTHESIS_PYTHON / "RELEASE-sample.rst"
3536

3637
assert PYTHON_SRC.exists()
3738

@@ -52,6 +53,10 @@ def has_release():
5253
return RELEASE_FILE.exists()
5354

5455

56+
def has_release_sample():
57+
return RELEASE_SAMPLE_FILE.exists()
58+
59+
5560
def parse_release_file():
5661
return rm.parse_release_file(RELEASE_FILE)
5762

whole_repo_tests/test_release_files.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ def test_release_file_exists_and_is_valid(project):
2020
if project.has_source_changes():
2121
assert project.has_release(), (
2222
"There are source changes but no RELEASE.rst. Please create "
23-
"one to describe your changes."
23+
"one to describe your changes. An example can be found in "
24+
"RELEASE-sample.rst."
25+
)
26+
assert project.has_release_sample(), (
27+
"The RELEASE-sample.rst file is missing. Please copy it "
28+
"to RELEASE.rst, rather than moving it."
2429
)
2530
rm.parse_release_file(project.RELEASE_FILE)
2631

whole_repo_tests/test_rst_is_valid.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def is_sphinx(f):
2323
ALL_RST = [
2424
f
2525
for f in tools.all_files()
26-
if os.path.basename(f) != "RELEASE.rst" and f.endswith(".rst")
26+
if os.path.basename(f) not in ["RELEASE.rst", "RELEASE-sample.rst"]
27+
and f.endswith(".rst")
2728
]
2829

2930

0 commit comments

Comments
 (0)