Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 24 additions & 60 deletions .github/workflows/CI-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
matrix:
os-version: ["windows-latest", "ubuntu-latest", "macos-14"]
python-version: ["3.11"]
poetry-version: ["1.8.3"]
ccrestoration-version: ["0.2.2"]

runs-on: ${{ matrix.os-version }}
steps:
Expand All @@ -37,31 +35,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: |
pip install numpy==1.26.4
pip install opencv-python==4.10.0.84

pip install ccrestoration==${{ matrix.ccrestoration-version }}

pip install PyYAML pydantic loguru
pip install pre-commit scikit-image
pip install pytest pytest-cov coverage
pip install mypy ruff

- name: Install PyTorch on Windows
if: matrix.os-version == 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128

- name: Install PyTorch on non-Windows
if: matrix.os-version != 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1
uv sync

- name: Test
run: |
Expand All @@ -81,8 +60,6 @@ jobs:
matrix:
os-version: ["windows-latest", "ubuntu-latest", "macos-14"]
python-version: ["3.11"]
poetry-version: ["1.8.3"]
ccrestoration-version: ["0.2.2"]

runs-on: ${{ matrix.os-version }}
steps:
Expand All @@ -94,32 +71,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: |
pip install numpy==1.26.4
pip install opencv-python==4.10.0.84

pip install ccrestoration==${{ matrix.ccrestoration-version }}

pip install PyYAML pydantic loguru

- name: Install PyTorch on Windows
if: matrix.os-version == 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128

- name: Install PyTorch on non-Windows
if: matrix.os-version != 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1
uv sync --no-default-groups --group dev

- name: Build
run: |
pip install pyinstaller~=6.14.2
make gen
make pyinstaller

Expand Down Expand Up @@ -179,7 +139,6 @@ jobs:
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.8.3"]

runs-on: ubuntu-latest
steps:
Expand All @@ -191,9 +150,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Build package
run: |
Expand All @@ -211,6 +169,7 @@ jobs:
matrix:
os-version: ["ubuntu-latest"]
python-version: ["3.11"]
pytorch-version: ["2.7.1", "2.1.2", "2.0.0"]

runs-on: ${{ matrix.os-version }}
steps:
Expand All @@ -227,6 +186,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install PyTorch 2.7.1
if: matrix.pytorch-version == '2.7.1'
run: |
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1

- name: Install PyTorch 2.1.2
if: matrix.pytorch-version == '2.1.2'
run: |
pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2

- name: Install PyTorch 2.0.0
if: matrix.pytorch-version == '2.0.0'
run: |
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1

- name: Install dependencies
run: |
pip install numpy==1.26.4
Expand All @@ -235,16 +209,6 @@ jobs:
cd dist
pip install *.whl

- name: Install PyTorch on Windows
if: matrix.os-version == 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128

- name: Install PyTorch on non-Windows
if: matrix.os-version != 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1

- name: Test pip
run: |
cd scripts
Expand Down
32 changes: 5 additions & 27 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
matrix:
os-version: ["windows-latest", "macos-14"]
python-version: ["3.11"]
poetry-version: ["1.8.3"]
ccrestoration-version: ["0.2.2"]

runs-on: ${{ matrix.os-version }}
steps:
Expand All @@ -34,34 +32,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: |
pip install numpy==1.26.4
pip install opencv-python==4.10.0.84

pip install ccrestoration==${{ matrix.ccrestoration-version }}

pip install PyYAML pydantic loguru

- name: Install PyTorch on Windows
if: matrix.os-version == 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128

- name: Install PyTorch on non-Windows
if: matrix.os-version != 'windows-latest'
run: |
pip install torch==2.7.1 torchvision==0.22.1
uv sync --no-default-groups --group dev

- name: Build
run: |
pip install pyinstaller~=6.14.2
make gen
make gen-ts
make pyinstaller

- name: zip-windows
Expand Down Expand Up @@ -109,7 +89,6 @@ jobs:
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.8.3"]

runs-on: ubuntu-latest
steps:
Expand All @@ -121,9 +100,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Build package
run: |
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -11,26 +11,26 @@ repos:

# autofix json, yaml, markdown...
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
rev: v4.0.0-alpha.8
Comment thread
Tohrusky marked this conversation as resolved.
hooks:
- id: prettier

# autofix toml
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
rev: v2.15.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.13.1
hooks:
- id: ruff-format
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.18.2
hooks:
- id: mypy
args: [Final2x_core, tests]
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

.PHONY: test
test:
poetry run pytest --cov=Final2x_core --cov-report=xml --cov-report=html
uv run --no-sync pytest --cov=Final2x_core --cov-report=xml --cov-report=html

.PHONY: lint
lint:
poetry run pre-commit install
poetry run pre-commit run --all-files
uv run --no-sync pre-commit install
uv run --no-sync pre-commit run --all-files

.PHONY: gen
gen:
poetry run python scripts/gen_config.py
uv run --no-sync python scripts/gen_config.py

.PHONY: gen-ts
gen-ts:
poetry run python scripts/gen_pretrained_model_name.py
uv run --no-sync python scripts/gen_pretrained_model_name.py

.PHONY: build
build:
poetry build --format wheel
uv build --wheel

.PHONY: pyinstaller
pyinstaller:
poetry run pyinstaller -n Final2x-core -i assets/favicon.ico Final2x_core/__main__.py
poetry run python scripts/post_pyinstaller.py
uv run --no-sync pyinstaller -n Final2x-core -i assets/favicon.ico Final2x_core/__main__.py
uv run --no-sync python scripts/post_pyinstaller.py
2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

Loading
Loading