Skip to content

Commit 3b8a280

Browse files
authored
πŸš€ Release v5.0.0 (#1404)
1 parent 98c630f commit 3b8a280

File tree

3 files changed

+96
-3
lines changed

3 files changed

+96
-3
lines changed

β€Ž.github/workflows/docker.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
paths: ['docker/**']
1717

1818
env:
19-
NEEDS_VERSION: 4.2.0
19+
NEEDS_VERSION: 5.0.0
2020
DEPLOY_IMAGE: ${{ github.event_name != 'pull_request' }}
2121

2222
jobs:

β€Ždocs/changelog.rstβ€Ž

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,104 @@
33
Changelog
44
=========
55

6+
5.0.0
7+
-----
8+
9+
:Released: 18.02.2025
10+
:Full Changelog: `v4.1.0...v5.0.0 <https://github.com/useblocks/sphinx-needs/compare/4.2.0...98c630fca17f9575d86b6b1df7714263ae731425>`__
11+
12+
This release includes a number of changes,
13+
to bring more clarity to the needs data structure and post-processing steps.
14+
In most cases it should not be breaking,
15+
but may be in some corner cases.
16+
17+
- ✨ Add ``c.this_doc()`` check for use in directive ``:filter:`` option :pr:`1393` and :pr:`1405`
18+
19+
This allows for filtering of needs only in the same document as the
20+
directive itself, e.g.
21+
22+
.. code-block:: rst
23+
24+
.. needextend:: c.this_doc() and status is None
25+
:status: open
26+
27+
This works for all common filtered directives, see :ref:`filter_current_page`
28+
29+
- ♻️ Remove ``full_title`` need field and only trim generated titles :pr:`1407`
30+
31+
The existence of both ``title`` and ``full_title`` is confusing and unnecessary (in most cases these are equal), and so ``full_title`` is removed.
32+
33+
Trimming (when :ref:`needs_max_title_length` is set) is now only applied to auto-generated titles,
34+
as per the documentation in :ref:`needs_title_from_content`
35+
36+
- ♻️ Make ``needextend`` argument declarative :pr:`1391`
37+
38+
The argument for ``needextend`` can refer to either a single need ID or
39+
filter function.
40+
Currently, the format cannot be known until all needs have been
41+
processed, and it is resolved during post-processing.
42+
This is problematic for (a) user readability, (b) improving processing
43+
performance and issue feedback
44+
45+
This PR slightly modifies the argument processing to allow for two
46+
"explicit" formats:
47+
48+
- ``<ID>``, if the argument is enclosed in ``<>`` it is always processed as a single ID
49+
- ``"filter string"``, if the argument is enclosed in ``""`` it is always processed as a filter string
50+
51+
See :ref:`needextend` for more information.
52+
53+
- ♻️ Remove back link manipulation from ``needextend`` :pr:`1386`
54+
55+
Back links are computed at the end of the need post-processing, after
56+
``needextend`` have been applied.
57+
58+
Back links should always be in-sync with forward links, therefore it
59+
doesn't make sense to modify back links in this way.
60+
61+
- ♻️ Do not process dynamic functions on internal need fields :pr:`1387` and :pr:`1406`
62+
63+
For most "internal" need fields it does not make sense that these would
64+
be dynamic, and anyway this would fail since their values are not string
65+
types.
66+
67+
Dynamic function processing is now skipped, for core fields that
68+
should not be altered by the user.
69+
The following fields are allowed to contain dynamic functions:
70+
71+
- ``status``
72+
- ``tags``
73+
- ``style``
74+
- ``constraints``
75+
- all ``needs_extra_options``
76+
- all ``needs_extra_links``
77+
- all ``needs_global_options``
78+
79+
- ♻️ Remove ``delete`` from internal needs and ``needs.json`` :pr:`1347`
80+
81+
The ``:delete:`` option on a need directive deletes a need before
82+
creating/storing it, therefore it is impossible for it to be
83+
anything other than ``False``.
84+
Storing the field on a need is misleading, because it suggests that the
85+
need will be deleted, which is not possible with the current sphinx-needs logic.
86+
87+
- πŸ‘Œ Add type warnings of extra options in external/import reads :pr:`1389`
88+
89+
Currently, the value of all extra options is expected to be a string;
90+
other types are not supported in various aspects of sphinx-needs (such
91+
as ``needextend``, dynamic functions and filtering), and in-fact are
92+
already silently converted to strings during the reads.
93+
94+
The warnings ``needs.mistyped_external_values`` and ``needs.mistyped_import_values`` are added for non-string values,
95+
for ``needs_external_needs`` and ``needimport`` sources respectively.
96+
97+
- πŸ”§ Synchronize list splitting behaviour in ``need`` and ``needextend`` directives :pr:`1385`
98+
699
4.2.0
7100
-----
8101

9102
:Released: 07.01.2025
10-
:Full Changelog: `v4.1.0...v4.2.0 <https://github.com/useblocks/sphinx-needs/compare/4.1.0...1114e72c011e77524f332eddcc9621fefd4ddbdf>`__
103+
:Full Changelog: `v4.1.0...v4.2.0 <https://github.com/useblocks/sphinx-needs/compare/4.1.0...4.2.0>`__
11104

12105
- ⬆️ Drop Python 3.8 and Sphinx 6
13106
- ✨ Add :ref:`needs_import_keys` configuration :pr:`1379`

β€Žsphinx_needs/__init__.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Sphinx needs extension for managing needs/requirements and specifications"""
22

3-
__version__ = "4.2.0"
3+
__version__ = "5.0.0"
44

55

66
def setup(app): # type: ignore[no-untyped-def]

0 commit comments

Comments
Β (0)