Skip to content
Closed
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
65 changes: 28 additions & 37 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ permissions:

jobs:
analyse-supported:
name: testing on supported versions
name: testing on versions (supported)
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
supported-python-version: [ "3.10", "3.11", "3.12" ]
best_effort-python-version: [ "3.9" ]
os: [ "ubuntu-22.04", "macos-12", "windows-2022" ]
supported-python-version: [ "3.10.13", "3.11.7", "3.12.1", "3.9.18" ]
best_effort-python-version: [ "3.8.18" ]

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

steps:
- name: Checkout the repository
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Python ${{ matrix.supported-python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.supported-python-version }}
allow-prereleases: true
Expand All @@ -47,62 +47,53 @@ jobs:

- name: Lint check with Ruff
run: |
if [ ${{ matrix.supported-python-version }} == 3.7 ]; then
ruff check $(git ls-files '*.py') --target-version=py37
fi
if [ ${{ matrix.supported-python-version }} == 3.8 ]; then
ruff check $(git ls-files '*.py') --target-version=py38
fi
if [ ${{ matrix.supported-python-version }} == 3.9 ]; then
ruff check $(git ls-files '*.py') --target-version=py39
fi
if [ ${{ matrix.supported-python-version }} == 3.10 ]; then
ruff check $(git ls-files '*.py') --target-version=py310
fi
if [ ${{ matrix.supported-python-version }} == 3.11 ]; then
ruff check $(git ls-files '*.py') --target-version=py311
fi
if [ ${{ matrix.supported-python-version }} == 3.12 ]; then
ruff check $(git ls-files '*.py') --target-version=py312
fi
ruff check $(git ls-files '*.py')

- name: Static analysis with MyPy
run: |
mypy $(git ls-files '*.py') --python-version ${{ matrix.supported-python-version }}
mypy $(git ls-files '*.py')

- name: Testing with Pytest
run: |
cd scripts
pytest

analyse-best_effort:
name: static analysis on best effort
analyse-best-effort:
name: testing on versions (best-effort)
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
base-python-version: [ "3.11" ]
best_effort-python-version: [ "3.9" ]
os: [ "ubuntu-22.04", "macos-12", "windows-2022" ]
legacy-python-version: [ "3.8.18" ]

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

steps:
- name: Checkout the repository
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Python ${{ matrix.base-python-version }}
uses: actions/setup-python@v4
- name: Set up Python ${{ matrix.legacy-python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.base-python-version }}
python-version: ${{ matrix.legacy-python-version }}
allow-prereleases: true

- name: Install dependencies
run: |
run: | # $(git ls-files '*dev-requirements.txt') # $(git ls-files '*requirements.txt')
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
pip install -r scripts/dev-requirements.txt

- name: Lint check with Ruff
run: |
ruff check $(git ls-files '*.py')

- name: Static analysis with MyPy
run: |
mypy $(git ls-files '*.py') --python-version ${{ matrix.best_effort-python-version }}
mypy $(git ls-files '*.py')

- name: Testing with Pytest
run: |
cd scripts
pytest
21 changes: 11 additions & 10 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# `> Image_manipulation`
Python script that's mostly used for image manipulation

| Python version | Support status |
| -------------- | ----------------- |
| 3.12 | ✅ Supported |
| 3.11 | ✅ Supported |
| 3.10 | ✅ Supported |
| 3.9 | ✅ Supported |
| 3.8 | ⚙️ Best effort |
| =<3.7 | ❌ Not Supported |
| Python version | Support status |
| -------------- | -------------------------------------------- |
| 3.13 | ❌ Best effort if the dependency is ready |
| 3.12 | ✅ Supported |
| 3.11 | ✅ Supported |
| 3.10 | ✅ Supported |
| 3.9 | ✅ Supported |
| 3.8 | ⚙️ Best effort |
| =<3.7 | ❌ Not Supported |

## `> Image // Contributing`

Thanks for consider contributing.
> [!IMPORTANT]
> This guide assume that you already installed Python 3.10 or higher and pytest.
> This guide assume that you already installed Python 3.9 or higher and pytest.

Running the script:
1. Clone the repository: `[email protected]:validcube/validcube.git && cd scripts`
Expand All @@ -33,5 +34,5 @@ Developing the script:

Here are some tip when contributing:
* All commits must follows the [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) guidelines.
* [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) are highly recommended.
* [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) are **required**.
* This repository follows slight variation of [Google's Python style](https://google.github.io/styleguide/pyguide.html) guide **but not strictly enforced**.