diff --git a/README.md b/README.md index bf390b2..f843427 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ [![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyEDAA.IPXACT?longCache=true&style=flat-square)](https://libraries.io/github/edaa-org/pyEDAA.IPXACT/sourcerank) --> -An IP-XACT Document Object Model (DOM) for [IEEE 1685-2014][IEEE-1685-2014] written in Python. +An IP-XACT Document Object Model (DOM) for [IEEE 1685-2022][IEEE-1685-2022] written in Python. # Features @@ -35,8 +35,9 @@ An IP-XACT Document Object Model (DOM) for [IEEE 1685-2014][IEEE-1685-2014] writ * Standards: * [IEEE 1685-2009][IEEE-1685-2009] * [IEEE 1685-2014][IEEE-1685-2014] + * [IEEE 1685-2022][IEEE-1685-2022] * Schema files: - * [IPXACT-Schema](https://github.com/UnofficialRepos/IPXACT-Schema) at GitHub + * [IPXACT-Schema](https://github.com/edaa-org/IPXACT-Schema) at GitHub * [IP-XACT][IPXACT] at [Accellera][Accellera] @@ -47,7 +48,8 @@ An IP-XACT Document Object Model (DOM) for [IEEE 1685-2014][IEEE-1685-2014] writ # License -This Python library (source code) is licensed under [Apache License 2.0](LICENSE.md). +This Python package (source code) is licensed under [Apache License 2.0](LICENSE.md). +The accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst). ------------------------- SPDX-License-Identifier: Apache-2.0 @@ -55,5 +57,6 @@ SPDX-License-Identifier: Apache-2.0 [IEEE-1685-2009]: https://standards.ieee.org/findstds/standard/1685-2009.html [IEEE-1685-2014]: https://standards.ieee.org/findstds/standard/1685-2014.html +[IEEE-1685-2022]: https://standards.ieee.org/findstds/standard/1685-2022.html [IPXACT]: http://accellera.org/downloads/standards/ip-xact [Accellera]: http://accellera.org diff --git a/dist/requirements.txt b/dist/requirements.txt index e4718c9..a414030 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ -wheel>=0.38.1 -twine +wheel >= 0.40.0 +twine >= 4.0.2 diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 4c3cc30..4703d9d 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -57,19 +57,21 @@ the mandatory dependencies too. .. rubric:: Dependency List -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| **Package** | **Version** | **License** | **Dependencies** | -+===========================================================+=============+========================================================================================+======================+ -| `pytest `__ | ≥7.2.0 | `MIT `__ | *Not yet evaluated.* | -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `pytest-cov `__ | ≥4.0.0 | `MIT `__ | *Not yet evaluated.* | -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `Coverage `__ | ≥7.0 | `Apache License, 2.0 `__ | *Not yet evaluated.* | -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `mypy `__ | ≥1.2 | `MIT `__ | *Not yet evaluated.* | -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `lxml `__ | ≥4.9 | `BSD 3-Clause `__ | *Not yet evaluated.* | -+-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++=====================================================================+=============+========================================================================================+======================+ +| `pytest `__ | ≥7.4.0 | `MIT `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `pytest-cov `__ | ≥4.1.0 | `MIT `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `Coverage `__ | ≥7.3 | `Apache License, 2.0 `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `mypy `__ | ≥1.5 | `MIT `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `typing-extensions `__ | ≥4.7.1 | `PSF-2.0 `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `lxml `__ | ≥4.9 | `BSD 3-Clause `__ | *Not yet evaluated.* | ++---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ .. _dependency-documentation: @@ -134,7 +136,7 @@ install the mandatory dependencies too. +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ | `pyTooling `__ | ≥5.0.0 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `wheel `__ | ≥0.38.1 | `MIT `__ | *Not yet evaluated.* | +| `wheel `__ | ≥0.40.0 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -163,7 +165,7 @@ install the mandatory dependencies too. +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ | **Package** | **Version** | **License** | **Dependencies** | +==========================================================+==============+===========================================================================================+======================+ -| `wheel `__ | ≥0.38.1 | `MIT `__ | *Not yet evaluated.* | +| `wheel `__ | ≥0.40.0 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ -| `Twine `__ | any | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Twine `__ | ≥4.0.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/conf.py b/doc/conf.py index 46b07b0..0015840 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -208,7 +208,7 @@ 'ghrepo': ('https://github.com/%s', 'gh:'), 'ghissue': ('https://github.com/edaa-org/pyEDAA.IPXACT/issues/%s', 'issue #'), 'ghpull': ('https://github.com/edaa-org/pyEDAA.IPXACT/pull/%s', 'pull request #'), - 'ghsrc': ('https://github.com/edaa-org/pyEDAA.IPXACT/blob/main/%s', ''), + 'ghsrc': ('https://github.com/edaa-org/pyEDAA.IPXACT/blob/main/%s', None), 'pypiproject': ('https://pypi.org/project/%s', 'pypi:') } diff --git a/lib/schema b/lib/schema index 9ca003f..c9e00c0 160000 --- a/lib/schema +++ b/lib/schema @@ -1 +1 @@ -Subproject commit 9ca003fdd5b1f27c4d116fab121a879aa6d5f373 +Subproject commit c9e00c091eecbe3517594856295148238fcd659b diff --git a/pyEDAA/IPXACT/Catalog.py b/pyEDAA/IPXACT/Catalog.py index 69b2aa5..5e7c3ac 100644 --- a/pyEDAA/IPXACT/Catalog.py +++ b/pyEDAA/IPXACT/Catalog.py @@ -166,17 +166,17 @@ def FromFile(cls, filePath : Path): items = [] for rootElements in root: element = etree.QName(rootElements) - if (element.localname == "vendor"): + if element.localname == "vendor": vendor = rootElements.text - elif (element.localname == "library"): + elif element.localname == "library": library = rootElements.text - elif (element.localname == "name"): + elif element.localname == "name": name = rootElements.text - elif (element.localname == "version"): + elif element.localname == "version": version = rootElements.text - elif (element.localname == "description"): + elif element.localname == "description": description = rootElements.text - elif (element.localname == "catalogs"): + elif element.localname == "catalogs": for ipxactFileElement in rootElements: items.append(IpxactFile.FromXml(ipxactFileElement)) else: diff --git a/pyEDAA/IPXACT/__init__.py b/pyEDAA/IPXACT/__init__.py index ebe66ce..0ba0a10 100644 --- a/pyEDAA/IPXACT/__init__.py +++ b/pyEDAA/IPXACT/__init__.py @@ -39,18 +39,18 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "2016-2023, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.3.1" +__version__ = "0.3.2" @export class IpxactSchemaStruct: """Schema descriptor made of version, namespace prefix, URI, URL and local path.""" - Version : str = None #: Schema version - NamespacePrefix : str = None #: XML namespace prefix - SchemaUri : str = None #: schema URI - SchemaUrl : str = None #: schema URL - LocalPath : Path = None #: local path + Version: str #: Schema version + NamespacePrefix: str #: XML namespace prefix + SchemaUri: str #: Schema URI + SchemaUrl: str #: Schema URL + LocalPath: Path #: Local path def __init__(self, version : str, namespacePrefix : str, schemaUri : str, schemaUrl : str, localPath : Path): """Constructor""" @@ -89,10 +89,10 @@ def __init__(self, version : str, namespacePrefix : str, schemaUri : str, schema class Vlnv: """VLNV data structure (Vendor, Library, Name, Version) as a unique identifier in IP-XACT.""" - Vendor : str = None #: Vendor name in a VLNV unique identifier - Library : str = None #: Library name in a VLNV unique identifier - Name : str = None #: Component name in a VLNV unique identifier - Version : str = None #: Version in a VLNV unique identifier + Vendor: str #: Vendor name in a VLNV unique identifier + Library: str #: Library name in a VLNV unique identifier + Name: str #: Component name in a VLNV unique identifier + Version: str #: Version in a VLNV unique identifier def __init__(self, vendor, library, name, version): """Constructor""" @@ -121,7 +121,7 @@ def ToXml(self, indent=1, isVersionedIdentifier=False): class RootElement: """Base-class for all IP-XACT data classes.""" - _vlnv : Vlnv = None #: VLNV unique identifier. + _vlnv: Vlnv #: VLNV unique identifier. def __init__(self, vlnv): """Base-constructor to set a VLNV field for all derives classes.""" diff --git a/pyproject.toml b/pyproject.toml index 7abdacc..807f1b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,36 +1,55 @@ [build-system] requires = [ - "pyTooling >= 5.0.0", - "setuptools >= 60.9.3", - "wheel >= 0.38.1" + "setuptools >= 68.0.0", + "wheel >= 0.40.0", + "pyTooling >= 5.0.0" ] build-backend = "setuptools.build_meta" [tool.black] line-length = 120 +[tool.mypy] +python_version = "3.11" +namespace_packages = true + +pretty = true +show_error_context = true + +html_report = "report/typing" + [tool.pytest.ini_options] # Don't set 'python_classes = *' otherwise, pytest doesn't search for classes # derived from unittest.Testcase python_files = "*" python_functions = "test_*" +filterwarnings = [ + "error::DeprecationWarning", + "error::PendingDeprecationWarning" +] [tool.coverage.run] branch = true omit = [ "*site-packages*", - "setup.py" + "setup.py", + "tests/*" ] [tool.coverage.report] -#skip_covered = true +skip_covered = false skip_empty = true exclude_lines = [ + "pragma: no cover", "raise NotImplementedError" ] +omit = [ + "tests/*" +] [tool.coverage.html] directory = "report/coverage/html" +title="Code Coverage of pyEDAA.IPXACT" [tool.coverage.xml] output = "report/coverage/coverage.xml" diff --git a/setup.py b/setup.py index 8624211..9a69d32 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ # SPDX-License-Identifier: Apache-2.0 # # ==================================================================================================================== # # +from itertools import chain from pathlib import Path from pyTooling.Packaging import DescribePythonPackageHostedOnGitHub, DEFAULT_CLASSIFIERS @@ -45,5 +46,14 @@ developmentStatus="alpha", classifiers=list(DEFAULT_CLASSIFIERS) + [ "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)" - ] + ], + dataFiles={ + packageName: [ + str(file.relative_to(Path.cwd())) + for file in chain( + Path.cwd().glob("ipxact*/**/*"), + Path.cwd().glob("ieee*/**/*") + ) + ] + } ) diff --git a/tests/requirements.txt b/tests/requirements.txt index 6407e55..6904298 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,12 +1,13 @@ -r ../requirements.txt # Coverage collection -Coverage>=7.0 +Coverage >= 7.3 # Test Runner -pytest>=7.2.0 -pytest-cov>=4.0.0 +pytest >= 7.4.0 +pytest-cov >= 4.1.0 # Static Type Checking -mypy >= 1.2 +mypy >= 1.5 +typing_extensions >= 4.7.1 lxml>=4.9