Skip to content

Commit

Permalink
Merge pull request #176 from e100/pyqt6_reorganize
Browse files Browse the repository at this point in the history
Pyqt6 reorganize
  • Loading branch information
e100 authored Jan 7, 2025
2 parents 6d3612f + 7a30fa1 commit af2905c
Show file tree
Hide file tree
Showing 166 changed files with 8,117 additions and 6,287 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI

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


jobs:
build:

runs-on: ubuntu-latest
permissions:
# Needed to save data for comment
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: |
sudo apt install -y libegl1
python -m pip install --upgrade pip
pip install flake8 pytest pytest-qt pytest-env pytest-cov
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt

36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .github/workflows/coverage.yml
name: Post coverage comment

on:
workflow_run:
workflows: ["CI"]
types:
- completed

jobs:
test:
name: Run tests & display coverage
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
# Gives the action the necessary permissions for looking up the
# workflow that launched this workflow, and download the related
# artifact that contains the comment to be published
actions: read
steps:
# DO NOT run actions/checkout here, for security reasons
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
# Update those if you changed the default values:
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action
# COMMENT_FILENAME: python-coverage-comment-action.txt
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include fixgw/config *
recursive-include src/fixgw/config *
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
################################
# Makefile for pyavtools #
################################
SHELL := /bin/bash


##################################### I N I T T A R G E T S #####################################
venv.marker:
python3 -m venv venv
source venv/bin/activate ; pip install --upgrade pip
source venv/bin/activate ; pip install black
source venv/bin/activate ; pip install pytest
source venv/bin/activate ; pip install pytest-qt
source venv/bin/activate ; pip install pytest-env
source venv/bin/activate ; pip install pytest-cov
touch venv.marker
echo -e "\nRun:\nsource venv/bin/activate"
venv: venv.marker
.PHONY: venv

init.marker: pyproject.toml
source venv/bin/activate ; pip install -e .[install]
touch init.marker
init: venv.marker init.marker
.PHONY: init

#################################### W H E E L T A R G E T S ####################################
init-build.marker: init
source venv/bin/activate ; pip install -e .[build]
touch init-build.marker

init-build: init-build.marker
.PHONY: init-build

wheel: init-build
source venv/bin/activate ; python -m build --wheel


test: init
source venv/bin/activate ; pytest

.PHONY: test

clean:
rm -rfI venv || true
rm -fI extras/extras/test_results/*.html || true
rm -fI extras/extras/test_results/*.png || true
rm -rfI extras/extras/test_results/htmlcov/ || true
rm -f init-build.marker || true
rm -f init.marker || true
rm -f venv.marker || true
.PHONY: clean
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ $ sudo ip link set up vcan0
```

If you intend to use the gui plugin you will also need PyQt installed. Note that if you use pyEfis
then PyQt is required. FixGW should work with either PyQt4 or PyQt5, however support for PyQT4 is
likely to be dropped. Consult the PyQt documentation on how to install PyQt on your system.
then PyQt is required. FixGW should work with PyQt6.
Consult the PyQt documentation on how to install PyQt on your system.
Typically it is

sudo apt-get install python3-pyqt5
sudo apt-get install python3-pyqt6

The canfix plugin will require both the python-can package as well as the
python-canfix package. Installing the python-canfix package with pip3 should
Expand Down
3 changes: 1 addition & 2 deletions fixgw.py → fixGw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
#!/usr/bin/env python3

# Copyright (c) 2018 Phil Birkelbach
Expand All @@ -17,5 +16,5 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

from fixgw import server
import fixgw.server as server
server.main()
File renamed without changes.
4 changes: 0 additions & 4 deletions fixgw/config/connections/gui.yaml

This file was deleted.

Loading

0 comments on commit af2905c

Please sign in to comment.