Skip to content

Commit

Permalink
Release 22.12.0 (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Dec 21, 2022
1 parent 3859e58 commit ca12ad5
Show file tree
Hide file tree
Showing 30 changed files with 59 additions and 26 deletions.
45 changes: 45 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,51 @@

.. towncrier release notes start
towncrier 22.12.0 (2022-12-21)
==============================

No changes since the previous release candidate.


towncrier 22.12.0rc1 (2022-12-20)
=================================

Features
--------

- Added ``--keep`` option to the ``build`` command that allows generating a newsfile, but keeps the newsfragments in place.
This option can not be used together with ``--yes``. (`#129 <https://github.com/hawkowl/towncrier/issues/129>`_)
- Python 3.11 is now officially supported. (`#427 <https://github.com/hawkowl/towncrier/issues/427>`_)
- You can now create fragments that are not associated with issues. Start the name of the fragment with ``+`` (e.g. ``+anything.feature``).
The content of these orphan news fragments will be included in the release notes, at the end of the category corresponding to the file extension.

To help quickly create a unique orphan news fragment, ``towncrier create +.feature`` will append a random string to the base name of the file, to avoid name collisions. (`#428 <https://github.com/hawkowl/towncrier/issues/428>`_)


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

- Improved contribution documentation. (`#415 <https://github.com/hawkowl/towncrier/issues/415>`_)
- Correct a typo in the readme that incorrectly documented custom fragments in a format that does not work. (`#424 <https://github.com/hawkowl/towncrier/issues/424>`_)
- The documentation has been restructured and (hopefully) improved. (`#435 <https://github.com/hawkowl/towncrier/issues/435>`_)
- Added a Markdown-based how-to guide. (`#436 <https://github.com/hawkowl/towncrier/issues/436>`_)
- Defining custom fragments using a TOML array is not deprecated anymore. (`#438 <https://github.com/hawkowl/towncrier/issues/438>`_)


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

- Default branch for `towncrier check` is now "origin/main" instead of "origin/master".
If "origin/main" does not exist, fallback to "origin/master" with a deprecation warning. (`#400 <https://github.com/hawkowl/towncrier/issues/400>`_)


Misc
----

- `#406 <https://github.com/hawkowl/towncrier/issues/406>`_, `#408 <https://github.com/hawkowl/towncrier/issues/408>`_, `#411 <https://github.com/hawkowl/towncrier/issues/411>`_, `#412 <https://github.com/hawkowl/towncrier/issues/412>`_, `#413 <https://github.com/hawkowl/towncrier/issues/413>`_, `#414 <https://github.com/hawkowl/towncrier/issues/414>`_, `#416 <https://github.com/hawkowl/towncrier/issues/416>`_, `#418 <https://github.com/hawkowl/towncrier/issues/418>`_, `#419 <https://github.com/hawkowl/towncrier/issues/419>`_, `#421 <https://github.com/hawkowl/towncrier/issues/421>`_, `#429 <https://github.com/hawkowl/towncrier/issues/429>`_, `#430 <https://github.com/hawkowl/towncrier/issues/430>`_, `#431 <https://github.com/hawkowl/towncrier/issues/431>`_, `#434 <https://github.com/hawkowl/towncrier/issues/434>`_, `#446 <https://github.com/hawkowl/towncrier/issues/446>`_, `#447 <https://github.com/hawkowl/towncrier/issues/447>`_


towncrier 22.8.0 (2022-08-29)
=============================

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ignore_missing_imports = true
requires = [
"setuptools ~= 44.1.1",
"wheel ~= 0.36.2",
"incremental == 17.5.0",
"incremental == 22.10.0",
]
build-backend = "setuptools.build_meta"

Expand Down
12 changes: 8 additions & 4 deletions src/towncrier/_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from importlib import import_module
from types import ModuleType

from incremental import Version
from incremental import Version as IncrementalVersion


def _get_package(package_dir: str, package: str) -> ModuleType:
Expand Down Expand Up @@ -50,8 +50,12 @@ def get_version(package_dir: str, package: str) -> str:
if isinstance(version, str):
return version.strip()

if isinstance(version, Version):
return version.base().strip()
if isinstance(version, IncrementalVersion):
# FIXME:https://github.com/twisted/incremental/issues/81
# Incremental uses `.rcN`.
# importlib uses `rcN` (without a dot separation).
# Here we make incremental work like importlib.
return version.base().strip().replace(".rc", "rc")

if isinstance(version, tuple):
return ".".join(map(str, version)).strip()
Expand All @@ -76,7 +80,7 @@ def get_project_name(package_dir: str, package: str) -> str:
if isinstance(version, str):
return package.title()

if isinstance(version, Version):
if isinstance(version, IncrementalVersion):
# Incremental has support for package names
return version.package

Expand Down
2 changes: 1 addition & 1 deletion src/towncrier/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
from incremental import Version


__version__ = Version("towncrier", 22, 8, 1, dev=0)
__version__ = Version("towncrier", 22, 12, 1, dev=0)
__all__ = ["__version__"]
2 changes: 0 additions & 2 deletions src/towncrier/newsfragments/129.feature

This file was deleted.

2 changes: 0 additions & 2 deletions src/towncrier/newsfragments/400.removal

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/415.doc

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/424.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/427.feature

This file was deleted.

4 changes: 0 additions & 4 deletions src/towncrier/newsfragments/428.feature

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions src/towncrier/newsfragments/430.misc

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/435.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/436.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/438.doc

This file was deleted.

Empty file.
Empty file.
8 changes: 4 additions & 4 deletions src/towncrier/test/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


try:
from importlib.metadata import version
from importlib.metadata import version as metadata_version
except ImportError:
version = None
metadata_version = None


class VersionFetchingTests(TestCase):
Expand Down Expand Up @@ -48,14 +48,14 @@ def test_tuple(self):
version = get_version(temp, "mytestproja")
self.assertEqual(version, "1.3.12")

@skipIf(version is None, "Needs importlib.metadata.")
@skipIf(metadata_version is None, "Needs importlib.metadata.")
def test_incremental(self):
"""
An incremental Version __version__ is picked up.
"""
pkg = "../src"

self.assertEqual(version("towncrier"), get_version(pkg, "towncrier"))
self.assertEqual(metadata_version("towncrier"), get_version(pkg, "towncrier"))
self.assertEqual("towncrier", get_project_name(pkg, "towncrier"))

def _setup_missing(self):
Expand Down

0 comments on commit ca12ad5

Please sign in to comment.