You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.rst
+11-5
Original file line number
Diff line number
Diff line change
@@ -51,13 +51,19 @@ The ``.gitignore`` will remain and keep Git from not tracking the directory.
51
51
Detecting Dates & Versions
52
52
--------------------------
53
53
54
-
``towncrier`` needs to know what version your project is, and there are two ways you can give it:
54
+
``towncrier`` needs to know what version your project is.
55
55
56
-
- For Python 2/3-compatible projects, a ``__version__`` in the top level package.
57
-
This can be either a string literal, a tuple, or an `Incremental <https://github.com/twisted/incremental>`_ version.
58
-
- Manually passing ``--version=<myversionhere>`` when interacting with ``towncrier``.
56
+
For Python projects, the version can be automatically determined in one of the following ways:
59
57
60
-
As an example, if your package doesn't have a ``__version__``, you can manually specify it when calling ``towncrier`` on the command line with the ``--version`` flag::
58
+
- if the project is installed, the version can be read from the package's metadata
59
+
- the version can be provided in a ``__version__`` attribute of the top level package (as a string literal, a tuple, or an `Incremental <https://github.com/twisted/incremental>`_ version)
60
+
61
+
For other projects, you can store the version in the ``towncrier.toml`` file::
62
+
63
+
[tool.towncrier]
64
+
version = "1.0.0"
65
+
66
+
If you don't want to store the version, you can manually pass ``--version=<myversionhere>`` whenever interacting with ``towncrier``. For example::
0 commit comments