Skip to content

Commit

Permalink
add CI workflow using Github Actions
Browse files Browse the repository at this point in the history
remove Travis CI as it's no longer free for open source.
  • Loading branch information
LraiZer authored and AbuBaniaz committed Jul 3, 2023
1 parent 4b76229 commit 1b99ab5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 50 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/autobouquetsmaker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: AutoBouquetsMaker

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

jobs:
build:
name: Build AutoBouquetsMaker
runs-on: ubuntu-22.04
strategy:
matrix:
gcc: [12]
python: ['3.11']
steps:
- name: Install prerequisites
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -q update
sudo apt-get install -y g++-${{ matrix.gcc }} automake build-essential gettext python${{ matrix.python }}-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install python packages
run: |
pip3 install six flake8
- name: Build AutoBouquetsMaker, gcc-${{ matrix.gcc }}, python ${{ matrix.python }}
env:
CC: "gcc-${{ matrix.gcc }}"
CXX: "g++-${{ matrix.gcc }}"
CXXFLAGS: "-g -Wall"
run: |
autoreconf -i
./configure
make
python -m compileall -l .
- name: Check format PEP8
run: |
echo "Checking locale format..."
find . -type f -name "*.po" -exec msgfmt {} -o {}.mo \;
echo "Checking PEP8 validation..."
flake8 --ignore=W191,E128,E501,E722 . --exit-zero
echo "Check format PEP8 completed!"
# PEP8 :- IGNORE CODES
# W191 : indentation contains tabs
# E128 : continuation line under-indented for visual indent
# E501 : line too long (> 79 characters)
# E722 : do not use bare 'except'
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AutoBouquetsMaker [![Build Status](https://travis-ci.org/oe-alliance/AutoBouquetsMaker.svg?branch=master)](https://travis-ci.org/oe-alliance/AutoBouquetsMaker)
AutoBouquetsMaker [![Build Status](https://github.com/oe-alliance/AutoBouquetsMaker/actions/workflows/autobouquetsmaker.yml/badge.svg)](https://github.com/oe-alliance/AutoBouquetsMaker/actions/workflows/autobouquetsmaker.yml)
================

Automatically build and update bouquets from the DVB stream.

12 comments on commit 1b99ab5

@LraiZer
Copy link
Contributor Author

@LraiZer LraiZer commented on 1b99ab5 Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'Check format PEP8' task shows a lot more PEP8 noise remaining, even after last months PEP8 double aggressive commit.

@AbuBaniaz
Copy link
Contributor

@AbuBaniaz AbuBaniaz commented on 1b99ab5 Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Owing to objections, not all the PEP rules/guides/preferences were added to the script that Persian Prince uses. I don't think that anybody in E2 community will abandon tabs for four spaces.

Feel free to make other PEP changes that are beneficial. And resolve some of the translation script noise :)

@LraiZer
Copy link
Contributor Author

@LraiZer LraiZer commented on 1b99ab5 Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PEP8 checker added to this workflow allows for tab indentation instead of 4 spaces, but not a mixture.
This one commit #272 fixes 65 of the warnings due indentation contains mixed spaces and tabs. :)

@AbuBaniaz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LraiZer
Copy link
Contributor Author

@LraiZer LraiZer commented on 1b99ab5 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After todays last two commits are merged, all the whitespace warnings noise should be silenced.
The ABM dev's mostly only need to fix the remaing warnings about the unused imports, variables and the conditional statements.

Checking PEP8 validation...
./AutoBouquetsMaker/src/__init__.py:5:1: F401 'Tools.Directories.SCOPE_LANGUAGE' imported but unused
./AutoBouquetsMaker/src/__init__.py:6:1: F401 'os' imported but unused
./AutoBouquetsMaker/src/hidesections.py:8:1: F401 'Components.config.getConfigListEntry' imported but unused
./AutoBouquetsMaker/src/keepbouquets.py:8:1: F401 'Components.config.getConfigListEntry' imported but unused
./AutoBouquetsMaker/src/menu.py:8:1: F401 '.scanner.manager.Manager' imported but unused
./AutoBouquetsMaker/src/menu.py:33:1: F401 'time.localtime' imported but unused
./AutoBouquetsMaker/src/menu.py:33:1: F401 'time.time' imported but unused
./AutoBouquetsMaker/src/menu.py:33:1: F401 'time.strftime' imported but unused
./AutoBouquetsMaker/src/menu.py:56:3: E741 ambiguous variable name 'l'
./AutoBouquetsMaker/src/menu.py:76:3: E741 ambiguous variable name 'l'
./AutoBouquetsMaker/src/menu.py:110:13: E711 comparison to None should be 'if cond is None:'
./AutoBouquetsMaker/src/ordering.py:8:1: F401 'Components.config.getConfigListEntry' imported but unused
./AutoBouquetsMaker/src/plugin.py:15:1: F401 'Components.config.configfile' imported but unused
./AutoBouquetsMaker/src/plugin.py:15:1: F401 'Components.config.getConfigListEntry' imported but unused
./AutoBouquetsMaker/src/scanner/bouquetsreader.py:20:4: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/bouquetsreader.py:40:4: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/bouquetsreader.py:57:3: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:384:3: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:398:3: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/dvbscanner.py:8:1: F401 'os' imported but unused
./AutoBouquetsMaker/src/scanner/dvbscanner.py:262:147: E712 comparison to True should be 'if cond is True:' or 'if cond:'
./AutoBouquetsMaker/src/scanner/frequencyfinder.py:22:1: F401 'errno' imported but unused
./AutoBouquetsMaker/src/scanner/frequencyfinder.py:[18](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:19)6:27: F821 undefined name 'ngettext'
./AutoBouquetsMaker/src/scanner/frequencyfinder.py:188:134: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
./AutoBouquetsMaker/src/scanner/main.py:11:1: F401 'Components.Pixmap.Pixmap' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:27:1: F401 'os' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:28:1: F401 'sys' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:30:1: F401 'Tools.Directories.resolveFilename' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:30:1: F401 'Tools.Directories.fileExists' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:30:1: F401 'Tools.Directories.SCOPE_CURRENT_SKIN' imported but unused
./AutoBouquetsMaker/src/scanner/main.py:471:3: F841 local variable 'INTERNAL_PID_STATUS_NOOP' is assigned to but never used
./AutoBouquetsMaker/src/scanner/main.py:472:3: F841 local variable 'INTERNAL_PID_STATUS_WAITING' is assigned to but never used
./AutoBouquetsMaker/src/scanner/main.py:740:3: F401 'Screens.Standby.Standby' imported but unused
./AutoBouquetsMaker/src/scanner/manager.py:151:6: F841 local variable 'current_bouquet' is assigned to but never used
./AutoBouquetsMaker/src/scanner/manager.py:152:6: F841 local variable 'current_region' is assigned to but never used
./AutoBouquetsMaker/src/scanner/providerconfig.py:18:4: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/tools.py:6:1: F401 'codecs' imported but unused
./AutoBouquetsMaker/src/scanner/tools.py:28:3: F841 local variable 'e' is assigned to but never used
./AutoBouquetsMaker/src/scanner/tools.py:61:[20](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:21): F8[21](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:22) undefined name 'unicode'
./AutoBouquetsMaker/src/scanner/tools.py:327:3: F841 local variable 'bouquetsToHide' is assigned to but never used
./AutoBouquetsMaker/src/setup.py:20:1: F401 '.log' imported but unused
./AutoBouquetsMaker/src/setup.py:21:1: F401 'itertools' imported but unused
./AutoBouquetsMaker/src/setup.py:3[23](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:24):189: E712 comparison to True should be 'if cond is True:' or 'if cond:'
./AutoBouquetsMaker/src/setup.py:480:3: F841 local variable 'bouquets' is assigned to but never used
./AutoBouquetsMaker/src/setup.py:481:3: F841 local variable 'bouquets_list' is assigned to but never used
./AutoBouquetsMaker/src/setup.py:482:3: F841 local variable 'bouquet_default' is assigned to but never used
./AutoBouquetsMaker/src/updateproviders.py:116:[28](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:29): E712 comparison to False should be 'if cond is False:' or 'if not cond:'
./xml2po.py:[31](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:32):[41](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:42): W[60](https://github.com/oe-alliance/AutoBouquetsMaker/actions/runs/5466445092/jobs/9951372986#step:7:61)5 invalid escape sequence '\Z'
./xml2po.py:73:8: E741 ambiguous variable name 'l'
Check format PEP8 completed!

@AbuBaniaz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Down to following:

Checking PEP8 validation...
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:329:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:339:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:537:69: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/frequencyfinder.py:186:27: F821 undefined name 'ngettext'
./AutoBouquetsMaker/src/scanner/main.py:471:3: F841 local variable 'INTERNAL_PID_STATUS_NOOP' is assigned to but never used
./AutoBouquetsMaker/src/scanner/main.py:472:3: F841 local variable 'INTERNAL_PID_STATUS_WAITING' is assigned to but never used
./AutoBouquetsMaker/src/scanner/tools.py:60:20: F821 undefined name 'unicode'
./xml2po.py:31:41: W605 invalid escape sequence '\Z'
./xml2po.py:73:8: E741 ambiguous variable name 'l'
Check format PEP8 completed!

@Huevos
Copy link
Member

@Huevos Huevos commented on 1b99ab5 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./AutoBouquetsMaker/src/scanner/bouquetswriter.py:329:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:339:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:537:69: F821 undefined name 'e'

No idea why that shows because the file is fixed.

ngettext and unicode are available even though they are not specifically imported. So not an error.
PID_STATUS there for info but not used.

@LraiZer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./AutoBouquetsMaker/src/scanner/bouquetswriter.py:329:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:339:35: F821 undefined name 'e'
./AutoBouquetsMaker/src/scanner/bouquetswriter.py:537:69: F821 undefined name 'e

except Exception as e:
or
remove the e

except: print("[ABM-BouquetsWriter] ", e, file=log)

@LraiZer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./xml2po.py:31:41: W605 invalid escape sequence '\Z'

try silence with no quality assurance comment!

self.ishex = re.compile('#[0-9a-fA-F]+\Z') # noqa: W605

@Huevos
Copy link
Member

@Huevos Huevos commented on 1b99ab5 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./AutoBouquetsMaker/src/scanner/bouquetswriter.py:329:35: F821 undefined name 'e' ./AutoBouquetsMaker/src/scanner/bouquetswriter.py:339:35: F821 undefined name 'e' ./AutoBouquetsMaker/src/scanner/bouquetswriter.py:537:69: F821 undefined name 'e

except Exception as e: or remove the e

except: print("[ABM-BouquetsWriter] ", e, file=log)

Opps. Ok, so that is fixed.

@Huevos
Copy link
Member

@Huevos Huevos commented on 1b99ab5 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LraiZer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, any new PR can be quickly looked at in the PEP8 checker for quality control before commit now :)

Please sign in to comment.