Skip to content

Commit

Permalink
Feature/gtk4 (#27)
Browse files Browse the repository at this point in the history
* fix: type checking
* chore: cleanups
* fix: faster startup
* chore: update poetry in cicd
  • Loading branch information
dynobo committed Feb 12, 2023
1 parent 3906ebb commit 141cd31
Show file tree
Hide file tree
Showing 21 changed files with 765 additions and 1,052 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/build-publish.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "coverage.io"

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Test Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry==1.3.2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install \
libgirepository1.0-dev \
libcairo2-dev \
python3-gi \
gobject-introspection \
libgtk-3-dev
- name: Poetry install
run: poetry install
- name: Pytest
run: poetry run pytest --cov --cov-report=xml
- name: Coveralls
run: poetry run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
89 changes: 89 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Test
on: [push, pull_request]

concurrency:
group: cicd-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test on Linux64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry==1.3.2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install \
libgirepository1.0-dev \
libcairo2-dev \
python3-gi \
gobject-introspection \
libgtk-4-dev
- name: Poetry install
run: poetry install
- name: Ruff
run: poetry run ruff check .
- name: Black
run: poetry run black --check .
- name: Isort
run: poetry run isort --check .
- name: Mypy
run: poetry run mypy
- name: Pytest
run: poetry run pytest
- name: Test AppImage build
run: poetry run make clean-build

publish:
name: Build & Publish
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry==1.3.2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install \
libgirepository1.0-dev \
libcairo2-dev \
python3-gi \
gobject-introspection \
libgtk-3-dev
- name: Poetry install
run: poetry install
# Prepare Release
- name: Build AppImage
run: poetry run make clean-build
- name: Draft release
uses: softprops/action-gh-release@v1
with:
files: |
*.AppImage
body:
See [CHANGELOG](https://github.com/dynobo/keyhint/blob/main/CHANGELOG) for
details.
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish to PyPi
- name: Build and publish to PyPi
run: |
poetry publish \
--build \
--username __token__ \
--password ${{ secrets.PYPI_KEYHINT_TOKEN }}
47 changes: 0 additions & 47 deletions .github/workflows/test-build.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ cheatsheet.jpeg
.vscode
run.sh
*.*~
*.AppImage
*.bin
keyhint.dist-info/
app.build
app.onefile-build
app.dist


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ repos:
name: pytest
stages: [commit]
language: system
entry:
poetry run pytest tests/ -vv --cov --cov-report xml:cov.xml --cov-report html
entry: poetry run pytest tests/ -vv --cov --cov-report html
types: [python]
pass_filenames: false
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ SHELL := /bin/bash

.ONESHELL:
clean:
rm -rf ./app.onefile-build
rm -rf ./app.build
rm -rf ./app.dist

Expand All @@ -10,10 +11,12 @@ build:
python -m nuitka \
--onefile \
--assume-yes-for-downloads \
--enable-plugin=anti-bloat \
--enable-plugin=gi \
--enable-plugin=no-qt \
--include-data-dir=keyhint/config=keyhint/config \
--include-data-dir=keyhint/resources=keyhint/resources \
--linux-icon=keyhint/resources/keyhint.svg \
--file-version=0.2.4 \
--product-name=KeyHint \
-o KeyHint-0.2.4-x86_64.AppImage \
keyhint/app.py

Expand Down
Loading

0 comments on commit 141cd31

Please sign in to comment.