Skip to content

Commit

Permalink
feat: Import from git
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenngn committed Jan 10, 2024
1 parent 9963ff8 commit d78d48a
Show file tree
Hide file tree
Showing 41 changed files with 3,660 additions and 214 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,73 @@
name: Build

on:
push:
branches: ["*"]
pull_request: [master]
tags: ["v*.*.*"]
push:
branches: ["*"]
pull_request: [master]
tags: ["v*.*.*"]

jobs:
test:
name: Test with Python ${{matrix.python_version}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version:
- "3.10"
- "3.11"
include:
- os: windows-latest
python_version: "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python_version}}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
${{runner.os}}-
- name: Upgrade Pip
run: |-
python -m pip install -U pip
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=capella_ros_tools --rootdir=.
test:
name: Test with Python ${{matrix.python_version}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version:
- "3.9"
- "3.10"
include:
- os: windows-latest
python_version: "3.9"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python_version}}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
${{runner.os}}-
- name: Upgrade Pip
run: |-
python -m pip install -U pip
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=capella_ros_tools --rootdir=.
publish:
name: Publish artifacts
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |-
python -m pip install -U pip
python -m pip install build twine
- name: Build packages
run: |-
python -m build
- name: Verify packages
run: |-
python -m twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: 'dist/*'
- name: Publish to PyPI (release only)
if: startsWith(github.ref, 'refs/tags/v')
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
publish:
name: Publish artifacts
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |-
python -m pip install -U pip
python -m pip install build twine
- name: Build packages
run: |-
python -m build
- name: Verify packages
run: |-
python -m twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: "dist/*"
- name: Publish to PyPI (release only)
if: startsWith(github.ref, 'refs/tags/v')
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
62 changes: 31 additions & 31 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@
name: Docs

on:
push:
branches: ["master"]
push:
branches: ["master"]

jobs:
sphinx:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Install dependencies
run: |
python -m pip install '.[docs]'
- name: Auto-generate APIDOC sources
run: |-
sphinx-apidoc --output-dir docs/source/code --force .
- name: Create docs
run: |
make -C docs html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
sphinx:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Install dependencies
run: |
python -m pip install '.[docs]'
- name: Auto-generate APIDOC sources
run: |-
sphinx-apidoc --output-dir docs/source/code --force .
- name: Create docs
run: |
make -C docs html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
68 changes: 34 additions & 34 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@
name: Lint

on:
push:
branches: ["*"]
push:
branches: ["*"]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
- name: Install pre-commit
run: |-
python -m pip install pre-commit types-docutils
- name: Run Pre-Commit
run: |-
pre-commit run --all-files
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
- name: Install pylint
run: |-
python -m pip install pylint
- name: Run pylint
run: |-
pylint -dfixme capella_ros_tools || exit $(($? & ~24))
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Upgrade pip
run: |-
python -m pip install -U pip
- name: Install pre-commit
run: |-
python -m pip install pre-commit types-docutils
- name: Run Pre-Commit
run: |-
pre-commit run --all-files
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Upgrade pip
run: |-
python -m pip install -U pip
- name: Install pylint
run: |-
python -m pip install pylint
- name: Run pylint
run: |-
pylint -dfixme capella_ros_tools || exit $(($? & ~24))
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ venv.bak/
.spyderproject
.spyproject

# VS Code settings
.vscode/

# Rope project settings
.ropeproject

Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright DB Netz AG and contributors
# SPDX-License-Identifier: CC0-1.0

[submodule "capella_ros_tools/ros_interfaces/common_interfaces"]
path = capella_ros_tools/ros_interfaces/common_interfaces
[submodule "common_interfaces"]
path = capella_ros_tools/msg_to_capella/ros_interfaces/common_interfaces
url = https://github.com/ros2/common_interfaces.git
[submodule "capella_ros_tools/ros_interfaces/rcl_interfaces"]
path = capella_ros_tools/ros_interfaces/rcl_interfaces
[submodule "rcl_interfaces"]
path = capella_ros_tools/msg_to_capella/ros_interfaces/rcl_interfaces
url = https://github.com/ros2/rcl_interfaces.git
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ The key differences are:
typing related classes like `t.TypedDict`.

<!-- prettier-ignore -->
Use the new syntax and classes for typing introduced with Python 3.10.
Use the new syntax and classes for typing introduced with Python 3.10 and available using
`from __future__ import annotations` since Python 3.8.

Be aware however that this only works in the context of annotations; the code
still needs to run on Python 3.9! This means that in some (rare) cases, you _must_ use the
old-style type hints.

- Instead of `t.Tuple`, `t.List` etc. use the builtin classes `tuple`, `list`
etc.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
![image](https://github.com/DSD-DBS/capella-ros-tools/actions/workflows/build-test-publish.yml/badge.svg)
![image](https://github.com/DSD-DBS/capella-ros-tools/actions/workflows/lint.yml/badge.svg)

Tools for using ROS with Capella
API and scripts to parse .msg files and convert them to Capella

# Documentation

Expand All @@ -26,7 +26,7 @@ To set up a development environment, clone the project and install it into a
virtual environment.

```sh
git clone --recurse-submodules https://github.com/DSD-DBS/capella-ros-tools
git clone https://github.com/DSD-DBS/capella-ros-tools
cd capella-ros-tools
python -m venv .venv

Expand Down
5 changes: 3 additions & 2 deletions capella_ros_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright DB Netz AG and contributors
# SPDX-License-Identifier: Apache-2.0
"""The capella-ros-tools package."""
"""The capella_ros_tools package."""

from importlib import metadata

try:
__version__ = metadata.version("capella-ros-tools")
__version__ = metadata.version("capella_ros_tools")
except metadata.PackageNotFoundError: # pragma: no cover
__version__ = "0.0.0+unknown"
del metadata
Loading

0 comments on commit d78d48a

Please sign in to comment.