Skip to content

Commit

Permalink
Fix for OpenCyphal#298 and workaround for Sybil 4 bug (OpenCyphal#303)
Browse files Browse the repository at this point in the history
OpenCyphal#298 will be fixed but this will also get another refactor when we
switch to CETL.
  • Loading branch information
thirtytwobits authored May 18, 2023
1 parent 712ee2c commit f0cc6cd
Show file tree
Hide file tree
Showing 93 changed files with 482 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Python dev environment",
"image": "ghcr.io/opencyphal/toxic:tx20.4.1",
"image": "ghcr.io/opencyphal/toxic:tx22.4.1",
"workspaceFolder": "/workspace",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
"mounts": [
Expand All @@ -12,7 +12,7 @@
"extensions": [
"uavcan.dsdl",
"wholroyd.jinja",
"ban.spellright",
"streetsidesoftware.code-spell-checker",
"ms-python.python"
]
}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
release:
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toxic:ts20.4.1
container: ghcr.io/opencyphal/toxic:tx22.4.1
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -20,8 +20,6 @@ jobs:
# Fails the release if the release-tag doesn't match the Nunavut version at that tag.
run: |
$(./.github/verify.py -vv --version-check-only "${{ steps.process_event.outputs.tag }}")
- name: install-tox
run: pip3 install tox
- name: lint
run: tox -e lint
- name: test-nnvg
Expand Down
73 changes: 36 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toxic:tx22.4.1
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install-tox
run: pip3 install tox
- name: lint
run: tox -e lint
- name: test-nnvg
Expand Down Expand Up @@ -52,11 +48,9 @@ jobs:
container: sonarsource/sonar-scanner-cli
steps:
- uses: actions/checkout@v3
- name: sonar-cache
uses: actions/cache@v3
with:
path: /opt/sonar-scanner/.sonar/cache
key: sonar-scanner-cli-4.8.0.2856-${{ runner.os }}
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: download-converage-reports
uses: actions/download-artifact@v3
with:
Expand All @@ -75,43 +69,34 @@ jobs:
working-directory: .tox
- name: report-release
if: ${{ github.event_name != 'pull_request' }}
uses: sonarsource/sonarcloud-github-action@master
env:
SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sonar-scanner -X \
-Dsonar.login=${{ env.SONARQUBE_TOKEN }} \
-Dsonar.buildString=${{ env.GITHUB_RUN_ID }} \
-Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }} \
-Dsonar.python.version=python3.9
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
args: >
-Dsonar.login=${{ env.SONAR_TOKEN }}
-Dsonar.buildString=${{ env.GITHUB_RUN_ID }}
-Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }}
-Dsonar.python.version=python3.10
- name: report-pr
if: ${{ github.event_name == 'pull_request' }}
uses: sonarsource/sonarcloud-github-action@master
env:
SONARQUBE_TOKEN: 6526e88c286672a7852fea52056c4b6ea583aaf7
SONAR_TOKEN: "6526e88c286672a7852fea52056c4b6ea583aaf7"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sonar-scanner -X \
-Dsonar.login=${{ env.SONARQUBE_TOKEN }} \
-Dsonar.buildString=${{ env.GITHUB_RUN_ID }} \
-Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }} \
-Dsonar.python.version=python3.9
with:
args: >
-Dsonar.login=${{ env.SONAR_TOKEN }}
-Dsonar.buildString=${{ env.GITHUB_RUN_ID }}
-Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }}
-Dsonar.python.version=python3.10
compat-test-python3:
compat-test-python3-windows-and-mac:
strategy:
matrix:
python3-version: ['11']
python3-platform: ['ubuntu-latest', 'windows-latest', 'macos-latest']
include:
- python3-version: 6
python3-platform: ubuntu-18.04
- python3-version: 7
python3-platform: ubuntu-20.04
- python3-version: 8
python3-platform: ubuntu-20.04
- python3-version: 9
python3-platform: ubuntu-20.04
- python3-version: 10
python3-platform: ubuntu-20.04
python3-version: ['10','11']
python3-platform: ['windows-latest', 'macos-latest']
runs-on: ${{ matrix.python3-platform }}
needs: test
steps:
Expand All @@ -127,6 +112,20 @@ jobs:
- name: python3.${{ matrix.python3-version }} test
run: tox -e py3${{ matrix.python3-version }}-nnvg,py3${{ matrix.python3-version }}-test

compat-test-python3-ubuntu:
strategy:
matrix:
python3-version: ['7', '8', '9', '10', '11']
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toxic:tx22.4.1
needs: test
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: python3.${{ matrix.python3-version }} test
run: tox -e py3${{ matrix.python3-version }}-nnvg,py3${{ matrix.python3-version }}-test

language-verification-c:
runs-on: ubuntu-latest
needs: test
Expand Down
3 changes: 2 additions & 1 deletion .vscode/cmake-variants.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"short": "--std=c11",
"long": "Compile and link using the C11 standard.",
"settings": {
"NUNAVUT_VERIFICATION_LANG": "c"
"NUNAVUT_VERIFICATION_LANG": "c",
"NUNAVUT_VERIFICATION_LANG_STANDARD": "c11"
}
},
"C++14": {
Expand Down
10 changes: 2 additions & 8 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-azuretools.vscode-docker",
"uavcan.dsdl",
"wholroyd.jinja",
"ban.spellright",
"ms-python.python",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"xaver.clang-format",
"hbenl.vscode-test-explorer",
"matepek.vscode-catch2-test-adapter"
"streetsidesoftware.code-spell-checker",
"ms-python.python"
]
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ To run the full suite of `tox`_ tests locally you'll need docker. Once you have
and running do::

git submodule update --init --recursive
docker pull ghcr.io/opencyphal/toxic:tx20.4.1
docker run --rm -v $PWD:/repo ghcr.io/opencyphal/toxic:tx20.4.1 tox
docker pull ghcr.io/opencyphal/toxic:tx22.4.1
docker run --rm -v $PWD:/repo ghcr.io/opencyphal/toxic:tx22.4.1 tox

To run a limited suite using only locally available interpreters directly on your host machine,
skip the docker invocations and use ``tox -s``.
Expand Down Expand Up @@ -187,7 +187,7 @@ Building The Docs
We rely on `read the docs`_ to build our documentation from github but we also verify this build
as part of our tox build. This means you can view a local copy after completing a full, successful
test run (See `Running The Tests`_) or do
:code:`docker run --rm -t -v $PWD:/repo uavcan/toxic:py35-py39-sq /bin/sh -c "tox -e docs"` to build
:code:`docker run --rm -t -v $PWD:/repo ghcr.io/opencyphal/toxic:tx22.4.1 /bin/sh -c "tox -e docs"` to build
the docs target. You can open the index.html under .tox/docs/tmp/index.html or run a local
web-server::

Expand Down
2 changes: 1 addition & 1 deletion docs/static/templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "!footer.html" %}
{% block extrafooter %}
<div style="float:right; padding: 10pt">
<a href="http://opencyphal.org"><img src="{{pathto('_static/' + favicon, 1)}}" class="logo" alt="UAVCAN" /></a>
<a href="http://opencyphal.org"><img src="{{pathto('_static/' + favicon, 1)}}" class="logo" alt="OpenCyphal" /></a>
</div>
<div style="margin-top: 2pt">
<li><a href="http://opencyphal.org">OpenCyphal Website</a> &raquo;</li>
Expand Down
4 changes: 0 additions & 4 deletions docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@ C++ Filters
:noindex:
.. autofunction:: nunavut.lang.cpp.filter_declaration
:noindex:
.. autofunction:: nunavut.lang.cpp.filter_definition_begin
:noindex:
.. autofunction:: nunavut.lang.cpp.filter_definition_end
:noindex:
.. autofunction:: nunavut.lang.cpp.filter_to_namespace_qualifier
:noindex:
.. autofunction:: nunavut.lang.cpp.filter_type_from_primitive
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This file provided for readthedocs.io only. Use tox.ini for all dependencies.

sphinx >= 1.8.5
sphinx-argparse
sphinx_rtd_theme
sphinxemoji
4 changes: 2 additions & 2 deletions src/nunavut/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
.. autodata:: __version__
"""

__version__ = "2.0.10"
__version__ = "2.1.0"
__license__ = "MIT"
__author__ = "OpenCyphal"
__copyright__ = "Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright (c) 2023 OpenCyphal."
__copyright__ = "Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright (c) 2023 OpenCyphal."
__email__ = "maintainers@opencyphal.org"
10 changes: 4 additions & 6 deletions src/nunavut/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def _make_parser() -> argparse.ArgumentParser:
the vendor-specific namespace won't be able to use data types from the standard
namespace.
Additional directories can also be specified through the environment variable
DSDL_INCLUDE_PATH, where the path entries are separated by colons ":" on posix
systems and ";" on Windows.
Additional directories can also be specified through an environment variable
DSDL_INCLUDE_PATH where the path entries are separated by colons ":" on
posix systems and ";" on Windows.
"""
).lstrip(),
Expand Down Expand Up @@ -562,9 +562,7 @@ def main() -> int:
#
extra_includes = args.lookup_dir

# legacy variable. We'll support this for a time.
extra_includes_from_env = _extra_includes_from_env("UAVCAN_DSDL_INCLUDE_PATH")
extra_includes_from_env += _extra_includes_from_env("DSDL_INCLUDE_PATH")
extra_includes_from_env = _extra_includes_from_env("DSDL_INCLUDE_PATH")
extra_includes += sorted(extra_includes_from_env)

from nunavut.cli.runners import ArgparseRunner
Expand Down
Loading

0 comments on commit f0cc6cd

Please sign in to comment.