From 279fc38ba64ce7d93a6298534c366c82a3042a18 Mon Sep 17 00:00:00 2001 From: backwardspy Date: Thu, 3 Nov 2022 23:24:30 +0000 Subject: [PATCH] ci: add lint workflow --- .github/workflows/lint.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/test.yaml | 23 +++++++++++++++++++++++ catppuccin.py | 3 ++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..629f93f --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,26 @@ +name: Lint +on: + push: + paths: + - '**.py' +jobs: + lint: + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.2.2" + - run: poetry config virtualenvs.create false + - run: poetry install + - run: isort --check . + - run: black --check . + - run: pylint catppuccin.py + - run: mypy . diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..12c8949 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,23 @@ +name: Test +on: + push: + paths: + - '**.py' +jobs: + test: + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.2.2" + - run: poetry config virtualenvs.create false + - run: poetry install + - run: pytest --cov catppuccin diff --git a/catppuccin.py b/catppuccin.py index 492d8a7..e8b9fb8 100644 --- a/catppuccin.py +++ b/catppuccin.py @@ -1,5 +1,6 @@ """🐍 Soothing pastel theme for Python.""" from dataclasses import dataclass +from typing import Tuple @dataclass(frozen=True) @@ -11,7 +12,7 @@ class Colour: blue: int @property - def rgb(self) -> tuple[int, int, int]: + def rgb(self) -> Tuple[int, int, int]: """Get the colour as a 3-tuple of red, green, and blue.""" return (self.red, self.green, self.blue)