Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Release v2.0.0 #1068

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
tags:
- '*.*.*'
env:
NEEDS_VERSION: 1.3.0
NEEDS_VERSION: 2.0.0

jobs:
build:
Expand Down
93 changes: 80 additions & 13 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,89 @@ License
-------

.. include:: ../LICENSE

2.0.0
-----
Released: under development

1.4.0

2.0.0
-----
Released: under development

* Improvement: Added Builder :ref:`needs_id_builder` added and config option :ref:`needs_build_json_per_id` in `conf.py`.
* Improvement: Reduce document build time, by memoizing the inline parse in ``build_need`` (`#968 <https://github.com/useblocks/sphinx-needs/pull/968>`_)
* Change `NeedsBuilder` format to `needs` (`#978 <https://github.com/useblocks/sphinx-needs/pull/978>`_)
* Improvement: Suffix all warnings with ``[needs]``, and allow them to be suppressed (`#975 <https://github.com/useblocks/sphinx-needs/pull/975>`_)
* Improvement: :ref:`needextend` for single needs is much faster.
* Improvement: General performance improvement (up to 50%) and less memory consumption (~40%).
* Improvement: external_needs is using cached templates to save generation time.
:Released: 13.11.2023
:Full Changelog: `1.3.0...v2.0.0 <https://github.com/useblocks/sphinx-needs/compare/1.3.0...faba19e>`__

This release is focussed on improving the internal code-base and its build time performance, as well as improved build warnings and other functionality improvements / fixes.

Changed
.......

* Add Sphinx 7 support and drop Python 3.7 (`#1056 <https://github.com/useblocks/sphinx-needs/pull/1056>`_).
Sphinx 5, 6, 7 and Python 3.8 to 3.11 are now fully supported and tested.
* The ``matplotlib`` dependency (for ``needbar`` and ``needpie`` plots) is now optional, and should be installed with ``sphinx-needs[plotting]``, see :ref:`installation` (`#1061 <https://github.com/useblocks/sphinx-needs/pull/1061>`_)
* The ``NeedsBuilder`` format name is changed to ``needs`` (`#978 <https://github.com/useblocks/sphinx-needs/pull/978>`_)

New
...

* Added Builder :ref:`needs_id_builder` and config option :ref:`needs_build_json_per_id` in ``conf.py`` (`#960 <https://github.com/useblocks/sphinx-needs/pull/960>`_)
* Added ``needs_reproducible_json`` config option for the needs builder, see :ref:`needs_build_json` (`#1065 <https://github.com/useblocks/sphinx-needs/pull/1065>`_)
* Added error messages for constraint failures (`#1036 <https://github.com/useblocks/sphinx-needs/pull/1036>`_)

Improved
........

Performance:

* General performance improvement (up to 50%) and less memory consumption (~40%).
* ``external_needs`` now uses cached templates to save generation time.
* Improved performance for :ref:`needextend` with single needs.
* Improved performance by memoizing the inline parse in ``build_need`` (`#968 <https://github.com/useblocks/sphinx-needs/pull/968>`_)
* Remove ``deepcopy`` of needs data (`#1033 <https://github.com/useblocks/sphinx-needs/pull/1033>`_)
* Optimize ``needextend`` filter_needs usage (`#1030 <https://github.com/useblocks/sphinx-needs/pull/1030>`_)
* Improve performance of needs builders by skipping document post-transforms (`#1054 <https://github.com/useblocks/sphinx-needs/pull/1054>`_)

Other:

* Improve sphinx warnings (`#975 <https://github.com/useblocks/sphinx-needs/pull/975>`_, `#982 <https://github.com/useblocks/sphinx-needs/pull/982>`_)
All warnings are now suffixed with ``[needs]``, and can be suppressed (see `suppress_warnings <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-suppress_warnings>`_)
* Improve logging for static file copies (`#992 <https://github.com/useblocks/sphinx-needs/pull/992>`_)
* Improve removal of hidden need nodes (`#1013 <https://github.com/useblocks/sphinx-needs/pull/1013>`_)
* Improve ``process_constraints`` function (`#1015 <https://github.com/useblocks/sphinx-needs/pull/1015>`_)
* Allow ``needextend`` directive to use dynamic functions (`#1052 <https://github.com/useblocks/sphinx-needs/pull/1052>`_)
* Remove some unnecessary keys from output ``needs.json`` (`#1053 <https://github.com/useblocks/sphinx-needs/pull/1053>`_)

Fixed
.....

* Fix gantt chart rendering (`#984 <https://github.com/useblocks/sphinx-needs/pull/984>`_)
* Fix ``execute_func`` (`#994 <https://github.com/useblocks/sphinx-needs/pull/994>`_)
* Fix adding sections to hidden needs (`#995 <https://github.com/useblocks/sphinx-needs/pull/995>`_)
* Fix ``NeedImport`` logic (`#1006 <https://github.com/useblocks/sphinx-needs/pull/1006>`_)
* Fix creation of need title nodes (`#1008 <https://github.com/useblocks/sphinx-needs/pull/1008>`_)
* Fix logic for ``process_needextend`` function (`#1037 <https://github.com/useblocks/sphinx-needs/pull/1037>`_)
* Fix usage of reST syntax in prefix parameter of meta (`#1046 <https://github.com/useblocks/sphinx-needs/pull/1046>`_)

Internal
........

* 🔧 Centralise access to sphinx-needs config to ``NeedsSphinxConfig`` (`#998 <https://github.com/useblocks/sphinx-needs/pull/998>`_)
* 🔧 Centralise sphinx ``env`` data access to ``SphinxNeedsData`` (`#987 <https://github.com/useblocks/sphinx-needs/pull/987>`_)
* 🔧 Consolidate needs data post-processing into ``post_process_needs_data`` function (`#1039 <https://github.com/useblocks/sphinx-needs/pull/1039>`_)
* 🔧 Add strict type checking (`#1000 <https://github.com/useblocks/sphinx-needs/pull/1000>`_, `#1002 <https://github.com/useblocks/sphinx-needs/pull/1002>`_, `#1042 <https://github.com/useblocks/sphinx-needs/pull/1042>`)
* 🔧 Replace ``Directive`` with ``SphinxDirective`` (`#986 <https://github.com/useblocks/sphinx-needs/pull/986>`_)
* 🔧 Remove ``unwrap`` function (`#1017 <https://github.com/useblocks/sphinx-needs/pull/1017>`_)
* 🔧 Add ``remove_node_from_tree`` utility function (`#1063 <https://github.com/useblocks/sphinx-needs/pull/1063>`_)
* ♻️ Refactor needs post-processing function signatures (`#1040 <https://github.com/useblocks/sphinx-needs/pull/1040>`_)

* 📚 Simplify Sphinx-Needs docs builds (`#972 <https://github.com/useblocks/sphinx-needs/pull/972>`_)
* 📚 Always use headless plantuml (`#983 <https://github.com/useblocks/sphinx-needs/pull/983>`_)
* 📚 Add intersphinx (`#991 <https://github.com/useblocks/sphinx-needs/pull/991>`_)
* 📚 Add outline of extension logic (`#1012 <https://github.com/useblocks/sphinx-needs/pull/1012>`_)
* 📚 Fixed extra links example (`#1016 <https://github.com/useblocks/sphinx-needs/pull/1016>`_)

* 🧪 Remove boilerplate from test build ``conf.py`` files (`#989 <https://github.com/useblocks/sphinx-needs/pull/989>`_, `#990 <https://github.com/useblocks/sphinx-needs/pull/990>`_)
* 🧪 Add headless java to test builds (`#988 <https://github.com/useblocks/sphinx-needs/pull/988>`_)
* 🧪 Add snapshot testing (`#1019 <https://github.com/useblocks/sphinx-needs/pull/1019>`_, `#1020 <https://github.com/useblocks/sphinx-needs/pull/1020>`_, `#1059 <https://github.com/useblocks/sphinx-needs/pull/1059>`_)
* 🧪 Make documentation builds fail on warnings (`#1005 <https://github.com/useblocks/sphinx-needs/pull/1005>`_)
* 🧪 Add testing of JS scripts using Cypress integrated into PyTest (`#1051 <https://github.com/useblocks/sphinx-needs/pull/1051>`_)
* 🧪 Add code coverage to CI testing (`#1067 <https://github.com/useblocks/sphinx-needs/pull/1067>`_)

1.3.0
-----
Expand Down
20 changes: 2 additions & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,15 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from typing import Any, Dict, List

from sphinx.application import Sphinx

sys.path.append(os.path.abspath("../sphinxcontrib"))
from sphinx_needs import __version__

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "1.3"
# The full version, including alpha/beta/rc tags.
release = "1.3.0"
version = release = __version__

extensions = [
"sphinx.ext.intersphinx",
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _installation:

Installation
============

Expand Down
11 changes: 9 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ def pre_commit(session):
session.run("pre-commit", "run", "--all-files", *session.posargs, external=True)


@session(python="3.10")
@session(python="3.11")
def linkcheck(session):
session.install(".[docs]")
with session.chdir("docs"):
session.run("sphinx-build", "-b", "linkcheck", ".", "_build", *session.posargs, external=True)
session.run("sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *session.posargs, external=True)


@session(python="3.11")
def docs(session):
session.install(".[docs]")
with session.chdir("docs"):
session.run("sphinx-build", ".", "_build", *session.posargs, external=True)
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "sphinx-needs"

# !! Don't miss updates in needs.py, conf.py, changelog.rst, and .github/workflows/docker !!!
version = "1.3.0"
# !! Don't miss updates in sphinx_needs.__version__, changelog.rst, and .github/workflows/docker !!!
version = "2.0.0"

description = "Sphinx needs extension for managing needs/requirements and specifications"
authors = ["team useblocks <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from sphinx_needs.needs import setup # noqa: F401
from sphinx_needs.needs import __version__, setup # noqa: F401
2 changes: 1 addition & 1 deletion sphinx_needs/needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
from sphinx_needs.utils import INTERNALS, NEEDS_FUNCTIONS, node_match
from sphinx_needs.warnings import process_warnings

VERSION = "1.3.0"
__version__ = VERSION = "2.0.0"
NEEDS_FUNCTIONS.clear()

_NODE_TYPES_T = Dict[Type[nodes.Element], Callable[[Sphinx, nodes.document, str, List[nodes.Element]], None]]
Expand Down