diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 6e17e5a..be49c9d 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -13,10 +13,26 @@ permissions: contents: read jobs: - build: - + test-offline: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - 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 + test-api-live: + needs: test-offline runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -26,14 +42,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi -# - 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 --log-cli-level=DEBUG diff --git a/Makefile b/Makefile index b1e1c75..71e2842 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ -.PHONY: test build upload clean +.PHONY: test-offline test-api-live build upload clean all: @echo "usage: make [test | build | upload | clean]" -test: +test-offline: + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + +test-api-live: pytest --log-cli-level=DEBUG build: diff --git a/src/purei9_unofficial/imageascii2.py b/src/purei9_unofficial/imageascii2.py deleted file mode 100644 index 688ab46..0000000 --- a/src/purei9_unofficial/imageascii2.py +++ /dev/null @@ -1,69 +0,0 @@ - - - -BLOCKS = [ - -" ", - -"▘", - -"▝", - -"▀", - -"▖", - -"▌", - -"▞", - -"▛", - -"▗", - -"▚", - -"▐", - -"▜", - -"▄", - -"▙", - -"▟", - -"█" - -] - -def pic2block(pic): - global BLOCKS - - buf = "" - - h = len(pic) - w = len(pic[0]) - - for y in range(0, h, 2): - for x in range(0, w, 2): - - a = pic[y][x] - b = pic[y][x + 1] - c = pic[y + 1][x] - d = pic[y + 1][x + 1] - - code = a + 2*b + 4*c + 8*d - - buf += BLOCKS[code] - - buf += "\n" - - - return buf - -print(pic2block(PIC)) - - - -