Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into remove-incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Jul 28, 2024
2 parents aa5e214 + a5a51b1 commit a037030
Show file tree
Hide file tree
Showing 70 changed files with 2,630 additions and 911 deletions.
50 changes: 45 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: hynek/build-and-inspect-python-package@f336040a31ea03a2551adcc994d3ddb2f3ea3f7f
- uses: hynek/build-and-inspect-python-package@f51d0e79a34e62af977fcfe458b41fa8490e6e65

- name: Set up ${{ matrix.python.name }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Keep list in-sync with noxfile/tests & pyproject.toml.
python:
- name: CPython 3.8
action: 3.8
Expand All @@ -68,6 +69,8 @@ jobs:
action: '3.10'
- name: CPython 3.11
action: '3.11'
- name: CPython 3.12
action: '3.12'
- name: PyPy 3.8
action: pypy3.8
task:
Expand All @@ -87,6 +90,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.action }}
allow-prereleases: true
cache: pip

- name: Install dependencies
run: python -m pip install --upgrade pip nox
Expand Down Expand Up @@ -155,10 +160,12 @@ jobs:
python-version: '3.11'
task:
- name: Check Newsfragment
nox: check_newsfragment
run: |
nox -e check_newsfragment
nox -e draft_newsfragment >> $GITHUB_STEP_SUMMARY
run-if: ${{ github.head_ref != 'pre-commit-ci-update-config' }}
- name: Check mypy
nox: typecheck
run: nox -e typecheck
run-if: true

steps:
Expand All @@ -182,10 +189,42 @@ jobs:

- uses: twisted/python-info-action@v1

- run: nox -e ${{ matrix.task.nox }}
- name: Check
run: |
${{ matrix.task.run }}
if: ${{ matrix.task.run-if }}


pre-commit:
name: Check pre-commit integration
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: python -m pip install pre-commit

- name: Install pre-commit
run: |
pre-commit install
- name: Update pre-commit
run: |
pre-commit autoupdate
- name: Run pre-commit
run: |
pre-commit run -a
pypi-publish:
name: Check tag and publish
# Only trigger this for tag changes.
Expand Down Expand Up @@ -252,7 +291,7 @@ jobs:
python -Im coverage html --skip-covered --skip-empty
# Report and write to summary.
python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
# Report again and fail if under 100%.
python -Im coverage report --fail-under=100
Expand Down Expand Up @@ -283,6 +322,7 @@ jobs:
- test-windows
- coverage
- check
- pre-commit
steps:
- name: Require all successes
uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.vs/
.vscode
Justfile
*egg-info/
_trial_temp*/
apidocs/
dist/
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
additional_dependencies: [toml]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-toml
- id: check-yaml

- repo: https://github.com/twisted/towncrier
rev: 23.11.0
hooks:
- id: towncrier-check
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ build:
python: "3.11"

python:
system_packages: False
install:
- method: pip
path: .
Expand Down
66 changes: 65 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,70 @@ Release notes

.. towncrier release notes start
towncrier 23.11.0 (2023-11-08)
==============================

No significant changes since the previous release candidate.


Bugfixes
--------

- ``build`` now treats a missing fragments directory the same as an empty one, consistent with other operations. (`#538 <https://github.com/twisted/towncrier/issues/538>`_)
- Fragments with filenames like `fix-1.2.3.feature` are now associated with the issue `fix-1.2.3`.
In previous versions they were incorrectly associated to issue `3`. (`#562 <https://github.com/twisted/towncrier/issues/562>`_)
- Orphan newsfragments containing numeric values are no longer accidentally associated to issues. In previous versions the orphan marker was ignored and the newsfragment was associated to an issue having the last numerical value from the filename. (`#562 <https://github.com/twisted/towncrier/issues/562>`_)


Misc
----

- `#558 <https://github.com/twisted/towncrier/issues/558>`_, `#559 <https://github.com/twisted/towncrier/issues/559>`_


towncrier 23.10.0 (2023-10-24)
==============================

No significant changes since the previous release candidate.


Features
--------

- Python 3.12 is now officially supported. (`#541 <https://github.com/twisted/towncrier/issues/541>`_)
- 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. (`#548 <https://github.com/twisted/towncrier/issues/548>`_)
- Two newlines are no longer always added between the current release notes and the previous content.
The newlines are now defined only inside the template.

**Important! If you're using a custom template and want to keep the same whitespace between releases, you may have to modify your template.** (`#552 <https://github.com/twisted/towncrier/issues/552>`_)


Bugfixes
--------

- Towncrier now vendors the click-default-group package that prevented installations on modern Pips. (`#540 <https://github.com/twisted/towncrier/issues/540>`_)


Improved Documentation
----------------------

- The markdown docs now use the default markdown template rather than a simpler custom one. (`#545 <https://github.com/twisted/towncrier/issues/545>`_)
- Cleanup a duplicate backtick in the tutorial. (`#551 <https://github.com/twisted/towncrier/issues/551>`_)


Deprecations and Removals
-------------------------

- The support for Python 3.7 has been dropped. (`#521 <https://github.com/twisted/towncrier/issues/521>`_)


Misc
----

- `#481 <https://github.com/twisted/towncrier/issues/481>`_, `#520 <https://github.com/twisted/towncrier/issues/520>`_, `#522 <https://github.com/twisted/towncrier/issues/522>`_, `#523 <https://github.com/twisted/towncrier/issues/523>`_, `#529 <https://github.com/twisted/towncrier/issues/529>`_, `#536 <https://github.com/twisted/towncrier/issues/536>`_


towncrier 23.6.0 (2023-06-06)
=============================

Expand Down Expand Up @@ -184,7 +248,7 @@ towncrier 21.3.0.rc1 (2021-03-21)
Features
--------

- Ticket number from file names will be stripped down to avoid ticket links such as ``#007``. (`#126 <https://github.com/twisted/towncrier/issues/126>`_)
- Issue number from file names will be stripped down to avoid issue links such as ``#007``. (`#126 <https://github.com/twisted/towncrier/issues/126>`_)
- Allow definition of the project ``version`` and ``name`` in the configuration file.
This allows use of towncrier seamlessly with non-Python projects. (`#165 <https://github.com/twisted/towncrier/issues/165>`_)
- Improve news fragment file name parsing to allow using file names like
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Philosophy
That is, by duplicating what has changed from the "developer log" (which may contain complex information about the original issue, how it was fixed, who authored the fix, and who reviewed the fix) into a "news fragment" (a small file containing just enough information to be useful to end users), ``towncrier`` can produce a digest of the changes which is valuable to those who may wish to use the software.
These fragments are also commonly called "topfiles" or "newsfiles".

``towncrier`` works best in a development system where all merges involve closing a ticket.
``towncrier`` works best in a development system where all merges involve closing an issue.

To get started, check out our `tutorial <https://towncrier.readthedocs.io/en/latest/tutorial.html>`_!

Expand Down
27 changes: 21 additions & 6 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Create a new release candidate using `GitHub New release UI <https://github.com/
* *Choose a tag*: Type `19.9.0rc1` and select `Create new tag on publish.`
* *Target*: Search for the release branch and select it.
* *Title*: "Towncrier 19.9.0rc1".
* Set the content based on the NEWS file.
* Make sure to mark **This is a pre-release**.
* Set the content based on the NEWS file (for now in RST format).
* Make sure to check **This is a pre-release**.
* Click `Publish release`

This will trigger the PyPI release candidate.
Expand All @@ -52,6 +52,12 @@ The documentation link is also available as part of the standard Read The Docs P
Notify the release candidate over IRC or Gitter to gain more attention.
In the PR comments, you can also mention anyone who has asked for a release.

We don't create discussion for pre-releases.
Any discussions before the final release, can go on the PR itself.

For now, the GitHub release text is reStructuredText as it's easy to copy and paste.
In the future we might create a separate Markdown version.


Final release
--------------
Expand All @@ -64,7 +70,8 @@ In ``pyproject.toml`` the version is set like::
version = "19.9.0"

Manually update the `NEWS.rst` file to include the final release version and date.
Usually it will look like this::
Usually it will look like this.
This will replace the release candidate section::

towncrier 19.9.0 (2019-09-29)
=============================
Expand All @@ -81,8 +88,9 @@ Similar to the release candidate, with the difference:
* tag will be named `19.9.0`
* the target is the same branch
* Title will be `towncrier 19.0.0`
* Content can be the content of the final release and the release candidates.
* Don't mark **This is a pre-release**.
* Content can be the content of the final release (RST format).
* Check **Set as the latest release**.
* Check **Create a discussion for this release**.
* Click `Publish release`

No need for another review request.
Expand All @@ -94,7 +102,14 @@ In ``pyproject.toml`` the version is set like::

Commit and push the changes.

Merge the commit in the main branch.
Merge the commit in the main branch, **without using squash**.

We tag the release based on a commit from the release branch.
If we merge with squash,
the release tag commit will no longer be found in the main branch history.
With a squash merge, the whole branch history is lost.
This causes the `pre-commit autoupdate` to fail.
See `PR590 <https://github.com/twisted/towncrier/pull/590>`_ for more details.

You can announce the release over IRC or Gitter.

Expand Down
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

The twisted/towncrier project uses the same security policy as [twisted/twisted](https://github.com/twisted/twisted).

For more details, please check the [Twisted security process](https://github.com/twisted/twisted?tab=security-ov-file#readme).
32 changes: 29 additions & 3 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The following options can be passed to all of the commands that explained below:

.. option:: --dir PATH

Build fragment in ``PATH``.
The command is executed relative to ``PATH``.
For instance with the default config news fragments are checked and added in ``PATH/newsfragments`` and the news file is built in ``PATH/NEWS.rst``.

Default: current directory.

Expand All @@ -23,6 +24,14 @@ The following options can be passed to all of the commands that explained below:
Build the combined news file from news fragments.
``build`` is also assumed if no command is passed.

If there are no news fragments (including an empty fragments directory or a
non-existent directory), a notice of "no significant changes" will be added to
the news file.

By default, the processed news fragments are removed. For any fragments
committed in your git repository, git rm will be used (which will also remove
the fragments directory if now empty).

.. option:: --draft

Only render news fragments to standard output.
Expand Down Expand Up @@ -64,19 +73,36 @@ Create a news fragment in the directory that ``towncrier`` is configured to look

$ towncrier create 123.bugfix.rst

If you don't provide a file name, ``towncrier`` will prompt you for one.

``towncrier create`` will enforce that the passed type (e.g. ``bugfix``) is valid.

If the fragments directory does not exist, it will be created.

If the filename exists already, ``towncrier create`` will add (and then increment) a number after the fragment type until it finds a filename that does not exist yet.
In the above example, it will generate ``123.bugfix.1.rst`` if ``123.bugfix.rst`` already exists.

To create a news fragment not tied to a specific issue (which towncrier calls an "orphan fragment"), start the fragment name with a ``+``.
If that is the entire fragment name, a random hash will be added for you::

$ towncrier create +.feature.rst
$ ls newsfragments/
+fcc4dc7b.feature.rst

.. option:: --content, -c CONTENT

A string to use for content.
Default: an instructive placeholder.

.. option:: --edit
.. option:: --edit / --no-edit

Whether to start ``$EDITOR`` to edit the news fragment right away.
Default: ``$EDITOR`` will be started unless you also provided content.

.. option:: --section SECTION

Create file and start `$EDITOR` to edit it right away.`
The section to use for the news fragment.
Default: the section with no path, or if all sections have a path then the first defined section.


``towncrier check``
Expand Down
Loading

0 comments on commit a037030

Please sign in to comment.