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

Move modules from namespace 'mlx' to 'mlx/traceability' #358

Merged
merged 17 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ coverage.xml
.env

# Offline version file
mlx/__traceability_version__.py
mlx/traceability/__traceability_version__.py

# Pie chart images
doc/_images

# Custom hyperlink colors
mlx/assets/hyperlink_colors.css
mlx/traceability/assets/hyperlink_colors.css
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
include *.md

# Include the assets - javascript
include mlx/assets/*.js
include mlx/traceability/assets/*.js


exclude mlx/__traceability_version__.py
exclude mlx/traceability/__traceability_version__.py
exclude .pylintrc

# added by check_manifest.py
Expand Down
7 changes: 3 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import sys

import mlx.traceability
from mlx.traceability import report_warning
from pkg_resources import get_distribution
from mlx.traceability import report_warning, __version__

pkg_version = get_distribution('mlx.traceability').version
pkg_version = __version__

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -452,7 +451,7 @@ def traceability_inspect_item(name, collection):

def setup(app):

from traceability import ItemDirective
from mlx.traceability import ItemDirective
# New directive types: treated exactly as ``item`` directive, but
# using a different name. Item template can be customized for
# these types
Expand Down
6 changes: 3 additions & 3 deletions doc/implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TraceableItem
.. item:: IMPL-TRACEABLE_ITEM
:fulfills: DESIGN-ITEMIZE

.. automodule:: mlx.traceable_item
.. automodule:: mlx.traceability.traceable_item
:members:
:show-inheritance:

Expand All @@ -25,7 +25,7 @@ TraceableCollection

.. item:: IMPL-TRACEABLE_COLLECTION

.. automodule:: mlx.traceable_collection
.. automodule:: mlx.traceability.traceable_collection
:members:
:show-inheritance:

Expand All @@ -34,7 +34,7 @@ TraceabilityException

.. item:: IMPL-TRACEABILITY_EXCEPTION

.. automodule:: mlx.traceability_exception
.. automodule:: mlx.traceability.traceability_exception
:members:
:show-inheritance:

Expand Down
3 changes: 0 additions & 3 deletions mlx/__init__.py

This file was deleted.

60 changes: 60 additions & 0 deletions mlx/traceability/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
""" Melexis fork of traceability Sphinx plugin """

__all__ = [
'AttributeLink',
'AttributeLinkDirective',
'AttributeSort',
'AttributeSortDirective',
'CheckboxResultDirective',
'ChecklistItemDirective',
'Item',
'Item2DMatrix',
'Item2DMatrixDirective',
'ItemAttribute',
'ItemAttributeDirective',
'ItemAttributesMatrix',
'ItemAttributesMatrixDirective',
'ItemDirective',
'ItemLink',
'ItemLinkDirective',
'ItemList',
'ItemListDirective',
'ItemMatrix',
'ItemMatrixDirective',
'ItemPieChart',
'ItemPieChartDirective',
'ItemRelink',
'ItemRelinkDirective',
'ItemTree',
'ItemTreeDirective',
'report_warning',
'TraceabilityException',
'TraceableAttribute',
'TraceableCollection',
'TraceableItem',
'__version__',
]


from .__traceability_version__ import __version__
from .traceability_exception import report_warning, TraceabilityException
from .traceable_attribute import TraceableAttribute
from .traceable_collection import TraceableCollection
from .traceable_item import TraceableItem
from .directives.attribute_link_directive import AttributeLink, AttributeLinkDirective
from .directives.attribute_sort_directive import AttributeSort, AttributeSortDirective
from .directives.checkbox_result_directive import CheckboxResultDirective
from .directives.checklist_item_directive import ChecklistItemDirective
from .directives.item_2d_matrix_directive import Item2DMatrix, Item2DMatrixDirective
from .directives.item_attribute_directive import ItemAttribute, ItemAttributeDirective
from .directives.item_attributes_matrix_directive import ItemAttributesMatrix, ItemAttributesMatrixDirective
from .directives.item_directive import Item, ItemDirective
from .directives.item_link_directive import ItemLink, ItemLinkDirective
from .directives.item_list_directive import ItemList, ItemListDirective
from .directives.item_matrix_directive import ItemMatrix, ItemMatrixDirective
from .directives.item_pie_chart_directive import ItemPieChart, ItemPieChartDirective
from .directives.item_relink_directive import ItemRelink, ItemRelinkDirective
from .directives.item_tree_directive import ItemTree, ItemTreeDirective

# provide setup function here for Sphinx
from .traceability import setup # noqa: unused-import
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from docutils.parsers.rst import directives

from mlx.traceability_exception import TraceabilityException, report_warning
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceability_exception import TraceabilityException, report_warning
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class AttributeLink(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from docutils.parsers.rst import directives

from mlx.traceability import report_warning
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceability_exception import report_warning
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class AttributeSort(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" Module for the directive used to set the checklist attribute. """
from re import match

from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceability_exception import report_warning, TraceabilityException
from ..traceable_base_directive import TraceableBaseDirective
from ..traceability_exception import report_warning, TraceabilityException


class CheckboxResultDirective(TraceableBaseDirective):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Module for the directive for declaring checklist items. """
from mlx.directives.item_directive import ItemDirective
from mlx.traceability_exception import report_warning, TraceabilityException
from .item_directive import ItemDirective
from ..traceability_exception import report_warning, TraceabilityException


class ChecklistItemDirective(ItemDirective):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from docutils import nodes
from docutils.parsers.rst import directives

from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class Item2DMatrix(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from docutils import nodes

from mlx.traceability import report_warning
from mlx.traceable_attribute import TraceableAttribute
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from ..traceability_exception import report_warning
from ..traceable_attribute import TraceableAttribute
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode
from ..traceable_item import TraceableItem


class ItemAttribute(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from docutils import nodes
from docutils.parsers.rst import directives

from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode
from ..traceable_item import TraceableItem


class ItemAttributesMatrix(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from docutils import nodes
from docutils.parsers.rst import directives

from mlx.traceability_exception import report_warning, TraceabilityException
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from ..traceability_exception import report_warning, TraceabilityException
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode
from ..traceable_item import TraceableItem


class Item(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from docutils.parsers.rst import directives

from mlx.traceability_exception import report_warning, TraceabilityException
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceability_exception import report_warning, TraceabilityException
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class ItemLink(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from docutils import nodes
from docutils.parsers.rst import directives

from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class ItemList(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from docutils.parsers.rst import directives
from natsort import natsorted, natsort_keygen

from mlx.traceability_exception import TraceabilityException, report_warning
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from ..traceability_exception import TraceabilityException, report_warning
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode
from ..traceable_item import TraceableItem

natsort_key = natsort_keygen(key=lambda item: getattr(item, 'identifier', ''))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import matplotlib.pyplot as plt # pylint: disable=wrong-import-order
from sphinx.builders.latex import LaTeXBuilder

from mlx.traceability_exception import report_warning
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from ..traceability_exception import report_warning
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode
from ..traceable_item import TraceableItem


def pct_wrapper(sizes):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Module for the item-relink directive"""
from docutils.parsers.rst import directives

from mlx.traceability import TraceabilityException, report_warning
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceability_exception import TraceabilityException, report_warning
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode


class ItemRelink(TraceableBaseNode):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from natsort import natsorted, natsort_keygen
from sphinx.builders.latex import LaTeXBuilder

from mlx.traceability import report_warning, TraceabilityException
from mlx.traceable_base_directive import TraceableBaseDirective
from mlx.traceable_base_node import TraceableBaseNode
from ..traceability_exception import report_warning, TraceabilityException
from ..traceable_base_directive import TraceableBaseDirective
from ..traceable_base_node import TraceableBaseNode

natsort_key = natsort_keygen()

Expand Down
40 changes: 20 additions & 20 deletions mlx/traceability.py → mlx/traceability/traceability.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@
from docutils import nodes
from docutils.parsers.rst import directives

from mlx.__traceability_version__ import version
from mlx.traceable_attribute import TraceableAttribute
from mlx.traceable_base_node import TraceableBaseNode
from mlx.traceable_item import TraceableItem
from mlx.traceable_collection import TraceableCollection
from mlx.traceability_exception import TraceabilityException, MultipleTraceabilityExceptions, report_warning
from mlx.directives.attribute_link_directive import AttributeLink, AttributeLinkDirective
from mlx.directives.attribute_sort_directive import AttributeSort, AttributeSortDirective
from mlx.directives.checkbox_result_directive import CheckboxResultDirective
from mlx.directives.checklist_item_directive import ChecklistItemDirective
from mlx.directives.item_directive import Item, ItemDirective
from mlx.directives.item_2d_matrix_directive import Item2DMatrix, Item2DMatrixDirective
from mlx.directives.item_attribute_directive import ItemAttribute, ItemAttributeDirective
from mlx.directives.item_attributes_matrix_directive import ItemAttributesMatrix, ItemAttributesMatrixDirective
from mlx.directives.item_link_directive import ItemLink, ItemLinkDirective
from mlx.directives.item_list_directive import ItemList, ItemListDirective
from mlx.directives.item_matrix_directive import ItemMatrix, ItemMatrixDirective
from mlx.directives.item_pie_chart_directive import ItemPieChart, ItemPieChartDirective
from mlx.directives.item_relink_directive import ItemRelink, ItemRelinkDirective
from mlx.directives.item_tree_directive import ItemTree, ItemTreeDirective
from .__traceability_version__ import __version__ as version
from .traceable_attribute import TraceableAttribute
from .traceable_base_node import TraceableBaseNode
from .traceable_item import TraceableItem
from .traceable_collection import TraceableCollection
from .traceability_exception import TraceabilityException, MultipleTraceabilityExceptions, report_warning
from .directives.attribute_link_directive import AttributeLink, AttributeLinkDirective
from .directives.attribute_sort_directive import AttributeSort, AttributeSortDirective
from .directives.checkbox_result_directive import CheckboxResultDirective
from .directives.checklist_item_directive import ChecklistItemDirective
from .directives.item_directive import Item, ItemDirective
from .directives.item_2d_matrix_directive import Item2DMatrix, Item2DMatrixDirective
from .directives.item_attribute_directive import ItemAttribute, ItemAttributeDirective
from .directives.item_attributes_matrix_directive import ItemAttributesMatrix, ItemAttributesMatrixDirective
from .directives.item_link_directive import ItemLink, ItemLinkDirective
from .directives.item_list_directive import ItemList, ItemListDirective
from .directives.item_matrix_directive import ItemMatrix, ItemMatrixDirective
from .directives.item_pie_chart_directive import ItemPieChart, ItemPieChartDirective
from .directives.item_relink_directive import ItemRelink, ItemRelinkDirective
from .directives.item_tree_directive import ItemTree, ItemTreeDirective

ItemInfo = namedtuple('ItemInfo', 'attr_val mr_id')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''

import re
from mlx.traceable_base_class import TraceableBaseClass
from .traceable_base_class import TraceableBaseClass


class TraceableAttribute(TraceableBaseClass):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from docutils.statemachine import ViewList
from sphinx.util.nodes import nested_parse_with_titles

from mlx.traceability_exception import report_warning, TraceabilityException
from .traceability_exception import report_warning, TraceabilityException


class TraceableBaseClass:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from abc import ABC, abstractmethod
from docutils.parsers.rst import Directive

from mlx.traceability_exception import report_warning
from mlx.traceable_item import TraceableItem
from .traceability_exception import report_warning
from .traceable_item import TraceableItem


class TraceableBaseDirective(Directive, ABC):
Expand Down
Loading