Commit f122e842 authored by Leon Mauritz Möller's avatar Leon Mauritz Möller
Browse files

Merge branch 'backport/docs_ci' into 'master'

README: link documentation

See merge request !82
parents 42a404bc b179aa23
Pipeline #581720 passed with stages
in 3 minutes and 37 seconds
......@@ -71,9 +71,28 @@ static_analysis:
- pycodestyle --count --max-line-length 120 aas test
# Create Sphinx documentation
docs:
stage: package
dependencies: []
only: [branches, tags, merge_requests]
inherit:
variables: ["PIP_CACHE_DIR"]
script:
- pip install --cache-dir="$PIP_CACHE_DIR" -r requirements.txt
- cd docs
- sphinx-build source/ build/
artifacts:
paths:
- docs/build
# Use setup.py to build a source distribution package
package:
stage: package
dependencies: []
script:
- python setup.py sdist
......@@ -86,6 +105,8 @@ package:
# Publish package to PyPI for every vX.X.X tag
publish:
stage: deploy
dependencies:
- package
only:
- /^v\d+(\.\d+)*$/
except:
......
......@@ -52,9 +52,12 @@ Optional production usage dependencies:
* For using the Compliance Tool to validate JSON files against the JSON Schema: `jsonschema` and its
dependencies (MIT License, Apache License, PSF License)
Development/testing/example dependencies (see `requirements.txt`):
Development/testing/documentation/example dependencies (see `requirements.txt`):
* `jsonschema` and its dependencies (MIT License, Apache License, PSF License)
* `psutil` (BSD 3-clause License)
* `Sphinx` and its dependencies (multiple licenses)
* `sphinx-rtd-theme` and its dependencies
* `sphinx-argparse` (MIT License)
## Getting Started
......@@ -127,7 +130,12 @@ For further examples and tutorials, check out the `aas.examples`-package. Here i
retrieve AAS objects in a CouchDB document database
### Compliance Tool
## Documentation
In addition to the examples above, a detailed documentation for the current branch is available [here](https://git.rwth-aachen.de/acplt/pyi40aas/-/jobs/artifacts/master/file/docs/build/index.html?job=docs).
## Compliance Tool
The PyI40AAS project contains a compliance tool for testing xml and json files is provided in the
`aas.compliance_tool`-package. Following functionalities are supported:
......
......@@ -712,11 +712,11 @@ def _create_dict(data: model.AbstractObjectStore) -> dict:
for obj in data:
if isinstance(obj, model.Asset):
assets.append(obj)
if isinstance(obj, model.AssetAdministrationShell):
elif isinstance(obj, model.AssetAdministrationShell):
asset_administration_shells.append(obj)
if isinstance(obj, model.Submodel):
elif isinstance(obj, model.Submodel):
submodels.append(obj)
if isinstance(obj, model.ConceptDescription):
elif isinstance(obj, model.ConceptDescription):
concept_descriptions.append(obj)
dict_ = {
'assetAdministrationShells': asset_administration_shells,
......
......@@ -868,11 +868,11 @@ def write_aas_xml_file(file: IO,
for obj in data:
if isinstance(obj, model.Asset):
assets.append(obj)
if isinstance(obj, model.AssetAdministrationShell):
elif isinstance(obj, model.AssetAdministrationShell):
asset_administration_shells.append(obj)
if isinstance(obj, model.Submodel):
elif isinstance(obj, model.Submodel):
submodels.append(obj)
if isinstance(obj, model.ConceptDescription):
elif isinstance(obj, model.ConceptDescription):
concept_descriptions.append(obj)
# serialize objects to XML
......
......@@ -5,3 +5,6 @@ types-python-dateutil
pyecma376-2>=0.2.4
psutil>=5.6
urllib3>=1.26<2.0
Sphinx~=3.5.3
sphinx-rtd-theme~=0.5.1
sphinx-argparse~=0.2.3
......@@ -65,11 +65,7 @@ class XmlDeserializationTest(unittest.TestCase):
_xml_wrap("<aas:submodels><aas:submodel/>")
)
for s in xml:
bytes_io = io.BytesIO(s.encode("utf-8"))
with self.assertRaises(etree.XMLSyntaxError):
read_aas_xml_file(bytes_io, failsafe=False)
with self.assertLogs(logging.getLogger(), level=logging.ERROR):
read_aas_xml_file(bytes_io, failsafe=True)
self._assertInExceptionAndLog(s, [], etree.XMLSyntaxError, logging.ERROR)
def test_invalid_list_name(self) -> None:
xml = _xml_wrap("<aas:invalidList></aas:invalidList>")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment