Skip to content

Commit

Permalink
Merge branch 'master' into fix/issue_1099_needs_id_regex_on_external_…
Browse files Browse the repository at this point in the history
…needs
  • Loading branch information
David-Le-Nir authored Feb 26, 2024
2 parents 48d6b58 + cf5598f commit be3f6fe
Show file tree
Hide file tree
Showing 265 changed files with 9,034 additions and 3,356 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Update pip
Expand All @@ -22,7 +22,7 @@ jobs:
run: pytest --benchmark-json output.json -k _time tests/benchmarks

- name: Download previous benchmark data
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1

tests-core:
name: "Core py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}"
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Install Cypress Test Framework
run: npm install cypress
- name: Set Up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
Expand All @@ -97,7 +97,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Update pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Update pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set Up Python 3.10.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.8
- name: Use Node.js
Expand All @@ -23,7 +23,7 @@ jobs:
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Pip cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install Poetry
run: python -m pip install poetry
- name: poetry build
run: poetry build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: poetry_build
path: dist/
Expand All @@ -30,10 +30,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: poetry_build
path: dist/
Expand All @@ -57,10 +57,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: poetry_build
path: dist/
Expand Down
36 changes: 9 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
repos:
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- pep8-naming

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: pyupgrade
args:
- --py36-plus
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.8.0
hooks:
- id: mypy
files: sphinx_needs/.*
args: []
additional_dependencies:
- sphinx==6
- types-docutils
- sphinx==6.2.1
- docutils==0.19
- types-docutils==0.20.0.20240201
- types-jsonschema
- types-requests

Expand Down
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 80%
threshold: 0.5%
patch:
default:
target: 70%
threshold: 0.5%
112 changes: 93 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

nitpicky = True
nitpick_ignore = [
("py:class", "docutils.nodes.Node"),
("py:class", "docutils.parsers.rst.states.RSTState"),
("py:class", "T"),
("py:class", "sphinx_needs.debug.T"),
("py:class", "sphinx_needs.data.NeedsInfoType"),
Expand All @@ -55,7 +57,9 @@
needs_debug_measurement = True

add_module_names = False # Used to shorten function name output
autodoc_docstring_signature = True # Used to read spec. func-defs from docstring (e.g. get rid of self)
autodoc_docstring_signature = (
True # Used to read spec. func-defs from docstring (e.g. get rid of self)
)

NOTE_TEMPLATE = """
.. _{{id}}:
Expand All @@ -80,17 +84,15 @@
{% endif %}
"""

DEFAULT_DIAGRAM_TEMPLATE = (
"<size:12>{{type_name}}</size>\\n**{{title|wordwrap(15, wrapstring='**\\\\n**')}}**\\n<size:10>{{id}}</size>"
)
DEFAULT_DIAGRAM_TEMPLATE = "<size:12>{{type_name}}</size>\\n**{{title|wordwrap(15, wrapstring='**\\\\n**')}}**\\n<size:10>{{id}}</size>"

# You can uncomment some of the following lines to override the default configuration for Sphinx-Needs.
# needs_diagram_template = DEFAULT_DIAGRAM_TEMPLATE

# Absolute path to the needs_report_template_file based on the conf.py directory
# needs_report_template = "/needs_templates/report_template.need" # Use custom report template

needs_report_dead_links = False
suppress_warnings = ["needs.link_outgoing"]

needs_types = [
# Architecture types
Expand All @@ -110,16 +112,71 @@
"color": "#BFD8D2",
"style": "card",
},
{"directive": "sys", "title": "System", "content": "plantuml", "prefix": "S_", "color": "#BFD8D2", "style": "card"},
{
"directive": "sys",
"title": "System",
"content": "plantuml",
"prefix": "S_",
"color": "#BFD8D2",
"style": "card",
},
# Normal types
{"directive": "req", "title": "Requirement", "prefix": "R_", "color": "#BFD8D2", "style": "node"},
{"directive": "spec", "title": "Specification", "prefix": "S_", "color": "#FEDCD2", "style": "node"},
{"directive": "impl", "title": "Implementation", "prefix": "I_", "color": "#DF744A", "style": "node"},
{"directive": "test", "title": "Test Case", "prefix": "T_", "color": "#DCB239", "style": "node"},
{"directive": "feature", "title": "Feature", "prefix": "F_", "color": "#FFCC00", "style": "node"},
{"directive": "user", "title": "User", "prefix": "U_", "color": "#777777", "style": "node"},
{"directive": "action", "title": "Action", "prefix": "A_", "color": "#FFCC00", "style": "node"},
{"directive": "milestone", "title": "Milestone", "prefix": "M_", "color": "#FF3333", "style": "node"},
{
"directive": "req",
"title": "Requirement",
"prefix": "R_",
"color": "#BFD8D2",
"style": "node",
},
{
"directive": "spec",
"title": "Specification",
"prefix": "S_",
"color": "#FEDCD2",
"style": "node",
},
{
"directive": "impl",
"title": "Implementation",
"prefix": "I_",
"color": "#DF744A",
"style": "node",
},
{
"directive": "test",
"title": "Test Case",
"prefix": "T_",
"color": "#DCB239",
"style": "node",
},
{
"directive": "feature",
"title": "Feature",
"prefix": "F_",
"color": "#FFCC00",
"style": "node",
},
{
"directive": "user",
"title": "User",
"prefix": "U_",
"color": "#777777",
"style": "node",
},
{
"directive": "action",
"title": "Action",
"prefix": "A_",
"color": "#FFCC00",
"style": "node",
},
{
"directive": "milestone",
"title": "Milestone",
"prefix": "M_",
"color": "#FF3333",
"style": "node",
},
]

needs_extra_links = [
Expand Down Expand Up @@ -208,7 +265,9 @@
needs_id_required = False
# needs_css = "dark.css"

local_plantuml_path = os.path.join(os.path.dirname(__file__), "utils", "plantuml-1.2022.14.jar")
local_plantuml_path = os.path.join(
os.path.dirname(__file__), "utils", "plantuml-1.2022.14.jar"
)
plantuml = f"java -Djava.awt.headless=true -jar {local_plantuml_path}"

# plantuml_output_format = 'png'
Expand Down Expand Up @@ -246,7 +305,10 @@
"grid": "simple_side_right_partial",
"layout": {
"head": ['**<<meta("title")>>** for *<<meta("author")>>*'],
"meta": ['**status**: <<meta("status")>>', '**author**: <<meta("author")>>'],
"meta": [
'**status**: <<meta("status")>>',
'**author**: <<meta("author")>>',
],
"side": ['<<image("_images/{{author}}.png", align="center")>>'],
},
},
Expand Down Expand Up @@ -450,14 +512,22 @@ def custom_defined_func():
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "needstestdocs.tex", "needs test docs Documentation", "team useblocks", "manual"),
(
master_doc,
"needstestdocs.tex",
"needs test docs Documentation",
"team useblocks",
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "needstestdocs", "needs test docs Documentation", [author], 1)]
man_pages = [
(master_doc, "needstestdocs", "needs test docs Documentation", [author], 1)
]

# -- Options for Texinfo output -------------------------------------------

Expand All @@ -478,7 +548,11 @@ def custom_defined_func():

# contains different constraints
needs_constraints = {
"critical": {"check_0": "'critical' in tags", "check_1": "'SECURITY_REQ' in links", "severity": "CRITICAL"},
"critical": {
"check_0": "'critical' in tags",
"check_1": "'SECURITY_REQ' in links",
"severity": "CRITICAL",
},
"security": {"check_0": "'security' in tags", "severity": "HIGH"},
"team": {"check_0": 'author == "Bob"', "severity": "LOW"},
}
Expand Down
Loading

0 comments on commit be3f6fe

Please sign in to comment.