Skip to content

Commit

Permalink
Introduced workflows, mypy, ruff and pylint
Browse files Browse the repository at this point in the history
- Workflow that validates that the python apis can be generated
 * mypy runs after this because it is dependent on generated code
- Added ruff configuration
 * workflow validate formatting and code style
- Added missing __init__.py files that are needed by tools in order to
derive fqn
- Added py.typed
 * Package maintainers who wish to support type checking of their code
   MUST add a marker file named py.typed to their package supporting typing
- .pylintrc which ignores some more warnings compared to the default
  settings
- Formatted code according to new rules, ignored some warnings
  • Loading branch information
JohanKarlbergg committed Jan 23, 2024
1 parent 886e659 commit f40d0a6
Show file tree
Hide file tree
Showing 17 changed files with 1,003 additions and 298 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-docs-mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Doc builder and mypy

on: push

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build docs
env:
NO_TTY: true
run: |
cd python/remotivelabs-broker
./docker-build.sh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
architecture: x64
- name: Install mypy
run: |
pip install mypy
pip install python/remotivelabs-broker
pip install python/remotivelabs-broker[default]
- name: Run mypy
run: mypy .
39 changes: 39 additions & 0 deletions .github/workflows/code-qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Code-QA

on: push

jobs:
ruff-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1

ruff-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
src: "."
args: format --check --diff

pylint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
architecture: x64
- name: Install pylint
run: |
pip install pylint
pip install python/remotivelabs-broker
pip install python/remotivelabs-broker[default]
- name: Run pylint
run: |
cd python/remotivelabs-broker
pylint **/*.py
Loading

0 comments on commit f40d0a6

Please sign in to comment.