Skip to content

Commit

Permalink
Update workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed Jan 15, 2024
1 parent 832e02b commit 4de2d24
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 59 deletions.
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
patreon: nekitdev
github: [nekitdev]
github: [nekitdev]
25 changes: 15 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,36 @@ on:
jobs:
check:
name: Check
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu, windows, macos]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python 3.12
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: poetry
python-version: ${{ matrix.python-version }}

- name: Update submodules
run: git submodule update --init --remote

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Poetry
run: pipx install poetry

- name: Configure Poetry
run: poetry config virtualenvs.in-project true

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with check --with test --all-extras
run: poetry install --all-extras

- name: Run type checks
run: poetry run mypy .
10 changes: 3 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: poetry

- name: Update submodules
run: git submodule update --init --remote

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure Poetry
run: poetry config virtualenvs.in-project true

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with docs --all-extras

Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,31 @@ jobs:
os: [ubuntu, macos, windows]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Update submodules
run: git submodule update --init --remote

- name: Update PATH
if: ${{ matrix.os != 'windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update PATH for Windows
if: ${{ matrix.os == 'windows' }}
run: echo "$APPDATA/Python/Scripts" >> $GITHUB_PATH
- name: Install Poetry
run: pipx install poetry

- name: Configure Poetry
run: poetry config virtualenvs.in-project true

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with build
run: poetry install

- name: Build
run: poetry build
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Update submodules
run: git submodule update --init --remote

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Poetry
run: pipx install poetry

- name: Configure Poetry
run: poetry config virtualenvs.in-project true

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with test --all-extras
run: poetry install --all-extras

- name: Run tests
run: poetry run pytest --cov-report xml
Expand Down
16 changes: 0 additions & 16 deletions gd/api/color_channels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

from enum import Enum
from typing import TYPE_CHECKING, Dict, Iterable, Optional, Union

from attrs import define, field
Expand Down Expand Up @@ -93,21 +92,6 @@
COLOR_4_CHANNEL_ID = 4


class ColorChannelType(Enum):
PLAYER = 0
NORMAL = 1
COPIED = 2

def is_player(self) -> bool:
return self is type(self).PLAYER

def is_normal(self) -> bool:
return self is type(self).NORMAL

def is_copied(self) -> bool:
return self is type(self).COPIED


COLOR_CHANNEL_ID_NOT_PRESENT = "color channel ID is not present"


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ speed = ["lxml"]
console = ["ipython"]

[tool.poetry.group.format.dependencies]
ruff = "0.1.11"
ruff = "0.1.13"

[tool.poetry.group.check.dependencies]
mypy = "1.8.0"
Expand Down

0 comments on commit 4de2d24

Please sign in to comment.