diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4ce083ce..77ba136e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -3,7 +3,7 @@ name: Python Quality Control -on: [push, pull_request] +on: [pull_request] jobs: build: @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10" ] steps: - uses: actions/checkout@v2 @@ -22,6 +22,14 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update + sudo apt-get upgrade -y --no-install-recommends + sudo apt-get install -y libenchant-2-2 + sudo apt-get autoremove + sudo apt-get autoclean + sudo apt-get clean + sudo rm -rf /var/lib/apt/lists/* python3 -m pip install --upgrade pip python3 -m pip install -r requirements-dev.txt python3 -m pip install wheel @@ -31,6 +39,7 @@ jobs: pycodestyle --format=pylint setup.py archivist examples functests unittests python3 -m pylint --rcfile=pylintrc setup.py archivist examples functests unittests black archivist examples unittests functests + (cd docs && make clean && make html) modified=$(git status -s | wc -l) if [ $modified -gt 0 ] then diff --git a/.gitignore b/.gitignore index 50a6d637..74a369a1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/ dist/ *egg-info/ +.config/ .coverage *,cover htmlcov/ diff --git a/Dockerfile-builder b/Dockerfile-builder index f02598fe..318514b0 100644 --- a/Dockerfile-builder +++ b/Dockerfile-builder @@ -1,6 +1,19 @@ ARG VERSION=3.7 FROM python:${VERSION}-bullseye +# Note that any deps installed here must also be installed in the +# github actions workflow .github/workflows/python-package.yml +# +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update \ + && apt-get upgrade -y --no-install-recommends \ + && apt-get install -y libenchant-2-2 \ + && apt-get autoremove \ + && apt-get autoclean \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + COPY requirements.txt requirements-dev.txt /tmp/ RUN python3 -m pip install --upgrade pip \ diff --git a/README.rst b/README.rst index e9d2eb33..47c409b2 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,7 @@ If your version of python3 is too old an error of this type or similar will be e .. note:: ERROR: Could not find a version that satisfies the requirement jitsuin-archivist (from versions: none) - ERROR: No matching distribution found for jitsuiin-archivist + ERROR: No matching distribution found for jitsuin-archivist Example ============= @@ -233,7 +233,7 @@ Example Yaml Snippet -------------------- This is an example of creating an asset and creating an event for that asset. The -yaml file consiste of a list of steps. +yaml file consists of a list of steps. Each step consists of control parameters (specified in the 'step' dictionary) and the yaml representation of the request body for an asset or event. @@ -246,7 +246,7 @@ asset or event is confirmed before returning. The name of the asset is important. The value of the name is carried forward for every operation - in this case the name of the asset is 'radiation bag 1'. - Arguments to the archivist are ususally strings - in this example radioactive is + Arguments to the archivist are usually strings - in this example radioactive is 'true' which archivist will treat as a boolean. @@ -340,4 +340,4 @@ A recommended minimum configuration would be: Development =========== -For instructions on contributing to the RKVST SDK see DEVELOPMENT.md. \ No newline at end of file +For instructions on contributing to the RKVST SDK see DEVELOPMENT.md. diff --git a/archivist/archivist.py b/archivist/archivist.py index b34440a5..8f766bd5 100644 --- a/archivist/archivist.py +++ b/archivist/archivist.py @@ -375,7 +375,7 @@ def post_file( path (str): e.g. v2/assets fd : iterable representing the contents of a file. mtype (str): mime type e.g. image/jpg - params (dict): dictiuonary of optional path params + params (dict): dictionary of optional path params Returns: dict representing the response body (entity). diff --git a/archivist/compliance_policy_type.py b/archivist/compliance_policy_type.py index f2a77fda..e603a5fa 100644 --- a/archivist/compliance_policy_type.py +++ b/archivist/compliance_policy_type.py @@ -16,7 +16,7 @@ class CompliancePolicyType(Enum): COMPLIANCE_TYPE_UNDEFINED = 0 #: Time since specific event for specified period COMPLIANCE_SINCE = 1 - #: Unresolved event currently on asset (eg. vulnerability) + #: Unresolved event currently on asset (e.g. vulnerability) COMPLIANCE_CURRENT_OUTSTANDING = 2 #: No unresolved events for longer than specified period COMPLIANCE_PERIOD_OUTSTANDING = 3 diff --git a/archivist/sboms.py b/archivist/sboms.py index 0b408d9e..9df19b5f 100644 --- a/archivist/sboms.py +++ b/archivist/sboms.py @@ -72,7 +72,7 @@ def __str__(self) -> str: @staticmethod def parse(data: Dict) -> Dict: # pragma: no cover """ - parse the sbom and extract pertinent informtion + parse the sbom and extract pertinent information Args: data (dict): dictionary diff --git a/docs/Makefile b/docs/Makefile index d4bb2cbb..81f0719c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= +SPHINXOPTS ?= -W -b spelling SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build diff --git a/docs/conf.py b/docs/conf.py index 2db6d027..721b8b5a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,6 +33,7 @@ # ones. extensions = [ "sphinx_rtd_theme", + "sphinxcontrib.spelling", "sphinx.ext.autodoc", "sphinx.ext.autosectionlabel", "sphinx.ext.githubpages", @@ -67,6 +68,11 @@ html_show_sphinx = False +spelling_lang='en_US' +spelling_word_list_filename='spelling_wordlist.txt' +spelling_show_suggestions=True +spelling_verbose=True + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". @@ -77,4 +83,4 @@ html_css_files = [ 'css/rkvst_theme.css', -] \ No newline at end of file +] diff --git a/docs/create_asset.rst b/docs/create_asset.rst index 16d58ee9..79ce80e3 100644 --- a/docs/create_asset.rst +++ b/docs/create_asset.rst @@ -1,6 +1,6 @@ .. _create_assetref: -Create Asset Eaxmple +Create Asset Example ..................... .. literalinclude:: ../examples/create_asset.py diff --git a/docs/features.rst b/docs/features.rst index 7a86b8a0..330b7c43 100644 --- a/docs/features.rst +++ b/docs/features.rst @@ -15,8 +15,8 @@ REST api (in any language): creating the asset or event and a sophisticated retry and exponential backoff algorithm will take care of everything. * **list()** method: one can easily get an iterable of assets or events that - correspond to a particular signature. The list method is optimised for use in - loop (for a in srch.assets.list():...) but can easily be converted to a list + correspond to a particular signature. The list method is optimized for use in + loop (for a in arch.assets.list():...) but can easily be converted to a list using the python list() function. * simple **count()** method: one can easily get a count of assets or events that correspond to a particular signature. diff --git a/docs/requirements.txt b/docs/requirements.txt index 4c31a3c1..ff573822 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,6 +5,7 @@ # Make changes in both places sphinx~=4.4 sphinx-rtd-theme~=1.0 +sphinxcontrib-spelling~=7.3 # Duplicate of stanza in ~/requirements.txt. # Make changes in both places diff --git a/docs/runner/events_count.rst b/docs/runner/events_count.rst index 20fe9ceb..ddc55f90 100644 --- a/docs/runner/events_count.rst +++ b/docs/runner/events_count.rst @@ -5,7 +5,7 @@ Events Count Story Runner YAML :code:`asset_label` must match the :code:`asset_label` field of a previous creation step (:code:`ASSETS_CREATE` or :code:`ASSETS_CREATE_IF_NOT_EXISTS`) -for which the authorised credentials have Event write access. +for which the authorized credentials have Event write access. :code:`props`, :code:`attrs` and :code:`asset_attrs` are optional. diff --git a/docs/runner/events_list.rst b/docs/runner/events_list.rst index bacfffee..2b83a0b8 100644 --- a/docs/runner/events_list.rst +++ b/docs/runner/events_list.rst @@ -5,7 +5,7 @@ Events List Story Runner YAML :code:`asset_label` must match the :code:`asset_label` field of a previous creation step (:code:`ASSETS_CREATE` or :code:`ASSETS_CREATE_IF_NOT_EXISTS`) -for which the authorised Application Registration has Event write access +for which the authorized Application Registration has Event write access If :code:`asset_label` is not set, data for all assets is output. diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt new file mode 100644 index 00000000..13f165f8 --- /dev/null +++ b/docs/spelling_wordlist.txt @@ -0,0 +1,50 @@ +api +appidp +args +boolean +comparator +config +cyclonedx +dataclass +dataclasses +dicts +ef +fd +fda +formatters +https +iam +instantiation +iterable +jinja +jitsuin +jpg +json +Khipus +kwargs +macclesfield +mimetype +onwards +params +sbom +sboms +sbomType +stdout +sublogger +subloggers +submodule +synsation +templated +templating +tessera +unittested +url +xml +xxxxxxx +xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxx +yaml +yyyyyyy +yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy diff --git a/functests/test_resources/door_entry_story.yaml b/functests/test_resources/door_entry_story.yaml index be62b855..925ced5f 100644 --- a/functests/test_resources/door_entry_story.yaml +++ b/functests/test_resources/door_entry_story.yaml @@ -349,7 +349,7 @@ steps: email: courts.paris.wavestonedas@iot.wavestone.com display_name: Courts of Justice Paris Front Door machine credential event_attributes: - arc_description: Door opened by authorised key card Access Card 2 + arc_description: Door opened by authorized key card Access Card 2 arc_display_type: Door Open arc_evidence: ARQC 0x12345678 arc_correlation_value: be5c8061-236d-4400-a625-b74a34e5801b diff --git a/requirements-dev.txt b/requirements-dev.txt index 286fd173..e433bf07 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -17,6 +17,7 @@ twine~=3.8 # must be kept in sync with this file. sphinx~=4.4 sphinx-rtd-theme~=1.0 +sphinxcontrib-spelling~=7.3 # analyze dependencies pipdeptree~=2.2